rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
legend.setVisible(true); }
deleteAppServers(); }
public void actionPerformed(ActionEvent e) { legend.setVisible(true); }
attachButton_actionPerformed(); }
refreshAppServers(); }
public void actionPerformed(ActionEvent e) { attachButton_actionPerformed(); }
trialTimeLabel.setText(getElapsedTimeLabel("Trial: ", startTrialTime)); }
attachButton_actionPerformed(); }
public void actionPerformed(ActionEvent e) { trialTimeLabel.setText(getElapsedTimeLabel("Trial: ", startTrialTime)); }
experimentTimeLabel.setText(getElapsedTimeLabel("Experiment: ", startExperimentTime)); }
runButton_actionPerformed(); }
public void actionPerformed(ActionEvent e) { experimentTimeLabel.setText(getElapsedTimeLabel("Experiment: ", startExperimentTime)); }
displayAboutNode();
stopButton_actionPerformed(e);
public void actionPerformed(ActionEvent e) { displayAboutNode(); }
resetNodeStatus();
abortButton_actionPerformed();
public void actionPerformed(ActionEvent e) { resetNodeStatus(); }
legend.setVisible(true); }
trialTimeLabel.setText(getElapsedTimeLabel("Trial: ", startTrialTime)); }
public void actionPerformed(ActionEvent e) { legend.setVisible(true); }
me.printStackTrace();
if(log.isErrorEnabled()) { log.error("Exception", me); }
public void actionPerformed(ActionEvent ae) { String command = ae.getActionCommand(); String oplanId = null; if (command.equals(PUBLISH_COMMAND) || command.equals(RESCIND_COMMAND)) oplanId = ((OplanInfo)oplanCombo.getSelectedItem()).getOplanId(); String urlString = getURLString(GLS_INIT_S...
ioe.printStackTrace();
if(log.isErrorEnabled()) { log.error("Exception", ioe); }
public void actionPerformed(ActionEvent ae) { String command = ae.getActionCommand(); String oplanId = null; if (command.equals(PUBLISH_COMMAND) || command.equals(RESCIND_COMMAND)) oplanId = ((OplanInfo)oplanCombo.getSelectedItem()).getOplanId(); String urlString = getURLString(GLS_INIT_S...
me.printStackTrace();
if(log.isErrorEnabled()) { log.error("Exception", me); }
public void actionPerformed(ActionEvent ae) { String urlString = getURLString(GLS_REPLY_SERVLET, CONNECT_COMMAND, null); URLConnection urlConnection = null; try { URL url = new URL(urlString); urlConnection = url.openConnection(); } catch (java.net.Ma...
ioe.printStackTrace();
if(log.isErrorEnabled()) { log.error("Exception", ioe); }
public void actionPerformed(ActionEvent ae) { String urlString = getURLString(GLS_REPLY_SERVLET, CONNECT_COMMAND, null); URLConnection urlConnection = null; try { URL url = new URL(urlString); urlConnection = url.openConnection(); } catch (java.net.Ma...
e.printStackTrace();
if(log.isErrorEnabled()) { log.error("Exception", e); }
public Object construct() { connectButton.setEnabled(false); oplanButton.setEnabled(true); getRootPane().setDefaultButton(oplanButton); try { BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); String inputLine; while ((inputLine = in.r...
if (getProperty(PROP_TYPE) == null && log.isErrorEnabled()) { log.error("Please report bug 1304: Using CSMART " + CSMART.writeDebug() + " just finished setting Type and getProperty(type) returns null. Initializing from RelationshipData: " + relationship, new Throwable()); }
public void initProperties() { if (relationship == null) { if (log.isErrorEnabled()) { log.error("Report under bug 1304: " + this + " using CSMART " + CSMART.writeDebug() + " got null relationship to create from", new Throwable()); } } else if (relationship.getType() == null) { if (log.isErrorEn...
if (c != null && c instanceof JMenuItem) { Action action = ((JMenuItem)c).getAction(); if (action != null) ActionUtil.setActionAllowed(action, organizer);
if (c != null) { if (c instanceof JMenu) enableActions((JMenu)c); else if (c instanceof JMenuItem) { Action action = ((JMenuItem)c).getAction(); if (action != null) ActionUtil.setActionAllowed(action, organizer); }
private void configureMenu(JPopupMenu menu) { int n = menu.getComponentCount(); for (int i = 0; i < n; i++) { Component c = menu.getComponent(i); if (c != null && c instanceof JMenuItem) { Action action = ((JMenuItem)c).getAction(); // skip submenus which have null actions if (act...
m_baseLocation = VariableResolverFactory.getResolver(base, new WrapperComponentManager(super.m_manager));
m_baseLocation = VariableResolverFactory.getResolver(base, super.m_manager);
public void build(final Configuration configuration) throws ConfigurationException { super.build(configuration); // get the base attribute String base = configuration.getAttribute("base", null); if (base != null) { try { m_baseLocation = VariableResolverFactor...
hostConfigurationBuilder = this;
public HostConfigurationBuilder(Experiment experiment, ExperimentBuilder experimentBuilder) { this.experiment = experiment; this.experimentBuilder = experimentBuilder; isEditable = experiment.isEditable(); isRunnable = experiment.isRunnable(); initDisplay(); }
if (((DefaultMutableTreeNode)o).isRoot())
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)o; if (treeNode.isRoot() || ((ConsoleTreeObject)treeNode.getUserObject()).isAgent())
private void initDisplay() { // host split pane contains host tree and // the bottom split pane which contains the node and agent trees JSplitPane hostPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); // tree of hosts and assigned nodes and agents DefaultMutableTreeNode root = new DefaultMutable...
((ConsoleTreeObject)treeNode.getUserObject()).isNode())
((ConsoleTreeObject)treeNode.getUserObject()).isAgent())
private void initDisplay() { // host split pane contains host tree and // the bottom split pane which contains the node and agent trees JSplitPane hostPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); // tree of hosts and assigned nodes and agents DefaultMutableTreeNode root = new DefaultMutable...
} public boolean stopCellEditing() { if (isNodeNameUnique((String)getCellEditorValue())) return super.stopCellEditing(); int ok = JOptionPane.showConfirmDialog(hostConfigurationBuilder, "Use an unique name", "Node Name Not Unique", JOptionPane.OK_CANCEL_OPTION, JOptionPane.ERROR_MESSAGE); if (ok != JOptionPane.OK_OP...
private void initDisplay() { // host split pane contains host tree and // the bottom split pane which contains the node and agent trees JSplitPane hostPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); // tree of hosts and assigned nodes and agents DefaultMutableTreeNode root = new DefaultMutable...
if (((DefaultMutableTreeNode)o).isRoot())
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)o; if (treeNode.isRoot() || ((ConsoleTreeObject)treeNode.getUserObject()).isAgent())
public boolean isCellEditable(EventObject e) { if (super.isCellEditable(e) && e instanceof MouseEvent) { TreePath path = hostTree.getPathForLocation(((MouseEvent)e).getX(), ((MouseEvent)e).getY()); if (path == null) return false; Object o = path.getLastPathComponent(); if (((DefaultMutableT...
((ConsoleTreeObject)treeNode.getUserObject()).isNode())
((ConsoleTreeObject)treeNode.getUserObject()).isAgent())
public boolean isCellEditable(EventObject e) { if (super.isCellEditable(e) && e instanceof MouseEvent) { TreePath path = hostTree.getPathForLocation(((MouseEvent)e).getX(), ((MouseEvent)e).getY()); if (path == null) return false; Object o = path.getLastPathComponent(); DefaultMutableTreeNod...
String nodeName = JOptionPane.showInputDialog("New node name: "); if (nodeName == null || nodeName.length() == 0) return;
String nodeName = null; while (true) { nodeName = JOptionPane.showInputDialog("New node name: "); if (nodeName == null || nodeName.length() == 0) return; if (isNodeNameUnique(nodeName)) break; int ok = JOptionPane.showConfirmDialog(this, "Use an unique name", "Node Name Not Unique", JOptionPane.OK_CANCEL_OPTION, JOpti...
private void newNodeInTree(JTree tree) { TreePath path = tree.getSelectionPath(); if (path == null) { System.out.println("HostConfigurationBuilder newNodeInTree called with null path; ignoring"); return; } DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)path.getLastPathCompon...
return Collections.unmodifiableMap(new HashMap(this)).entrySet();
HashMap copy = new HashMap(); for (Iterator it = keySet().iterator(); it.hasNext();) { Object key = it.next(); copy.put(key, get(key)); } return Collections.unmodifiableMap(copy).entrySet();
public Set entrySet() { return Collections.unmodifiableMap(new HashMap(this)).entrySet(); }
return modified || societyModified;
return modified;
public boolean isModified() { return modified || societyModified; }
if (!hasConfiguration() || hasUnboundProperties() || modified || societyModified)
if (!hasConfiguration() || hasUnboundProperties() || modified)
public boolean isRunnable() { if (!hasConfiguration() || hasUnboundProperties() || modified || societyModified) return false; return !runInProgress; // allow user to run experiment they're editing }
if (e.getWhatChanged() == EXPERIMENT_SAVED)
if (e.getWhatChanged() == EXPERIMENT_SAVED) {
private void notifyExperimentListeners(ModificationEvent e) { if (e.getWhatChanged() == EXPERIMENT_SAVED) super.fireModification(); else if (e.getSource().equals(societyComponent)) { boolean wasModified = isModified(); if (e.getWhatChanged() == SocietyBase.SOCIETY_SAVED) { societyModified ...
else if (e.getSource().equals(societyComponent)) { boolean wasModified = isModified(); if (e.getWhatChanged() == SocietyBase.SOCIETY_SAVED) { societyModified = false; } else { societyModified = true; } if (isModified() != wasModified) super.fireModification(); } else fireModification();
return; } if (e.getWhatChanged() == SocietyBase.SOCIETY_SAVED || e.getWhatChanged() == RecipeBase.RECIPE_SAVED) return; fireModification();
private void notifyExperimentListeners(ModificationEvent e) { if (e.getWhatChanged() == EXPERIMENT_SAVED) super.fireModification(); else if (e.getSource().equals(societyComponent)) { boolean wasModified = isModified(); if (e.getWhatChanged() == SocietyBase.SOCIETY_SAVED) { societyModified ...
societyModified = society.isModified();
private void setSocietyComponent(SocietyComponent society) { if (this.societyComponent != null) removeSocietyComponent(); this.societyComponent = society; societyModified = society.isModified(); installListeners((ModifiableConfigurableComponent)society); fireModification(); }
mutableUserInfo = new NSMutableDictionary();
if(request().userInfo() == null) mutableUserInfo = new NSMutableDictionary(); else mutableUserInfo = request().userInfo().mutableClone();
public NSMutableDictionary mutableUserInfo() { if(mutableUserInfo == null) { mutableUserInfo = new NSMutableDictionary(); } return mutableUserInfo; }
public HostConfigurationBuilder(Experiment experiment) {
public HostConfigurationBuilder(Experiment experiment, CSMART csmart) {
public HostConfigurationBuilder(Experiment experiment) { this.experiment = experiment; isEditable = experiment.isEditable(); isRunnable = experiment.isRunnable(); initDisplay(); }
this.csmart = csmart;
public HostConfigurationBuilder(Experiment experiment) { this.experiment = experiment; isEditable = experiment.isEditable(); isRunnable = experiment.isRunnable(); initDisplay(); }
String name = ""; while (true) { name = (String) JOptionPane.showInputDialog(this, "Enter Experiment Name", "Experiment Name", JOptionPane.QUESTION_MESSAGE, null, null, name); if (name == null) return; if (!ExperimentDB.isExperimentNameInDatabase(name)) { experiment.setName(name); break; } int answer = JOptionPane.show...
String name = csmart.getUniqueExperimentName(experiment.getShortName()); if (name == null) return; experiment.setName(name);
public void save() { if (false && !modified) { JOptionPane.showMessageDialog(this, "No modifications were made."); return; } modified = false; if (experiment.isCloned()) { experiment.saveToDb(); return; } // if experiment name is already unique, then don't ask user for new one ...
abstract protected int addElement(Transferable o,
protected abstract int addElement(Transferable o,
abstract protected int addElement(Transferable o, DefaultMutableTreeNode target, DefaultMutableTreeNode after);
abstract public boolean isDraggable(Object selected);
public abstract boolean isDraggable(Object selected);
abstract public boolean isDraggable(Object selected);
abstract protected int isDroppable(DataFlavor[] o, DefaultMutableTreeNode target);
protected abstract int isDroppable(DataFlavor[] o, DefaultMutableTreeNode target);
abstract protected int isDroppable(DataFlavor[] o, DefaultMutableTreeNode target);
abstract public Transferable makeDraggableObject(Object selected);
public abstract Transferable makeDraggableObject(Object selected);
abstract public Transferable makeDraggableObject(Object selected);
String name, String type) {
String name, String type, String communityName) {
protected DefaultMutableTreeNode addNode(DefaultMutableTreeNode node, String name, String type) { DefaultTreeModel model = (DefaultTreeModel)getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode)model.getRoot(); if (node == null) { root.removeAllChil...
new DefaultMutableTreeNode(new CommunityTreeObject(name, type),
new DefaultMutableTreeNode(new CommunityTreeObject(name, type, communityName),
protected DefaultMutableTreeNode addNode(DefaultMutableTreeNode node, String name, String type) { DefaultTreeModel model = (DefaultTreeModel)getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode)model.getRoot(); if (node == null) { root.removeAllChil...
new DefaultMutableTreeNode(cto, cto.allowsChildren());
new DefaultMutableTreeNode(newCTO, newCTO.allowsChildren());
private void copyChildren(DefaultMutableTreeNode oldNode, DefaultMutableTreeNode newNode) { DefaultTreeModel model = (DefaultTreeModel)getModel(); int nChildren = oldNode.getChildCount(); for (int i=0; i < nChildren; i++) { DefaultMutableTreeNode oldChildNode = (Defaul...
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.experiment");
createLogger();
public NodeArgumentDialog(String title, Properties props, boolean isLocal) { super((Frame)null, title, true); // display modal dialog log = CSMART.createLogger("org.cougaar.tools.csmart.ui.experiment"); Box nodeArgPanel = Box.createVerticalBox(); JPanel argumentPanel = new JPanel(); // ok and cancel bu...
} else if (key.startsWith(PropertyNames.ORGANIZATION_LOCATION_ELEMENT)) { names.addElement(key); values.addElement(node.getLocalAttribute(key).getValue());
public ULSocietyTableModel(Node node) { this.node = node; names = new Vector(); values = new Vector(); addAttribute(PropertyNames.UID_ATTR); addAttribute(PropertyNames.ORGANIZATION_NAME); // TODO: for debugging, probably don't really want to show this addAttribute(PropertyNames.ORGANIZATION_KEY_N...
System.out.println("ULSocietyTableModel: attribute not found: " + name);
private void addAttribute(String name) { Attribute a = node.getLocalAttribute(name); if (a == null) { System.out.println("ULSocietyTableModel: attribute not found: " + name); return; } names.addElement(name); values.addElement(a.getValue()); }
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); organizer = new Organizer(this); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); ...
this.observer = observer;
image.setObserver (observer);
public boolean prepareImage (Image image, int width, int height, ImageObserver observer) { GtkImage i = (GtkImage) image; if (i.isLoaded ()) return true; class PrepareImage extends Thread { GtkImage image; ImageObserver observer; PrepareImage (GtkImage image, ImageObserver observ...
image.source.startProduction (null);
image.source.startProduction (image);
public boolean prepareImage (Image image, int width, int height, ImageObserver observer) { GtkImage i = (GtkImage) image; if (i.isLoaded ()) return true; class PrepareImage extends Thread { GtkImage image; ImageObserver observer; PrepareImage (GtkImage image, ImageObserver observ...
this.observer = observer;
image.setObserver (observer);
PrepareImage (GtkImage image, ImageObserver observer) { this.image = image; this.observer = observer; }
image.source.startProduction (null);
image.source.startProduction (image);
public void run () { // XXX: need to return data to image observer image.source.startProduction (null); }
log = CSMART.createLogger("org.cougaar.tools.csmart.experiment");
createLogger();
public ExperimentINIWriter(ComponentData theSoc) { this.theSoc = theSoc; log = CSMART.createLogger("org.cougaar.tools.csmart.experiment"); }
impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
impl.setOption (SocketOptions.SO_REUSEADDR, Boolean.valueOf(on));
public void setReuseAddress (boolean on) throws SocketException { if (isClosed()) throw new SocketException("ServerSocket is closed"); impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); }
this.put(new Location(element));
Location loc = new Location(element); this.put(loc); log.debug("Adding " + loc.toString());
public LocationMap(final String locationmapPath) throws URISyntaxException, SAXException, IOException { final File file = new File(locationmapPath); final URL lmURL = file.toURL(); final DOMParser parser = new DOMParser(); parser.parse(lmURL.toString()); final Document doc = parser.getDocument(); final Node ro...
if (this.isMatch(pattern, requestURI)) results.add(this.locations.get(pattern));
if (this.isMatch(pattern, requestURI)) { List<Location> locs = this.locations.get(pattern); results.add(locs); log.info(locs.size() + " potenatial location from pattern " + pattern); }
public List<List<Location>> get(final URI requestURI) throws MalformedURLException, LocationmapException { final List<List<Location>> results = new ArrayList<List<Location>>(); final Set<String> locPatterns = this.locations.keySet(); for (final String pattern : locPatterns) { try { if (this.isMatch(pattern, ...
ReflectUtils.filter(constructors, new VisibilityPredicate(type, true));
CollectionUtils.filter(constructors, new VisibilityPredicate(type, true));
protected void generate() throws Exception { Class type = getSuperclass(); List constructors = new ArrayList(Arrays.asList(type.getDeclaredConstructors())); ReflectUtils.filter(constructors, new VisibilityPredicate(type, true)); if (constructors.size() == 0) { throw new Illega...
addDeclaredMethods(methods, getSuperclass());
ReflectUtils.addAllMethods(getSuperclass(), methods);
protected void generate() throws Exception { Class type = getSuperclass(); List constructors = new ArrayList(Arrays.asList(type.getDeclaredConstructors())); ReflectUtils.filter(constructors, new VisibilityPredicate(type, true)); if (constructors.size() == 0) { throw new Illega...
addDeclaredMethods(interfaceMethods, interfaces[i]);
ReflectUtils.addAllMethods(interfaces[i], interfaceMethods);
protected void generate() throws Exception { Class type = getSuperclass(); List constructors = new ArrayList(Arrays.asList(type.getDeclaredConstructors())); ReflectUtils.filter(constructors, new VisibilityPredicate(type, true)); if (constructors.size() == 0) { throw new Illega...
ReflectUtils.filter(methods, new VisibilityPredicate(getSuperclass(), true)); removeDuplicates(methods);
CollectionUtils.filter(methods, new VisibilityPredicate(getSuperclass(), true)); CollectionUtils.filter(methods, new DuplicatesPredicate());
protected void generate() throws Exception { Class type = getSuperclass(); List constructors = new ArrayList(Arrays.asList(type.getDeclaredConstructors())); ReflectUtils.filter(constructors, new VisibilityPredicate(type, true)); if (constructors.size() == 0) { throw new Illega...
return unique.add(MethodWrapper.create((Method)arg));
return !Modifier.isFinal(((Method)arg).getModifiers());
public boolean evaluate(Object arg) { return unique.add(MethodWrapper.create((Method)arg)); }
ReflectUtils.filter(list, new Predicate() {
CollectionUtils.filter(list, new Predicate() {
private static void removeFinal(List list) { ReflectUtils.filter(list, new Predicate() { public boolean evaluate(Object arg) { return !Modifier.isFinal(((Method)arg).getModifiers()); } }); }
soc.resetModified();
public Experiment createExperiment(String originalExperimentName, String experimentName, String experimentId, String trialId) { createLogger(); // get assembly ids for trial ArrayList assemblyIds = get...
return _evicted.keySet().containsAll(_rootModuleConfs.keySet());
if (getRoot() == this) { return false; } for (Iterator iter = _rootModuleConfs.keySet().iterator(); iter.hasNext();) { String conf = (String) iter.next(); if (!isEvicted(conf)) { return false; } } return true;
public boolean isCompletelyEvicted() { cleanEvicted(); return _evicted.keySet().containsAll(_rootModuleConfs.keySet()); }
return _evicted.containsKey(rootModuleConf);
return getRoot() != this && !getRoot().getResolvedRevisions(getId().getModuleId(), rootModuleConf).contains(getResolvedId());
public boolean isEvicted(String rootModuleConf) { cleanEvicted(); return _evicted.containsKey(rootModuleConf); }
resolved.markSelected(_rootModuleConf);
public boolean loadData(String conf, boolean shouldBePublic) { boolean loaded = false; if (!isEvicted(_rootModuleConf) && (hasConfigurationsToLoad() || !isRootModuleConfLoaded()) && !hasProblem()) { markRootModuleConfLoaded(); if (_md == null) { DependencyResolver ...
} else if(obj instanceof NSTimestamp && isTimestampAttribute(eoattribute)) {
} else if((obj instanceof NSTimestamp) && isTimestampAttribute(eoattribute)) {
public String formatValueForAttribute(Object obj, EOAttribute eoattribute) { String value; if(obj instanceof NSData) { value = sqlStringForData((NSData)obj); } else if(obj instanceof NSTimestamp && isTimestampAttribute(eoattribute)) { value = "'" + _TIMESTAMP_FORMATTER.for...
destinationEntity = relationship != null ? relationship.entity() : null;
destinationEntity = relationship != null ? relationship.destinationEntity() : null;
public String destinationEntityName() { if(_destinationEntityName == null) { _destinationEntityName = (String)valueForBinding("destinationEntityName"); if(_destinationEntityName == null) { Object _source = sourceObject(); EOEditingContext ec = editingContex...
usingAddr2name = true;
public NameFinder() { executable = getExecutable(); Runtime runtime = Runtime.getRuntime(); if (demangle) { try { String[] exec = new String[] {"c++filt", "-s", "java"}; cppfilt = runtime.exec(exec); cppfiltIn = new BufferedReader (new InputStreamReader(cppfilt.getInputStream())); cppfiltO...
if (! usingAddr2name) if (name != null && ! "??".equals (name)) name = getExternalLabel (name);
private StackTraceElement lookup(RawData addrs, int n) { StackTraceElement result; result = lookupInterp(addrs, n); if (result == null) result = dladdrLookup(addrs, n); if (result == null) { String name = null; String file = null; String hex = getAddrAsString(addrs, n); if (addr2line != null) ...
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)newChildren[i]; ConsoleTreeObject cto = (ConsoleTreeObject)treeNode.getUserObject(); AgentComponent agentComponent = (AgentComponent)cto.getComponent(); if (!nodeComponentHasAgent(nodeComponent, agentComponent)) nodeComponent.addAgent(agentComponent);
AgentComponent agentComponent = (AgentComponent)getComponentFromTreeNode((DefaultMutableTreeNode)newChildren[i]); NodeComponent previousParent = (NodeComponent)agentToNode.get(agentComponent); if (previousParent != null && previousParent.equals(nodeComponent)) return; nodeComponent.addAgent(agentComponent); if (previo...
private void addAgentsToNode(NodeComponent nodeComponent, Object[] newChildren) { for (int i = 0; i < newChildren.length; i++) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)newChildren[i]; ConsoleTreeObject cto = (ConsoleTreeObject)treeNode.getUserObject(); AgentComponent agen...
agentToNode.put(agentComponent, nodeComponent);
private void addHostsFromExperiment() { DefaultMutableTreeNode root = (DefaultMutableTreeNode)hostTree.getModel().getRoot(); DefaultTreeModel model = (DefaultTreeModel)hostTree.getModel(); HostComponent[] hosts = experiment.getHosts(); for (int i = 0; i < hosts.length; i++) { HostComponent host...
NodeComponent node = (NodeComponent)iter.next(); ConsoleTreeObject cto = new ConsoleTreeObject(node);
NodeComponent nodeComponent = (NodeComponent)iter.next(); ConsoleTreeObject cto = new ConsoleTreeObject(nodeComponent);
private void addUnassignedNodesFromExperiment() { Set unassignedNodes = new TreeSet(baseComponentComparator); HostComponent[] hosts = experiment.getHosts(); NodeComponent[] nodes = experiment.getNodes(); unassignedNodes.addAll(Arrays.asList(nodes)); for (int i = 0; i < hosts.length; i++) unassigne...
AgentComponent[] agents = node.getAgents();
AgentComponent[] agents = nodeComponent.getAgents();
private void addUnassignedNodesFromExperiment() { Set unassignedNodes = new TreeSet(baseComponentComparator); HostComponent[] hosts = experiment.getHosts(); NodeComponent[] nodes = experiment.getNodes(); unassignedNodes.addAll(Arrays.asList(nodes)); for (int i = 0; i < hosts.length; i++) unassigne...
agentToNode.put(agentComponent, nodeComponent);
private void addUnassignedNodesFromExperiment() { Set unassignedNodes = new TreeSet(baseComponentComparator); HostComponent[] hosts = experiment.getHosts(); NodeComponent[] nodes = experiment.getNodes(); unassignedNodes.addAll(Arrays.asList(nodes)); for (int i = 0; i < hosts.length; i++) unassigne...
experiment.removeNode((NodeComponent)nodeCTO.getComponent());
experiment.removeNode(nodeComponent); if (parentComponent instanceof HostComponent) { nodeToHost.remove(nodeComponent); ((HostComponent)parentComponent).removeNode(nodeComponent); }
private void deleteNodeFromTree(JTree tree, TreePath path) { DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)path.getLastPathComponent(); ConsoleTreeObject nodeCTO = (ConsoleTreeObject)selectedNode.getUserObject(); // get any agents that are descendants of the node being deleted ...
if (tree.equals(hostTree)) { nodeToHost.put(nodeComponent, selectedNode.getUserObject()); }
private void newNodeInTree(JTree tree) { TreePath path = tree.getSelectionPath(); if (path == null) { System.out.println("HostConfigurationBuilder newNodeInTree called with null path; ignoring"); return; } DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)path.getLastPathCompon...
treeNodesInsertedInHostTree(e); } else if (nodeTree.getModel().equals(source)) treeNodesInsertedInNodeTree(e);
treeNodesInsertedInHostTree(e.getTreePath(), e.getChildren()); } else if (nodeTree.getModel().equals(source)) { treeNodesInsertedInNodeTree(e.getTreePath(), e.getChildren()); } else if (agentTree.getModel().equals(source)) { treeNodesInsertedInAgentTree(e.getChildren()); }
public void treeNodesInserted(TreeModelEvent e) { // System.out.println("Tree Node Inserted: " + // ((ConsoleTreeObject)((DefaultMutableTreeNode)e.getTreePath().getLastPathComponent()).getUserObject()).getName()); Object source = e.getSource(); if (hostTree.getModel().equals(source)) { ...
private void treeNodesInsertedInHostTree(TreeModelEvent e) { TreePath path = e.getTreePath(); DefaultMutableTreeNode changedNode = (DefaultMutableTreeNode)path.getLastPathComponent(); ConsoleTreeObject cto = (ConsoleTreeObject)(changedNode.getUserObject()); if (cto.isNode()) { addAgentsToNode((NodeComponent)cto.getC...
private void treeNodesInsertedInHostTree(TreePath path, Object[] children) { BaseComponent component = getComponentFromPath(path); if (component instanceof NodeComponent) addAgentsToNode((NodeComponent)component, children); else if (component instanceof HostComponent) addNodesToHost((HostComponent)component, children);
private void treeNodesInsertedInHostTree(TreeModelEvent e) { TreePath path = e.getTreePath(); // parent of the new node DefaultMutableTreeNode changedNode = (DefaultMutableTreeNode)path.getLastPathComponent(); ConsoleTreeObject cto = (ConsoleTreeObject)(changedNode.getUserObject()); // System.out...
private void treeNodesInsertedInNodeTree(TreeModelEvent e) { TreePath path = e.getTreePath(); DefaultMutableTreeNode changedNode = (DefaultMutableTreeNode)path.getLastPathComponent(); ConsoleTreeObject cto = (ConsoleTreeObject)(changedNode.getUserObject()); if (!cto.isRoot()) addAgentsToNode((NodeComponent)cto.getCom...
private void treeNodesInsertedInNodeTree(TreePath path, Object[] children) { BaseComponent component = getComponentFromPath(path); if (component == null) { for (int i = 0; i < children.length; i++) { NodeComponent nodeComponent = (NodeComponent)getComponentFromTreeNode((DefaultMutableTreeNode)children[i]); HostComponen...
private void treeNodesInsertedInNodeTree(TreeModelEvent e) { TreePath path = e.getTreePath(); DefaultMutableTreeNode changedNode = (DefaultMutableTreeNode)path.getLastPathComponent(); ConsoleTreeObject cto = (ConsoleTreeObject)(changedNode.getUserObject()); // agents were dragged on to a node // ...
Object source = e.getSource(); if (hostTree.getModel().equals(source)) { treeNodesRemovedFromHostTree(e); } else if (nodeTree.getModel().equals(source)) treeNodesRemovedFromNodeTree(e); experimentBuilder.setModified(true);
public void treeNodesRemoved(TreeModelEvent e) { // System.out.println("Tree Node Removed: " + // ((ConsoleTreeObject)((DefaultMutableTreeNode)e.getTreePath().getLastPathComponent()).getUserObject()).getName()); Object source = e.getSource(); if (hostTree.getModel().equals(source)...
agentTree.getModel().addTreeModelListener(this);
public void update() { if (experiment.getSocietyComponentCount() != 0) societyComponent = experiment.getSocietyComponent(0); else societyComponent = null; hostTree.getModel().removeTreeModelListener(this); nodeTree.getModel().removeTreeModelListener(this); removeAllChildren(hostTree); remo...
ensureResolved(haltOnFailure, true, org, module);
ensureResolved(haltOnFailure, true, org, module, null);
protected void ensureResolved(boolean haltOnFailure, String org, String module) { ensureResolved(haltOnFailure, true, org, module); }
getProject().addReference("ivy.resolved.configurations.ref."+suffix, confs);
protected void setResolved(ResolveReport report, boolean keep) { ModuleDescriptor md = report.getModuleDescriptor(); if (keep) { getProject().addReference("ivy.resolved.report", report); getProject().addReference("ivy.resolved.descriptor", md); } String suffix = md.getModuleRevisionI...
float out = in / ((2<<getComponentSize(i)) - 1);
float out = in / ((1<<getComponentSize(i)) - 1);
public float[] getNormalizedComponents(int[] components, int offset, float[] normComponents, int normOffset) { int numComponents = getNumComponents(); if (normComponents == null) { normComponents = new float[normOffset + numComponents]; } for (int i=0; i<numComponents; i++) { ...
int out = (int) (in * ((2<<getComponentSize(i)) - 1));
int out = (int) (in * ((1<<getComponentSize(i)) - 1));
public int[] getUnnormalizedComponents(float[] normComponents, int normOffset, int[] components, int offset) { int numComponents = getNumComponents(); if (components == null) { components = new int[offset + numComponents]; } for (int i=0; i<numComponents; i++) { float i...
log.info("Sheet: " + _workbook.getNumberOfSheets());
if (log.isDebugEnabled()) log.debug("Sheet: " + _workbook.getNumberOfSheets());
private void parseTable(Node tableNode) { String sheetName = nodeValueForKey(tableNode, "name", "Unnamed Sheet " + (_workbook.getNumberOfSheets() + 1)); String sheetCellStyle = nodeValueForKey(tableNode, "class", null); NSMutableDictionary sheetDict = new NSMutableDictionary(); addEntriesF...
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
GLCanvas canvas = new GLCanvas();
public static void main(String[] args) { try { Frame frame = new Frame("Tess Demo"); frame.setSize(500, 500); GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); frame.add(canvas); canvas.addGLEventListener(new TessRend...
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.generic");
createLogger();
public BirdPanel(Graph graph) { super(graph); log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.generic"); }
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.tree");
createLogger();
public ConsoleDNDTree(DefaultTreeModel model) { super(model); log = CSMART.createLogger("org.cougaar.tools.csmart.ui.tree"); }
result.takeValueForKey(debugPageProvider(),"debugPageProvider");
public WOComponent debug() { WOComponent result=null; //if (log.isDebugEnabled()) log.debug("Object = "+object()); if (object() instanceof EOEditingContext) { result=pageWithName("ERXEditingContextInspector"); result.takeValueForKey(object(),"object"); } else if (ob...
public static WOComponent debugPageForObject(EOEnterpriseObject o, WOSession s) {
public WOComponent debugPageForObject(EOEnterpriseObject o, WOSession s) { if(debugPageProvider() != null) { return debugPageProvider().debugPageForObject(o, s); }
public static WOComponent debugPageForObject(EOEnterpriseObject o, WOSession s) { // Don't want the dependency on D2W. Not sure what the best solution is //return (WOComponent)D2W.factory().inspectPageForEntityNamed(o.entityName(),s); return null; }
_debugPageProvider=null;
public void reset() { super.reset(); _object=null; }
if (agents[k].getShortName().equals(agent)) { int port = CSMARTUL.agentPort; Properties arguments = nodes[j].getArguments(); if (arguments != null) { String s = arguments.getProperty(CSMARTUL.AGENT_PORT); if (s != null) { try { port = Integer.parseInt(s); } catch (Exception e) { if (log.isErrorEnabled()) log.error("Exc...
if (agents[k].getShortName().equals(agent)) return getURL(hosts[i].getShortName(), agent, nodes[j].getArguments());
private String getOPlanAgentURL(String agent) { if (agent == null || agent.equals("")) agent = "NCA"; HostComponent[] hosts = experiment.getHostComponents(); for (int i = 0; i < hosts.length; i++) { NodeComponent[] nodes = hosts[i].getNodes(); for (int j = 0; j < nodes.length; j++) { Ag...
return null;
return "X.509";
public String getFormat() { return null; }
if (p == null || q == null || g == null) return null;
public DSAParams getParams() { return (DSAParams)(new DSAParameterSpec(p,q,g)); }
return "GnuDSAPublicKey: y=" + y.toString(16) + " p=" + p.toString(16) + " q=" + q.toString(16) + " g=" + g.toString(16);
return "GnuDSAPublicKey: y=" + (y != null ? y.toString(16) : "(null)") + " p=" + (p != null ? p.toString(16) : "(null)") + " q=" + (q != null ? q.toString(16) : "(null)") + " g=" + (g != null ? g.toString(16) : "(null)");
public String toString() { return "GnuDSAPublicKey: y=" + y.toString(16) + " p=" + p.toString(16) + " q=" + q.toString(16) + " g=" + g.toString(16); }
log.error("Exception", fnf);
log.error("createGraphFromDotFile couldnt find file " + f.getAbsolutePath() + ". Error: " + fnf);
public static CSMARTGraph createGraphFromDotFile(File f) { InputStream input = null; Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.generic.CSMARTGraph"); try { input = new FileInputStream(f); } catch(FileNotFoundException fnf) { if(log.isErrorEnabled()) { log.error...
File file = jfc.getSelectedFile(); if (file == null)
File nfile = jfc.getSelectedFile(); if (nfile == null) {
public void saveAsGraph() { JFileChooser jfc = new JFileChooser(System.getProperty("org.cougaar.install.path")); ExtensionFileFilter filter; String[] filters = { "dot" }; filter = new ExtensionFileFilter(filters, "dot files"); jfc.addChoosableFileFilter(filter); if (jfc.showSaveDialog(null) == JFile...
saveGraph(file);
} else { saveGraph(nfile); }
public void saveAsGraph() { JFileChooser jfc = new JFileChooser(System.getProperty("org.cougaar.install.path")); ExtensionFileFilter filter; String[] filters = { "dot" }; filter = new ExtensionFileFilter(filters, "dot files"); jfc.addChoosableFileFilter(filter); if (jfc.showSaveDialog(null) == JFile...
file = outputFile;
private void saveGraph(File outputFile) { if (outputFile == null) return; StringBuffer colorTable = new StringBuffer(500); // first, save colors as real colors Attribute ct = getAttribute(COLOR_TABLE); // if there's no color table, then give the COLOR_DETERMINER attributes // unique ids before ...
addDefaultArgumentsToNode((ConfigurableComponent)nodeComponent);
private void addHostsFromExperiment() { DefaultMutableTreeNode root = (DefaultMutableTreeNode)hostTree.getModel().getRoot(); DefaultTreeModel model = (DefaultTreeModel)hostTree.getModel(); HostComponent[] hosts = experiment.getHosts(); for (int i = 0; i < hosts.length; i++) { HostComponent host...
addDefaultArgumentsToNode((ConfigurableComponent)node);
private void addUnassignedNodesFromExperiment() { Set unassignedNodes = new TreeSet(configurableComponentComparator); HostComponent[] hosts = experiment.getHosts(); NodeComponent[] nodes = experiment.getNodes(); unassignedNodes.addAll(Arrays.asList(nodes)); for (int i = 0; i < hosts.length; i++) u...
addDefaultArgumentsToNode((ConfigurableComponent)nodeComponent);
private void newNodeInTree(JTree tree) { TreePath path = tree.getSelectionPath(); if (path == null) { System.out.println("HostConfigurationBuilder newNodeInTree called with null path; ignoring"); return; } DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)path.getLastPathCompon...
nameServerHostName + ":8888:5555");
nameServerHostName + ":" + CSMARTConsole.NAME_SERVER_PORTS);
private void setNameServerHostName() { String newNameServerHostName = ""; HostComponent[] hosts = experiment.getHosts(); for (int i = 0; i < hosts.length; i++) { NodeComponent[] nodes = hosts[i].getNodes(); for (int j = 0; j < nodes.length; j++) { AgentComponent[] agents = nodes[j].getAgents(); // ...