rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public boolean populate(ComponentData data, float insertionOrder)
private boolean populate(ComponentData data, float insertionOrder, String assemblyId)
public boolean populate(ComponentData data, float insertionOrder) throws SQLException { return populate(data, insertionOrder, false); }
return populate(data, insertionOrder, false);
boolean result = false; ComponentData parent = data.getParent(); String id = getComponentAlibId(data); boolean isAdded = false; addComponentDataSubstitutions(data); substitutions.put(":assembly_id:", sqlQuote(assemblyId)); substitutions.put(":insertion_order:", String.valueOf(insertionOrder)); SortedSet oldArgs = (Sort...
public boolean populate(ComponentData data, float insertionOrder) throws SQLException { return populate(data, insertionOrder, false); }
substitutions.put(":component_lib_id:", getComponentLibId(data)); substitutions.put(":agent_org_prototype:", sqlQuote(assetData.getAssetClass()));
substitutions.put(":agent_org_class:", sqlQuote(assetData.getAssetClass())); substitutions.put(":agent_lib_name:", sqlQuote(data.getName()));
private void populateAgent(ComponentData data, boolean isAdded) throws SQLException { AgentAssetData assetData = data.getAgentAssetData(); if (assetData == null) return; substitutions.put(":component_lib_id:", getComponentLibId(data)); substitutions.put(":agent_org_prototype:", sqlQuote(...
executeUpdate(dbp.getQuery("insertAgentOrg", substitutions));
ResultSet rs = executeQuery(stmt, dbp.getQuery("checkAgentOrg", substitutions)); if (!rs.next()) { executeUpdate(dbp.getQuery("insertAgentOrg", substitutions)); } rs.close();
private void populateAgent(ComponentData data, boolean isAdded) throws SQLException { AgentAssetData assetData = data.getAgentAssetData(); if (assetData == null) return; substitutions.put(":component_lib_id:", getComponentLibId(data)); substitutions.put(":agent_org_prototype:", sqlQuote(...
preexistingItems.add(data); for (int i = 0, n = data.parameterCount(); i < n; i++) { preexistingItems.add(data.getParameter(i)); } AgentAssetData aad = data.getAgentAssetData(); if (aad != null) { for (int i = 0, n = aad.getRelationshipCount(); i < n; i++) { RelationshipData rd = aad.getRelationship(i); preexistingItem...
public void setPreexistingItems(ComponentData data) { preexistingItems.add(data); for (int i = 0, n = data.parameterCount(); i < n; i++) { preexistingItems.add(data.getParameter(i)); } AgentAssetData aad = data.getAgentAssetData(); if (aad != null) { for (int...
_itemsPerSection=null;
public void reset() { _sections=null; _sectionItem=null; _sectionKey=null; }
if(log.isDebugEnabled()) log.debug("section = "+section); if (section==null) section=NULL; Object sectionKey=copiableKeyForSection(section); if(log.isDebugEnabled()) log.debug("copiableKeyForSection = "+sectionKey); NSMutableArray itemsForSection=null; if (_sections.containsObject(section)) itemsForSection=(NSMutableAr...
if (section==EOKeyValueCoding.NullValue) section=null; Object sectionKey; if(section == null) { if(ignoreNulls) { continue; } section=NULL;
public NSArray sections() { if (_sections==null) { _sections= new NSMutableArray(); NSArray list=(NSArray)valueForBinding("list"); if (list!=null) { for (Enumeration e=list.objectEnumerator(); e.hasMoreElements();) { Object item=e.nextElement...
itemsForSection.addObject(item);
sectionKey = keyForSection(section); if(sectionKey instanceof NSArray) { NSArray array = (NSArray)sectionKey; int index = 0; for (Enumeration keys = ((NSArray)sectionKey).objectEnumerator(); keys.hasMoreElements(); ) { Object currentKey = keys.nextElement(); Object currentSection = ((NSArray)section).objectAtIndex(inde...
public NSArray sections() { if (_sections==null) { _sections= new NSMutableArray(); NSArray list=(NSArray)valueForBinding("list"); if (list!=null) { for (Enumeration e=list.objectEnumerator(); e.hasMoreElements();) { Object item=e.nextElement...
String sortKey = (String)valueForBinding("sortKey"); if(sortKey != null) { _sections = (NSMutableArray)_sections.valueForKeyPath(sortKey); }
} String sortKey = (String)valueForBinding("sortKey"); if(sortKey != null) { _sections = (NSMutableArray)_sections.valueForKeyPath(sortKey);
public NSArray sections() { if (_sections==null) { _sections= new NSMutableArray(); NSArray list=(NSArray)valueForBinding("list"); if (list!=null) { for (Enumeration e=list.objectEnumerator(); e.hasMoreElements();) { Object item=e.nextElement...
setValueForBinding((_sectionItem!=NULL && (_sectionItem ==null || !_sectionItem.equals(NULL))) ? _sectionItem : null, "subListSection"); setValueForBinding(_itemsPerSection.objectForKey(copiableKeyForSection(_sectionItem)),"subList");
setValueForBinding(_sectionItem!=NULL ? _sectionItem : null, "subListSection"); setValueForBinding(_itemsPerSection.objectForKey(keyForSection(_sectionItem)), "subList");
public void setSectionItem(Object section) { _sectionItem=section; setValueForBinding((_sectionItem!=NULL && (_sectionItem ==null || !_sectionItem.equals(NULL))) ? _sectionItem : null, "subListSection"); setValueForBinding(_itemsPerSection.objectForKey(copiableKeyForSection(_sectionItem)),"subL...
if (confs.length == 1 && "*".equals(confs[0])) { confs = md.getConfigurationsNames(); }
public static void main(String[] args) throws Exception { Options options = getOptions(); CommandLineParser parser = new GnuParser(); try { // parse the command line arguments CommandLine line = parser.parse( options, args ); if (line.hasOpti...
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.console");
createLogger();
public ConsoleStyledDocument() { bufferSize = DefaultStyledDocument.BUFFER_SIZE_DEFAULT * 4; minRemoveSize = (int)(bufferSize * .2); log = CSMART.createLogger("org.cougaar.tools.csmart.ui.console"); }
animator.stop(); System.exit(0);
new Thread(new Runnable() { public void run() { animator.stop(); System.exit(0); } }).start();
public void run(String[] args) { boolean startSlow = false; if (args.length > 1) { usage(getClass().getName()); } if (args.length == 1) { if (args[0].equals("-slow")) { startSlow = true; } else { usage(getClass().getName()); } } if (!startSlow) { setFlag('v', t...
public boolean getThrowErrorOnUnsupportedMethod() {
public static boolean getThrowErrorOnUnsupportedMethod() {
public boolean getThrowErrorOnUnsupportedMethod() { return iThrowError; }
else if (iThrowError) throw new UnsupportedMethodError();
public static String getWordBreakCharacters() { if (iLib != ReadlineLibrary.PureJava) return getWordBreakCharactersImpl(); else return null; }
else if (iThrowError) throw new UnsupportedMethodError();
public static boolean parseAndBind(String line) { if (iLib != ReadlineLibrary.PureJava) return parseAndBindImpl(line); else return true; }
else if (iThrowError) throw new UnsupportedMethodError();
public static void readHistoryFile(String filename) throws EOFException, UnsupportedEncodingException { if (iLib != ReadlineLibrary.PureJava) readHistoryFileImpl(filename); }
else if (iThrowError) throw new UnsupportedMethodError();
public static void readInitFile(String filename) throws IOException { if (iLib != ReadlineLibrary.PureJava) readInitFileImpl(filename); }
}
} else if (iThrowError) throw new UnsupportedMethodError();
public static void setCompleter(ReadlineCompleter rlc) { if (iLib != ReadlineLibrary.PureJava) { iCompleter = rlc; setCompleterImpl(rlc); } }
public void setThrowErrorOnUnsupportedMethod(boolean flag) {
public static void setThrowErrorOnUnsupportedMethod(boolean flag) {
public void setThrowErrorOnUnsupportedMethod(boolean flag) { iThrowError = flag; }
else if (iThrowError) throw new UnsupportedMethodError();
setWordBreakCharacters(String wordBreakCharacters) throws UnsupportedEncodingException { if (iLib != ReadlineLibrary.PureJava) setWordBreakCharactersImpl(wordBreakCharacters); }
else if (iThrowError) throw new UnsupportedMethodError();
public static void writeHistoryFile(String filename) throws EOFException, UnsupportedEncodingException { if (iLib != ReadlineLibrary.PureJava) writeHistoryFileImpl(filename); }
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.community");
createLogger();
public ULCommunityTableModel(Node node) { this.node = node; names = new Vector(); values = new Vector(); addAttribute(PropertyNames.COMMUNITY_MEMBERS); makePrettyNames(); log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.community"); }
if(application().isConcurrentRequestHandlingEnabled()) cat.warn("This Component is not multi-threading safe!");
public ERXOncePerRequestConditional(WOContext context) { super(context); if(application().isConcurrentRequestHandlingEnabled()) cat.warn("This Component is not multi-threading safe!"); }
resetDict(2, context().session().sessionID() + context().contextID());
currentStage = 2; resetDict();
public void appendToResponse(WOResponse aResponse, WOContext aContext) { resetDict(2, context().session().sessionID() + context().contextID()); super.appendToResponse(aResponse,aContext); }
int showCount = displayCountForKey(keyName());
int showCount = displayCountForKey(keyName() + "--" + currentStage);
public boolean displayContent() { int showCount = displayCountForKey(keyName()); if(cat.isDebugEnabled()) cat.debug("displayContent - showCount: " + showCount + " stage:" + stage); return showCount == 0; }
cat.debug("displayContent - showCount: " + showCount + " stage:" + stage);
cat.debug("displayContent - showCount: " + showCount + " stage:" + currentStage);
public boolean displayContent() { int showCount = displayCountForKey(keyName()); if(cat.isDebugEnabled()) cat.debug("displayContent - showCount: " + showCount + " stage:" + stage); return showCount == 0; }
return ((Integer)displayCountDict.objectForKey(key)).intValue();
return ((Integer)displayCountDict().objectForKey(key)).intValue();
public int displayCountForKey(String key) { return ((Integer)displayCountDict.objectForKey(key)).intValue(); }
resetDict(1, context().session().sessionID() + context().contextID());
currentStage = 1; resetDict();
public WOActionResults invokeAction(WORequest aRequest, WOContext aContext) { resetDict(1, context().session().sessionID() + context().contextID()); return super.invokeAction(aRequest,aContext); }
public void resetDict(int currentStage, String contextID) { int count = 0; String key = keyName();
public void resetDict() { String key = keyName() + "--" + currentStage;
public void resetDict(int currentStage, String contextID) { int count = 0; String key = keyName(); if(cat.isDebugEnabled()) cat.debug("stage:" + stage + ", currentStage:" + currentStage + ", context:" + contextID + ", lastID:" + lastID); if(stage != currentStage || lastID == null || !lastID.equal...
if(cat.isDebugEnabled()) cat.debug("stage:" + stage + ", currentStage:" + currentStage + ", context:" + contextID + ", lastID:" + lastID); if(stage != currentStage || lastID == null || !lastID.equals(contextID)) { if(cat.isDebugEnabled()) cat.debug("did reset"); if(displayCountDict != null) displayCountDict.removeAll...
if(displayCountDict().objectForKey(key) == null) { displayCountDict().setObjectForKey(ERXConstant.integerForInt(-1), key); } int count = ((Integer)displayCountDict().objectForKey(key)).intValue() + 1; displayCountDict().setObjectForKey(ERXConstant.integerForInt(count), key);
public void resetDict(int currentStage, String contextID) { int count = 0; String key = keyName(); if(cat.isDebugEnabled()) cat.debug("stage:" + stage + ", currentStage:" + currentStage + ", context:" + contextID + ", lastID:" + lastID); if(stage != currentStage || lastID == null || !lastID.equal...
resetDict(0, context().session().sessionID() + context().contextID());
currentStage = 0; resetDict();
public void takeValuesFromRequest(WORequest aRequest, WOContext aContext) { resetDict(0, context().session().sessionID() + context().contextID()); super.takeValuesFromRequest(aRequest,aContext); }
dbLog.debug("databaseContextDidSelectObjects "+fs);
dbLog.debug("databaseContextDidSelectObjects " + fs + " \n" + ERXUtilities.stackTrace());
public void databaseContextDidSelectObjects(EODatabaseContext dc, EOFetchSpecification fs, EODatabaseChannel channel) { if (dbLog.isDebugEnabled()) { dbLog.debug("databaseContextDidSelectObjects "+fs); ...
log.info("Created default delegate");
log.debug("Created default database context delegate");
public static ERXDatabaseContextDelegate defaultDelegate() { if (_defaultDelegate == null) { _defaultDelegate = new ERXDatabaseContextDelegate(); log.info("Created default delegate"); //ERXRetainer.retain(_defaultDelegate); // Retaining the delegate on the ObjC side. This mi...
return FileParseUtil.containsPattern(filename, "UniqueId");
if(FileParseUtil.containsPattern(filename, "^\\[UniqueId") || FileParseUtil.containsPattern(filename, "^\\[UIC") || !FileParseUtil.containsPattern(filename, "\\[Relationship\\]\\s*([^\\s#]+[^\\S\\n\\r]+){5}\\S*")) { return true; } else { return false; }
public static final boolean isOldStyleIni(String filename) { return FileParseUtil.containsPattern(filename, "UniqueId"); }
editingNodes.remove(node);
public void addChildren(Experiment experiment) { DefaultMutableTreeNode expNode = findNode(experiment); // first remove old nodes int n = expNode.getChildCount(); for (int i = 0; i < n; i++) { DefaultMutableTreeNode node = (DefaultMutableTreeNode)expNode.getChildAt(0); model.removeNodeFr...
addRecipeToList(recipe);
private DefaultMutableTreeNode addRecipeToWorkspace(RecipeComponent recipe, DefaultMutableTreeNode node) { DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(recipe, false); addNode(node, newNode); recipeNames.add(recipe.getRecipeName()); workspace.setSelection(newNode); insta...
while (societyNames.contains(name)) { name = societyNames.generateName(name); name = (String)JOptionPane.showInputDialog(this, "Enter Society Name", "Society Name Not Unique", JOptionPane.QUESTION_MESSAGE, null, null, name); if (name == null) return; } sc.setName(name);
String newName = societyNames.generateName(name); if (!newName.equals(name)) sc.setName(newName);
protected void addSociety(SocietyComponent sc) { String name = sc.getSocietyName(); // if name is not unique, then get an unique name for the society while (societyNames.contains(name)) { name = societyNames.generateName(name); name = (String)JOptionPane.showInputDialog(this, "Enter Society...
DefaultMutableTreeNode parentNode = null; DefaultMutableTreeNode node = getSelectedNode(); if (node != null) parentNode = (DefaultMutableTreeNode)node.getParent(); DefaultMutableTreeNode newNode = addSocietyToWorkspace(sc, (DefaultMutableTreeNode)parentNode); addSocietyToList(sc);
DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)(getSelectedNode().getParent()); addSocietyToWorkspace(sc, parentNode);
protected void addSociety(SocietyComponent sc) { String name = sc.getSocietyName(); // if name is not unique, then get an unique name for the society while (societyNames.contains(name)) { name = societyNames.generateName(name); name = (String)JOptionPane.showInputDialog(this, "Enter Society...
addSocietyToList(sc);
private DefaultMutableTreeNode addSocietyToWorkspace(SocietyComponent sc, DefaultMutableTreeNode node) { DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(sc, false); addNode(node, newNode); societyNames.add(sc.getSocietyName()); workspace.setSelection(newNode); installListe...
recipeNames.add(newName);
protected RecipeComponent copyRecipe(RecipeComponent recipe) { String newName = generateRecipeName(recipe.getRecipeName()); final RecipeComponent recipeCopy = (RecipeComponent)recipe.copy(newName); GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("DuplicateRecipe") { public void ru...
SocietyComponent society = newSocietyComponent();
SocietyComponent society = helper.createSocietyFromFile();
protected void createExperimentFromFile() { // query user for INI file and create society SocietyComponent society = newSocietyComponent(); if (society == null) return; Experiment experiment = new Experiment("Experiment for " + society.getSocietyName(), society, null); De...
Experiment experiment = new Experiment("Experiment for " + society.getSocietyName(), society, null);
Experiment experiment = createExperiment(society);
protected void createExperimentFromFile() { // query user for INI file and create society SocietyComponent society = newSocietyComponent(); if (society == null) return; Experiment experiment = new Experiment("Experiment for " + society.getSocietyName(), society, null); De...
folderNames.remove(node.getUserObject());
private void deleteEmptyFolders(DefaultMutableTreeNode node) { ArrayList nodesToDelete = new ArrayList(); Enumeration nodes = node.depthFirstEnumeration(); nodes.nextElement(); // skip the first node which is the start node while (nodes.hasMoreElements()) { DefaultMutableTreeNode childNode = (...
SocietyComponent society = experiment.getSocietyComponent(); if (society != null) societyNames.remove(society.getSocietyName()); int n = experiment.getRecipeComponentCount(); for (int i = 0; i < n; i++) recipeNames.remove(experiment.getRecipeComponent(i).getRecipeName());
protected void deleteExperimentInNode(DefaultMutableTreeNode node) { if (node == null) return; Experiment experiment = (Experiment)node.getUserObject(); if (!experiment.isEditable()) { int result = JOptionPane.showConfirmDialog(this, "Experiment " + ...
if (node.isLeaf())
if (node.isLeaf()) { folderNames.remove(node.getUserObject());
protected void deleteFolder() { DefaultMutableTreeNode node = getSelectedNode(); if (node == root) return; if (node == null) return; int reply = JOptionPane.showConfirmDialog(this, "Delete folder and all its contents?", "Delete Fo...
else
} else
protected void deleteFolder() { DefaultMutableTreeNode node = getSelectedNode(); if (node == root) return; if (node == null) return; int reply = JOptionPane.showConfirmDialog(this, "Delete folder and all its contents?", "Delete Fo...
removeSocietyFromList(society);
protected void deleteSocietyInNode(DefaultMutableTreeNode societyNode) { SocietyComponent society = (SocietyComponent)societyNode.getUserObject(); if (!society.isEditable()) { int result = JOptionPane.showConfirmDialog(this, "Society has been or is being used; delete anyway?", "Society Not Edit...
dialog.dispose(); }
organizer.duplicate(); }
public void actionPerformed(ActionEvent e) { dialog.dispose(); }
for (int i = 0; i < recipes.size(); i++) { RecipeComponent rc = (RecipeComponent)recipes.get(i); if (rc.getRecipeName().equals(name)) return rc; } return null;
return (RecipeComponent)recipeNames.getObjectInTree(RecipeComponent.class, root, name);
public RecipeComponent getRecipe(String name) { for (int i = 0; i < recipes.size(); i++) { RecipeComponent rc = (RecipeComponent)recipes.get(i); if (rc.getRecipeName().equals(name)) return rc; } return null; }
for (int i = 0; i < societies.size(); i++) { SocietyComponent sc = (SocietyComponent)societies.get(i); if (sc.getSocietyName().equals(name)) return sc; } return null;
return (SocietyComponent)societyNames.getObjectInTree(SocietyComponent.class, root, name);
public SocietyComponent getSociety(String name) { for (int i = 0; i < societies.size(); i++) { SocietyComponent sc = (SocietyComponent)societies.get(i); if (sc.getSocietyName().equals(name)) return sc; } return null; }
boolean allowExistingName) { return getUniqueName("Experiment", experimentNames, originalName,
boolean allowExistingName) { return experimentNames.getUniqueName("Experiment", originalName,
protected String getUniqueExperimentName(String originalName, boolean allowExistingName) { return getUniqueName("Experiment", experimentNames, originalName, allowExistingName, "isExperimentNameInDatabase"); }
return getUniqueName("Folder", folderNames, originalName,
return folderNames.getUniqueName("Folder", originalName,
private String getUniqueFolderName(String originalName, boolean allowExistingName) { return getUniqueName("Folder", folderNames, originalName, allowExistingName, null); }
return getUniqueName("Recipe", recipeNames, originalName,
return recipeNames.getUniqueName("Recipe", originalName,
protected String getUniqueRecipeName(String originalName, boolean allowExistingName) { return getUniqueName("Recipe", recipeNames, originalName, allowExistingName, "isRecipeNameInDatabase"); }
return getUniqueName("Society", societyNames, originalName,
return societyNames.getUniqueName("Society", originalName,
protected String getUniqueSocietyName(String originalName, boolean allowExistingName) { return getUniqueName("Society", societyNames, originalName, allowExistingName, "isSocietyNameInDatabase"); }
metNameClassItems = new Object[RecipeList.getRecipeCount()];
recipeNameClassItems = new Object[RecipeList.getRecipeCount()];
private void initRecipes() { metNameClassItems = new Object[RecipeList.getRecipeCount()]; for(int i=0; i < RecipeList.getRecipeCount(); i++) { metNameClassItems[i] = new NameClassItem(RecipeList.getRecipeName(i), RecipeList.getRecipeClass(i)); } }
metNameClassItems[i] = new NameClassItem(RecipeList.getRecipeName(i),
recipeNameClassItems[i] = new NameClassItem(RecipeList.getRecipeName(i),
private void initRecipes() { metNameClassItems = new Object[RecipeList.getRecipeCount()]; for(int i=0; i < RecipeList.getRecipeCount(); i++) { metNameClassItems[i] = new NameClassItem(RecipeList.getRecipeName(i), RecipeList.getRecipeClass(i)); } }
if (doWorkspace) { component.addPropertiesListener(myPropertiesListener); for (Iterator i = component.getProperties(); i.hasNext(); ) { Property p = (Property) i.next(); PropertyEvent event = new PropertyEvent(p, PropertyEvent.PROPERTY_ADDED); myPropertiesListener.propertyAdded(event); } }
private void installListeners(ModifiableComponent component) { if (doWorkspace) { component.addPropertiesListener(myPropertiesListener); for (Iterator i = component.getProperties(); i.hasNext(); ) { Property p = (Property) i.next(); PropertyEvent event = new PropertyEvent(p, PropertyEvent.PROPERTY_ADDED)...
Object[] values = metNameClassItems;
Object[] values = recipeNameClassItems;
protected void newRecipe() { Object[] values = metNameClassItems; Object answer = JOptionPane.showInputDialog(this, "Select Recipe Type", "Select Recipe", JOptionPane.QUESTION_MESSAGE, null, values, "Empty Recipe"); if (answer instanceof NameClassItem) { NameClassItem item ...
editingNodes.add(node);
protected void removeChildren(Experiment experiment) { DefaultMutableTreeNode expNode = findNode(experiment); int n = expNode.getChildCount(); // display these nodes in gray and don't let them be edited for (int i = 0; i < n; i++) { DefaultMutableTreeNode node = (DefaultMutableTreeNode)expNod...
if (findNode(component) == null) { societyNames.remove(component.getShortName()); removeSocietyFromList((SocietyComponent)component); }
societyNames.remove(component.getShortName());
public void replaceComponent(Experiment experiment, ModifiableComponent component, ModifiableComponent newComponent) { // find experiment node DefaultMutableTreeNode expNode = findNode(experiment); if (expNode == null) { if (log.isErrorEnabled(...
if (findNode(component) == null) { recipeNames.remove(component.getShortName()); removeRecipeFromList((RecipeComponent)component); }
recipeNames.remove(component.getShortName());
public void replaceComponent(Experiment experiment, ModifiableComponent component, ModifiableComponent newComponent) { // find experiment node DefaultMutableTreeNode expNode = findNode(experiment); if (expNode == null) { if (log.isErrorEnabled(...
if (o instanceof SocietyComponent && getSociety(((SocietyComponent)o).getSocietyName()) == null) addSocietyToList((SocietyComponent)o); else if (o instanceof RecipeComponent && getRecipe(((RecipeComponent)o).getRecipeName()) == null) addRecipeToList((RecipeComponent)o);
private void restore(String fileName) { PropertyListener l = null; try { File f = new File(fileName); this.workspaceFileName = f.getPath(); if (doWorkspace && f.canRead()) { if (log.isInfoEnabled()) { log.info("Reading from workspace file " + fileName); } ObjectInputStream ois = new ObjectInput...
societyNames.init(getLeaves(SocietyComponent.class, root), SocietyComponent.class.getMethod("getSocietyName", noTypes)); experimentNames.init(getLeaves(Experiment.class, root), Experiment.class.getMethod("getExperimentName", noTypes)); recipeNames.init(getLeaves(RecipeComponent.class, root), RecipeComponent.class.getMe...
experimentNames.init(root, Experiment.class, "getExperimentName"); societyNames.init(root, SocietyComponent.class, "getSocietyName"); recipeNames.init(root, RecipeComponent.class, "getRecipeName"); folderNames.init(root, String.class, "toString");
private void restore(String fileName) { PropertyListener l = null; try { File f = new File(fileName); this.workspaceFileName = f.getPath(); if (doWorkspace && f.canRead()) { if (log.isInfoEnabled()) { log.info("Reading from workspace file " + fileName); } ObjectInputStream ois = new ObjectInput...
} catch (NoSuchMethodException nsme) { if (log.isErrorEnabled()) { log.error("Organizer error restoring workspace", nsme); }
private void restore(String fileName) { PropertyListener l = null; try { File f = new File(fileName); this.workspaceFileName = f.getPath(); if (doWorkspace && f.canRead()) { if (log.isInfoEnabled()) { log.info("Reading from workspace file " + fileName); } ObjectInputStream ois = new ObjectInput...
Experiment experiment;
Experiment experiment = null;
protected void startConsole() { DefaultMutableTreeNode node = getSelectedNode(); Object o = node.getUserObject(); Experiment experiment; if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComponent) o; // FIXME What is the society is marked as modified? Then I need to save it ...
SocietyComponent sc = (SocietyComponent) o; String name = "Temp Experiment for " + sc.getSocietyName(); name = experimentNames.generateName(name); experiment = new Experiment(name, sc, new RecipeComponent[0]); DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent(); addExperimentToWorkspace(ex...
experiment = createExperiment((SocietyComponent)o); addExperimentToWorkspace(experiment, (DefaultMutableTreeNode) node.getParent());
protected void startConsole() { DefaultMutableTreeNode node = getSelectedNode(); Object o = node.getUserObject(); Experiment experiment; if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComponent) o; // FIXME What is the society is marked as modified? Then I need to save it ...
if (experiment.isModified()) { final Experiment expt = experiment; GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("SaveExperiment") { public void run() { expt.saveToDb(saveToDbConflictHandler); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(); } catch (RuntimeException re) { if(log.isErrorEnabled())...
experiment.saveToDb(saveToDbConflictHandler);
protected void startConsole() { DefaultMutableTreeNode node = getSelectedNode(); Object o = node.getUserObject(); Experiment experiment; if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComponent) o; // FIXME What is the society is marked as modified? Then I need to save it ...
experiment = (Experiment) o; } else { return;
experiment = (Experiment)o;
protected void startConsole() { DefaultMutableTreeNode node = getSelectedNode(); Object o = node.getUserObject(); Experiment experiment; if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComponent) o; // FIXME What is the society is marked as modified? Then I need to save it ...
csmart.runConsole(experiment);
if (experiment != null) csmart.runConsole(experiment);
protected void startConsole() { DefaultMutableTreeNode node = getSelectedNode(); Object o = node.getUserObject(); Experiment experiment; if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComponent) o; // FIXME What is the society is marked as modified? Then I need to save it ...
if (o instanceof RecipeComponent || o instanceof SocietyComponent) { if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComponent) o; String name = "Experiment for " + sc.getSocietyName(); experiment = new Experiment(experimentNames.generateName(name), sc, new RecipeComponent[0]); } else if (o instanceo...
if (o instanceof SocietyComponent) { experiment = createExperiment((SocietyComponent)o); addExperimentAndComponentsToWorkspace(experiment, (DefaultMutableTreeNode) node.getParent()); } else if (o instanceof RecipeComponent) { experiment = createExperiment((RecipeComponent)o); addExperimentAndComponentsToWorkspace(exper...
protected void startExperimentBuilder() { Experiment experiment = null; DefaultMutableTreeNode node = getSelectedNode(); Object o = node.getUserObject(); if (o instanceof RecipeComponent || o instanceof SocietyComponent) { if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComp...
languageString = languageString.trim();
private static float q(String languageString) { float result=0f; if (languageString!=null) { int semicolumn=languageString.indexOf(';'); if (semicolumn!=-1 && languageString.length()>semicolumn+2) { result=Float.parseFloat...
if(log.isDebugEnabled()) {
if(log.isErrorEnabled()) {
private void populateAgent(ComponentData data, boolean isAdded) throws SQLException { AgentAssetData assetData = data.getAgentAssetData(); if (assetData == null) return; substitutions.put(":agent_org_class:", sqlQuote(assetData.getAssetClass())); substitutions.put(":agent_lib_name:...
gl.glBindTexture(GL.GL_TEXTURE_2D, dynamicTextureIDs[CA_TEXTURE_NORMAL_MAP]);
dynamicTextures[CA_TEXTURE_NORMAL_MAP].bind();
private void createNormalMap(GL gl) { // use the height output on all four texture stages for (int i = 0; i < 4; i++) { gl.glActiveTexture(GL.GL_TEXTURE0 + i); gl.glBindTexture(GL.GL_TEXTURE_2D, texHeightOutput); gl.glEnable(GL.GL_TEXTURE_2D); } // Set constants for red & green scale factor...
texHeightInput = dynamicTextureIDs[CA_TEXTURE_HEIGHT_SOURCE]; texHeightOutput = dynamicTextureIDs[CA_TEXTURE_HEIGHT_TARGET]; texVelocityInput = dynamicTextureIDs[CA_TEXTURE_VELOCITY_SOURCE]; texVelocityOutput = dynamicTextureIDs[CA_TEXTURE_VELOCITY_TARGET];
texHeightInput = dynamicTextures[CA_TEXTURE_HEIGHT_SOURCE].getTextureObject(); texHeightOutput = dynamicTextures[CA_TEXTURE_HEIGHT_TARGET].getTextureObject(); texVelocityInput = dynamicTextures[CA_TEXTURE_VELOCITY_SOURCE].getTextureObject(); texVelocityOutput = dynamicTextures[CA_TEXTURE_VELOCITY_TARGET].getText...
private void doSingleTimeStep(GL gl) { int temp; // Swap texture source & target indices & pointers // 0 = start from initial loaded texture // 1/2 = flip flop back and forth between targets & sources switch (flipState) { case 0: texHeightInput = dynamicTextureIDs[CA_TEXTURE_HEIGHT_SOURCE]...
gl.glBindTexture(GL.GL_TEXTURE_2D, dynamicTextureIDs[CA_TEXTURE_FORCE_INTERMEDIATE]);
dynamicTextures[CA_TEXTURE_FORCE_INTERMEDIATE].bind();
private void doSingleTimeStep(GL gl) { int temp; // Swap texture source & target indices & pointers // 0 = start from initial loaded texture // 1/2 = flip flop back and forth between targets & sources switch (flipState) { case 0: texHeightInput = dynamicTextureIDs[CA_TEXTURE_HEIGHT_SOURCE]...
gl.glBindTexture(GL.GL_TEXTURE_2D, dynamicTextureIDs[CA_TEXTURE_FORCE_TARGET]);
dynamicTextures[CA_TEXTURE_FORCE_TARGET].bind();
private void doSingleTimeStep(GL gl) { int temp; // Swap texture source & target indices & pointers // 0 = start from initial loaded texture // 1/2 = flip flop back and forth between targets & sources switch (flipState) { case 0: texHeightInput = dynamicTextureIDs[CA_TEXTURE_HEIGHT_SOURCE]...
gl.glBindTexture(GL.GL_TEXTURE_2D, dynamicTextureIDs[CA_TEXTURE_NORMAL_MAP]); gl.glDisable(GL.GL_TEXTURE_2D);
dynamicTextures[CA_TEXTURE_NORMAL_MAP].bind(); dynamicTextures[CA_TEXTURE_NORMAL_MAP].disable();
public void draw(GL gl, Rotf cameraOrientation) { this.cameraOrientation.set(cameraOrientation); if (skipCount >= skipInterval && renderMode != CA_DO_NOT_RENDER) { skipCount = 0; // Display the results of the rendering to texture if (wireframe) { gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.G...
gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP, staticTextureIDs[CA_TEXTURE_CUBEMAP]); gl.glEnable(GL.GL_TEXTURE_2D);
cubemap.bind(); cubemap.enable();
public void draw(GL gl, Rotf cameraOrientation) { this.cameraOrientation.set(cameraOrientation); if (skipCount >= skipInterval && renderMode != CA_DO_NOT_RENDER) { skipCount = 0; // Display the results of the rendering to texture if (wireframe) { gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.G...
gl.glBindTexture(GL.GL_TEXTURE_2D, dynamicTextureIDs[CA_TEXTURE_NORMAL_MAP]);
dynamicTextures[CA_TEXTURE_NORMAL_MAP].bind();
public void draw(GL gl, Rotf cameraOrientation) { this.cameraOrientation.set(cameraOrientation); if (skipCount >= skipInterval && renderMode != CA_DO_NOT_RENDER) { skipCount = 0; // Display the results of the rendering to texture if (wireframe) { gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.G...
gl.glBindTexture(GL.GL_TEXTURE_2D, dynamicTextureIDs[CA_TEXTURE_FORCE_TARGET]);
dynamicTextures[CA_TEXTURE_FORCE_TARGET].bind();
public void draw(GL gl, Rotf cameraOrientation) { this.cameraOrientation.set(cameraOrientation); if (skipCount >= skipInterval && renderMode != CA_DO_NOT_RENDER) { skipCount = 0; // Display the results of the rendering to texture if (wireframe) { gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.G...
gl.glBindTexture(GL.GL_TEXTURE_2D, staticTextureIDs[CA_TEXTURE_DROPLET]); gl.glEnable(GL.GL_TEXTURE_2D);
dropletTex.bind(); dropletTex.enable();
private synchronized void drawDroplets(GL gl) { gl.glDisable(GL.GL_FRAGMENT_PROGRAM_ARB); gl.glDisable(GL.GL_VERTEX_PROGRAM_ARB); gl.glActiveTexture(GL.GL_TEXTURE0); gl.glBindTexture(GL.GL_TEXTURE_2D, staticTextureIDs[CA_TEXTURE_DROPLET]); gl.glEnable(GL.GL_TEXTURE_2D); gl.glActiveTexture(GL.GL_TEXT...
gl.glBindTexture(GL.GL_TEXTURE_2D, staticTextureIDs[CA_TEXTURE_INITIAL_MAP]); gl.glEnable(GL.GL_TEXTURE_2D);
initialMapTex.bind(); initialMapTex.enable();
private void drawInteriorBoundaryObjects(GL gl) { gl.glDisable(GL.GL_REGISTER_COMBINERS_NV); gl.glActiveTexture(GL.GL_TEXTURE0); gl.glBindTexture(GL.GL_TEXTURE_2D, staticTextureIDs[CA_TEXTURE_INITIAL_MAP]); gl.glEnable(GL.GL_TEXTURE_2D); gl.glEnable(GL.GL_ALPHA_TEST); // disable other texture un...
gl.glBindTexture(GL.GL_TEXTURE_2D, staticTextureIDs[CA_TEXTURE_SPIN]);
spinTex.bind();
private void drawInteriorBoundaryObjects(GL gl) { gl.glDisable(GL.GL_REGISTER_COMBINERS_NV); gl.glActiveTexture(GL.GL_TEXTURE0); gl.glBindTexture(GL.GL_TEXTURE_2D, staticTextureIDs[CA_TEXTURE_INITIAL_MAP]); gl.glEnable(GL.GL_TEXTURE_2D); gl.glEnable(GL.GL_ALPHA_TEST); // disable other texture un...
loadTextures(gl, tmpSpinFilename, tmpDropletFilename, tmpCubeMapFilenamePattern);
try { loadTextures(gl, tmpSpinFilename, tmpDropletFilename, tmpCubeMapFilenamePrefix, tmpCubeMapFilenameSuffix); } catch (IOException e) { throw new GLException(e); }
private void initOpenGL(GL gl) { loadTextures(gl, tmpSpinFilename, tmpDropletFilename, tmpCubeMapFilenamePattern); tmpSpinFilename = null; tmpDropletFilename = null; tmpCubeMapFilenamePattern = null; gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); gl.glMatrixMode(GL.GL_PRO...
tmpCubeMapFilenamePattern = null;
tmpCubeMapFilenamePrefix = null; tmpCubeMapFilenameSuffix = null;
private void initOpenGL(GL gl) { loadTextures(gl, tmpSpinFilename, tmpDropletFilename, tmpCubeMapFilenamePattern); tmpSpinFilename = null; tmpDropletFilename = null; tmpCubeMapFilenamePattern = null; gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); gl.glMatrixMode(GL.GL_PRO...
String cubeMapFilenamePattern,
String cubeMapFilenamePrefix, String cubeMapFilenameSuffix,
public void initialize(String initialMapFilename, String spinFilename, String dropletFilename, String cubeMapFilenamePattern, GLAutoDrawable parentWindow) { loadInitialTexture(initialMapFilename); tmpSpinFilename ...
tmpCubeMapFilenamePattern = cubeMapFilenamePattern;
tmpCubeMapFilenamePrefix = cubeMapFilenamePrefix; tmpCubeMapFilenameSuffix = cubeMapFilenameSuffix;
public void initialize(String initialMapFilename, String spinFilename, String dropletFilename, String cubeMapFilenamePattern, GLAutoDrawable parentWindow) { loadInitialTexture(initialMapFilename); tmpSpinFilename ...
initialMap = TGAImage.read(getClass().getClassLoader().getResourceAsStream(initialMapFilename));
initialMapData = TextureIO.newTextureData(getClass().getClassLoader().getResourceAsStream(initialMapFilename), false, TextureIO.getFileSuffix(initialMapFilename));
private void loadInitialTexture(String initialMapFilename) { try { initialMap = TGAImage.read(getClass().getClassLoader().getResourceAsStream(initialMapFilename)); } catch (IOException e) { throw new GLException(e); } initialMapDimensions[0] = initialMap.getWidth(); initialMapDimensions[1] = ...
initialMapDimensions[0] = initialMap.getWidth(); initialMapDimensions[1] = initialMap.getHeight();
initialMapDimensions[0] = initialMapData.getWidth(); initialMapDimensions[1] = initialMapData.getHeight();
private void loadInitialTexture(String initialMapFilename) { try { initialMap = TGAImage.read(getClass().getClassLoader().getResourceAsStream(initialMapFilename)); } catch (IOException e) { throw new GLException(e); } initialMapDimensions[0] = initialMap.getWidth(); initialMapDimensions[1] = ...
String cubeMapFilenamePattern) { if (initialMap == null) {
String cubeMapFilenamePrefix, String cubeMapFilenameSuffix) throws IOException { if (initialMapData == null) {
private void loadTextures(GL gl, String spinFilename, String dropletFilename, String cubeMapFilenamePattern) { if (initialMap == null) { throw new GLException("Must call loadInitialTexture ahead of time"); } TGAImage spin ...
TGAImage spin = loadImage(spinFilename); TGAImage droplet = loadImage(dropletFilename); gl.glGenTextures(CA_NUM_STATIC_TEXTURES, staticTextureIDs, 0); gl.glGenTextures(CA_NUM_DYNAMIC_TEXTURES, dynamicTextureIDs, 0); createTextureObject(gl, staticTextureIDs[CA_TEXTURE_INITIAL_MAP], initialMap, true); createTextur...
initialMapTex = TextureIO.newTexture(initialMapData); spinTex = TextureIO.newTexture(getClass().getClassLoader().getResourceAsStream(spinFilename), false, TextureIO.getFileSuffix(spinFilename)); dropletTex = TextureIO.newTexture(getClass().getClassLoader().getResourceAsStream(dropletFilename), false, TextureIO...
private void loadTextures(GL gl, String spinFilename, String dropletFilename, String cubeMapFilenamePattern) { if (initialMap == null) { throw new GLException("Must call loadInitialTexture ahead of time"); } TGAImage spin ...
loadCubeMap(gl, staticTextureIDs[CA_TEXTURE_CUBEMAP], cubeMapFilenamePattern, true);
cubemap = Cubemap.loadFromStreams(getClass().getClassLoader(), cubeMapFilenamePrefix, cubeMapFilenameSuffix, true);
private void loadTextures(GL gl, String spinFilename, String dropletFilename, String cubeMapFilenamePattern) { if (initialMap == null) { throw new GLException("Must call loadInitialTexture ahead of time"); } TGAImage spin ...
createTextureObject(gl, dynamicTextureIDs[i], initialMap, false);
dynamicTextures[i] = TextureIO.newTexture(initialMapData);
private void loadTextures(GL gl, String spinFilename, String dropletFilename, String cubeMapFilenamePattern) { if (initialMap == null) { throw new GLException("Must call loadInitialTexture ahead of time"); } TGAImage spin ...
initialMap = null;
initialMapData = null;
private void loadTextures(GL gl, String spinFilename, String dropletFilename, String cubeMapFilenamePattern) { if (initialMap == null) { throw new GLException("Must call loadInitialTexture ahead of time"); } TGAImage spin ...
texHeightInput = staticTextureIDs [CA_TEXTURE_INITIAL_MAP]; texHeightOutput = dynamicTextureIDs[CA_TEXTURE_HEIGHT_TARGET];
texHeightInput = initialMapTex.getTextureObject(); texHeightOutput = dynamicTextures[CA_TEXTURE_HEIGHT_TARGET].getTextureObject();
private void loadTextures(GL gl, String spinFilename, String dropletFilename, String cubeMapFilenamePattern) { if (initialMap == null) { throw new GLException("Must call loadInitialTexture ahead of time"); } TGAImage spin ...
texVelocityInput = dynamicTextureIDs[CA_TEXTURE_VELOCITY_SOURCE]; texVelocityOutput = dynamicTextureIDs[CA_TEXTURE_VELOCITY_TARGET];
texVelocityInput = dynamicTextures[CA_TEXTURE_VELOCITY_SOURCE].getTextureObject(); texVelocityOutput = dynamicTextures[CA_TEXTURE_VELOCITY_TARGET].getTextureObject();
private void loadTextures(GL gl, String spinFilename, String dropletFilename, String cubeMapFilenamePattern) { if (initialMap == null) { throw new GLException("Must call loadInitialTexture ahead of time"); } TGAImage spin ...
for (int i = 0; i < m_courses.length; i++)
StringBuffer tab = new StringBuffer(); String[] fields; fields = courseId.split(","); if (fields.length == 6)
public String getCourseName(String courseId) { for (int i = 0; i < m_courses.length; i++) { if (m_courses[i].getId().equals(courseId)) { return m_courses[i].getTitle(); } } return null; }
if (m_courses[i].getId().equals(courseId)) { return m_courses[i].getTitle(); }
tab.append(fields[3]); tab.append(" "); tab.append(fields[4]); tab.append(" "); tab.append(fields[5]);
public String getCourseName(String courseId) { for (int i = 0; i < m_courses.length; i++) { if (m_courses[i].getId().equals(courseId)) { return m_courses[i].getTitle(); } } return null; }
return null;
return tab.toString();
public String getCourseName(String courseId) { for (int i = 0; i < m_courses.length; i++) { if (m_courses[i].getId().equals(courseId)) { return m_courses[i].getTitle(); } } return null; }