rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public void finalize ()
protected void finalize ()
public void finalize () { end (); }
Point p = parent.getLocation(); Dimension d = parent.getSize(); int centerX = p.x + d.width/2; int centerY = p.y + d.height/2; Dimension myD = getSize(); setLocation(new Point(centerX - myD.width/2, centerY - myD.height/2));
public CMTDialog(JFrame parent, Organizer organizer, String experimentName, String experimentId) { super(parent, "Threads and Groups", true); // modal dialog this.organizer = organizer; // to get unique names this.experimentName = experimentName; this.experimentId = exp...
int result = JOptionPane.showConfirmDialog(this, "Modify Experiment", "Modify Experiment?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (result == JOptionPane.NO_OPTION) return false;
private boolean cloneExperiment() { // ask user to confirm cloning experiment int result = JOptionPane.showConfirmDialog(this, "Modify Experiment", "Modify Experiment?", JOpt...
if (origin == null) { return null; }
public String toString() { if (origin == null) { ModuleRevisionId revId = ModuleRevisionId.newInstance(org, moduleName, revision); Artifact artifact = new DefaultArtifact(revId, null, artifactName, artifactType, artifactExt); Ivy ivy = IvyContext.getContext().getIvy(); File cache = Iv...
societyCopy.saveToDatabase();
experimentCopy.saveToDb(saveToDbConflictHandler);
public void run() { // Check the return value? societyCopy.saveToDatabase(); GUIUtils.timeConsumingTaskEnd(organizer); }
synchronized(lockObject) { if (updateNeeded) { nextUpdate = System.currentTimeMillis(); lockObject.notify(); while (updateNeeded) { try { lockObject.wait(); } catch (InterruptedException ie) {
if (doWorkspace) { synchronized(lockObject) { if (updateNeeded) { nextUpdate = System.currentTimeMillis(); lockObject.notify(); while (updateNeeded) { try { lockObject.wait(); } catch (InterruptedException ie) { }
protected boolean exitAllowed() { synchronized(lockObject) { if (updateNeeded) { nextUpdate = System.currentTimeMillis(); lockObject.notify(); while (updateNeeded) { try { lockObject.wait(); } catch (InterruptedException ie) { } } } } return true; }
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);
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) { component.addPropertiesListener(myPropertiesListener); for (Iterator i = component.getProperties(); i.hasNext(); ) { Property p = (Property) i.next(); PropertyEvent event = new PropertyEvent(p, PropertyEvent.PROPERTY_ADDED); myPropert...
experiment.saveToDb(saveToDbConflictHandler); GUIUtils.timeConsumingTaskEnd(organizer); }
expt.saveToDb(saveToDbConflictHandler); GUIUtils.timeConsumingTaskEnd(organizer); }
public void run() { experiment.saveToDb(saveToDbConflictHandler); // save under new name GUIUtils.timeConsumingTaskEnd(organizer); }
update();
if (doWorkspace) update();
protected void renameWorkspace() { String name = JOptionPane.showInputDialog("New workspace name"); if (name == null || name.equals("")) return; workspaceFileName = name; String rootName = this.workspaceFileName; int extpos = this.workspaceFileName.lastIndexOf('.'); if (extpos >= 0) { root...
if (f.canRead()) {
if (doWorkspace && f.canRead()) { if (log.isInfoEnabled()) { log.info("Reading from workspace file " + fileName); }
private void restore(String fileName) { PropertyListener l = null; try { File f = new File(fileName); this.workspaceFileName = f.getPath(); if (f.canRead()) { ObjectInputStream ois = new ObjectInputStream(new FileInputStream(f)); try { root = (DefaultMutableTreeNode) ois.readObject(); for (En...
update();
if (doWorkspace) update();
protected void save() { update(); }
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())...
protected void startConsole() { DefaultMutableTreeNode node = getSelectedNode(); Object o = node.getUserObject(); Experiment experiment; if (o instanceof SocietyComponent) { SocietyComponent sc = (SocietyComponent) o; String name = "Temp Experiment for " + sc.getSocietyName(); name = experi...
if (! doWorkspace) return;
private void update() { synchronized (lockObject) { nextUpdate = System.currentTimeMillis() + UPDATE_DELAY; updateNeeded = true; lockObject.notify(); } }
if ( this.process == null )
checkObjectAttribute( "process", this.process ); ProcessContext context = getProcessContext(); ProcessEngine engine = null; ProcessContext spawned = null; if ( context == null )
public void doTag(XMLOutput output) throws Exception { if ( this.process == null ) { throw new MissingAttributeException( "process" ); } ProcessContext context = getProcessContext(); ProcessEngine engine = getProcessEngine(); engine.spawn( getProcess(), ...
throw new MissingAttributeException( "process" );
engine = getEngine(); if ( engine == null ) { throw new MissingAttributeException( "engine" ); } spawned = engine.spawn( getProcess() ); } else { engine = context.getProcessEngine(); spawned = engine.spawn( getProcess(), context );
public void doTag(XMLOutput output) throws Exception { if ( this.process == null ) { throw new MissingAttributeException( "process" ); } ProcessContext context = getProcessContext(); ProcessEngine engine = getProcessEngine(); engine.spawn( getProcess(), ...
ProcessContext context = getProcessContext(); ProcessEngine engine = getProcessEngine(); engine.spawn( getProcess(), context );
if ( getVar() != null ) { getContext().setVariable( getVar(), spawned ); }
public void doTag(XMLOutput output) throws Exception { if ( this.process == null ) { throw new MissingAttributeException( "process" ); } ProcessContext context = getProcessContext(); ProcessEngine engine = getProcessEngine(); engine.spawn( getProcess(), ...
e.push(method.getDeclaringClass().getName());
public void generate(ClassEmitter ce, final Context context) { for (Iterator it = context.getMethods(); it.hasNext();) { Method method = (Method)it.next(); if (Modifier.isProtected(method.getModifiers())) { // ignore protected methods } else { Co...
downloadArtifacts(dependencies, artifactFilter, report, new HashMap(), new HashMap(), cache);
Collection artifacts = new ArrayList(); for (int i = 0; i < dependencies.length; i++) { if (!dependencies[i].isCompletelyEvicted() && !dependencies[i].hasProblem()) { artifacts.addAll(Arrays.asList(dependencies[i].getSelectedArtifacts(artifactFilter))); } } fireIvyEvent(new PrepareDownloadEvent((Artifact[])artifacts.t...
private void downloadArtifacts(IvyNode[] dependencies, Filter artifactFilter, ResolveReport report, File cache) { downloadArtifacts(dependencies, artifactFilter, report, new HashMap(), new HashMap(), cache); }
EODatabaseContext dbc = (EODatabaseContext) dbcs.objectForKey(entityName);
String key = entityName + "/" + System.identityHashCode(osc); EODatabaseContext dbc = (EODatabaseContext) dbcs.objectForKey(key);
private NSDictionary snapshotsGroupedByEntity(NSArray objects, EOObjectStoreCoordinator osc) { if(objects == null || objects.count() == 0) { return NSDictionary.EmptyDictionary; } NSMutableDictionary result = new NSMutableDictionary(); NSMut...
dbcs.setObjectForKey(dbc, entityName);
dbcs.setObjectForKey(dbc, key);
private NSDictionary snapshotsGroupedByEntity(NSArray objects, EOObjectStoreCoordinator osc) { if(objects == null || objects.count() == 0) { return NSDictionary.EmptyDictionary; } NSMutableDictionary result = new NSMutableDictionary(); NSMut...
for(Enumeration entityNames = changesByEntity.allKeys().objectEnumerator(); entityNames.hasMoreElements();) {
NSMutableDictionary snapshotsByGlobalID = new NSMutableDictionary(); for(Enumeration entityNames = changesByEntity.allKeys().objectEnumerator(); entityNames.hasMoreElements();) {
private void process(EOObjectStoreCoordinator sender, SnapshotProcessor processor, NSDictionary changesByEntity) { NSMutableDictionary dbcs = new NSMutableDictionary(); for (Enumeration oscs = _synchronizer.coordinators(); oscs.hasMoreElements(); ) { EOObjectStoreCoordinator...
EODatabaseContext dbc = (EODatabaseContext) dbcs.objectForKey(entityName);
EODatabaseContext dbc = (EODatabaseContext) dbcs.objectForKey(key);
private void process(EOObjectStoreCoordinator sender, SnapshotProcessor processor, NSDictionary changesByEntity) { NSMutableDictionary dbcs = new NSMutableDictionary(); for (Enumeration oscs = _synchronizer.coordinators(); oscs.hasMoreElements(); ) { EOObjectStoreCoordinator...
dbcs.setObjectForKey(dbc, entityName);
dbcs.setObjectForKey(dbc, key);
private void process(EOObjectStoreCoordinator sender, SnapshotProcessor processor, NSDictionary changesByEntity) { NSMutableDictionary dbcs = new NSMutableDictionary(); for (Enumeration oscs = _synchronizer.coordinators(); oscs.hasMoreElements(); ) { EOObjectStoreCoordinator...
NSDictionary snapshot = (NSDictionary)snapshotsEnumerator.nextElement(); EOGlobalID globalID = entity.globalIDForRow(snapshot); EODatabaseContext._EOAssertSafeMultiThreadedAccess(dbc); dbc.lock(); try { processor.processSnapshotForGlobalID(database, snapshot, globalID); } finally { dbc.unlock(); }
NSDictionary snapshot = (NSDictionary)snapshotsEnumerator.nextElement(); EOGlobalID globalID = entity.globalIDForRow(snapshot); snapshotsByGlobalID.setObjectForKey(snapshot, globalID); } if(snapshotsByGlobalID.count() > 0) { EODatabaseContext._EOAssertSafeMultiThreadedAccess(dbc); dbc.lock(); try { processor.processSn...
private void process(EOObjectStoreCoordinator sender, SnapshotProcessor processor, NSDictionary changesByEntity) { NSMutableDictionary dbcs = new NSMutableDictionary(); for (Enumeration oscs = _synchronizer.coordinators(); oscs.hasMoreElements(); ) { EOObjectStoreCoordinator...
nio_put_Int (this, position (), limit , value);
nio_put_Int (this, position (), limit (), value);
final public ByteBuffer putInt (int value) { if (readOnly) throw new ReadOnlyBufferException (); nio_put_Int (this, position (), limit , value); inc_pos (4); return this; }
CharBufferImpl (byte[] copy)
public CharBufferImpl(int cap, int off, int lim)
CharBufferImpl (byte[] copy) { super (copy.length / 2, copy.length / 2, 0, 0); this.backing_buffer = (copy != null ? nio_cast (copy) : null); readOnly = false; }
super (copy.length / 2, copy.length / 2, 0, 0); this.backing_buffer = (copy != null ? nio_cast (copy) : null);
super (cap, lim, off, 0); this.backing_buffer = new char [cap];
CharBufferImpl (byte[] copy) { super (copy.length / 2, copy.length / 2, 0, 0); this.backing_buffer = (copy != null ? nio_cast (copy) : null); readOnly = false; }
log.info("Loading file: " + file);
protected static NSDictionary dictionaryFromFile(File file) { NSDictionary model = null; try { model = Services.dictionaryFromFile(file); NSArray rules = (NSArray)model.objectForKey("rules"); Enumeration e = rules.objectEnumerator(); boolean patchRules = ERX...
DBUtils.deleteItems("community_entity_attribute", "assembly_id", DBUtils.sqlQuote(assembly_id), QUERY_FILE);
public static void reallyClearCMTasb(String assembly_id){ if (assembly_id == null || assembly_id.equals("")) return; Logger log = CSMART.createLogger("org.cougaar.tools.csmart.core.db.CMT"); // Avoid base assemblies here if (assembly_id.startsWith("CMT") && assembly_id.indexOf("134589") != -1) { ...
Type base = Type.getType(type);
public FastClassEmitter(ClassVisitor v, String className, Class type) { super(v); begin_class(Constants.V1_2, Constants.ACC_PUBLIC, className, FAST_CLASS, null, Constants.SOURCE_FILE); // constructor CodeEmitter e = begin_method(Constants.ACC_PUBLIC, CSTRUCT_CLASS, null, null); ...
e.checkcast(Type.getType(type));
e.checkcast(base);
public FastClassEmitter(ClassVisitor v, String className, Class type) { super(v); begin_class(Constants.V1_2, Constants.ACC_PUBLIC, className, FAST_CLASS, null, Constants.SOURCE_FILE); // constructor CodeEmitter e = begin_method(Constants.ACC_PUBLIC, CSTRUCT_CLASS, null, null); ...
invokeSwitchHelper(e, methods, 2);
invokeSwitchHelper(e, methods, 2, base);
public FastClassEmitter(ClassVisitor v, String className, Class type) { super(v); begin_class(Constants.V1_2, Constants.ACC_PUBLIC, className, FAST_CLASS, null, Constants.SOURCE_FILE); // constructor CodeEmitter e = begin_method(Constants.ACC_PUBLIC, CSTRUCT_CLASS, null, null); ...
e.new_instance(Type.getType(type));
e.new_instance(base);
public FastClassEmitter(ClassVisitor v, String className, Class type) { super(v); begin_class(Constants.V1_2, Constants.ACC_PUBLIC, className, FAST_CLASS, null, Constants.SOURCE_FILE); // constructor CodeEmitter e = begin_method(Constants.ACC_PUBLIC, CSTRUCT_CLASS, null, null); ...
invokeSwitchHelper(e, constructors, 1);
invokeSwitchHelper(e, constructors, 1, base);
public FastClassEmitter(ClassVisitor v, String className, Class type) { super(v); begin_class(Constants.V1_2, Constants.ACC_PUBLIC, className, FAST_CLASS, null, Constants.SOURCE_FILE); // constructor CodeEmitter e = begin_method(Constants.ACC_PUBLIC, CSTRUCT_CLASS, null, null); ...
private static void invokeSwitchHelper(final CodeEmitter e, List members, final int arg) {
private static void invokeSwitchHelper(final CodeEmitter e, List members, final int arg, final Type base) {
private static void invokeSwitchHelper(final CodeEmitter e, List members, final int arg) { final List info = CollectionUtils.transform(members, MethodInfoTransformer.getInstance()); final Label illegalArg = e.make_label(); Block block = e.begin_block(); e.process_switch(getIntRan...
e.invoke(method);
e.invoke(method, base);
private static void invokeSwitchHelper(final CodeEmitter e, List members, final int arg) { final List info = CollectionUtils.transform(members, MethodInfoTransformer.getInstance()); final Label illegalArg = e.make_label(); Block block = e.begin_block(); e.process_switch(getIntRan...
e.invoke(method);
e.invoke(method, base);
public void processCase(int key, Label end) { MethodInfo method = (MethodInfo)info.get(key); Type[] types = method.getSignature().getArgumentTypes(); for (int i = 0; i < types.length; i++) { e.load_arg(arg); e.aaload(i); ...
Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui");
Logger log = (Logger) NullLoggingServiceImpl.getNullLoggingServiceImpl();
private static void replyWithHTML( PrintWriter out, ClusterIdentifier cid, Set startUIDs, boolean isDown, List l) { Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui"); int nStartUIDs = ((startUIDs != null) ? startUIDs.size() : 0); out.print( ...
Enhancer.enhance(EB.class, null, TEST_INTERCEPTOR).toString();
((EB)Enhancer.enhance(EB.class, null, TEST_INTERCEPTOR)).finalTest();
public void testABC() throws Throwable{ Enhancer.enhance(EA.class, null, TEST_INTERCEPTOR).toString(); Enhancer.enhance(EC1.class, null, TEST_INTERCEPTOR).toString(); Enhancer.enhance(EB.class, null, TEST_INTERCEPTOR).toString(); Enhancer.enhance(ED.class, null, TEST_INTERCEPTOR).toString(); ...
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
GLCanvas canvas = new GLCanvas();
public static void main(String[] args) { GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); ProceduralTexturePhysics demo = new ProceduralTexturePhysics(); canvas.addGLEventListener(demo); final Animator animator = new Animator(canvas); demo.setDemoListener(new DemoL...
private MethodProxy(ClassLoader loader ,Class c1, String m1, Class c2, String m2) { this.m1 = m1; this.m2 = m2; f1 = helper(loader, c1); f2 = helper(loader, c2); i1 = f1.getIndex(m1); i2 = f2.getIndex(m2);
private MethodProxy(FastClass f1, int i1, FastClass f2, int i2) { this.f1 = f1; this.i1 = i1; this.f2 = f2; this.i2 = i2;
private MethodProxy(ClassLoader loader ,Class c1, String m1, Class c2, String m2) { this.m1 = m1; this.m2 = m2; f1 = helper(loader, c1); f2 = helper(loader, c2); i1 = f1.getIndex(m1); i2 = f2.getIndex(m2); // TODO: handle protected method exception here instead of in...
public static MethodProxy create(ClassLoader loader, Class c1, String m1, Class c2, String m2) { return new MethodProxy(loader, c1, m1, c2, m2);
public static MethodProxy create(ClassLoader loader, Class c1, final String m1, Class c2, String m2) { FastClass f1 = helper(loader, c1); FastClass f2 = helper(loader, c2); int i1 = f1.getIndex(m1); int i2 = f2.getIndex(m2); if (i1 < 0) { return new MethodProxy(f2, i2) { public Object invoke(Object obj, Object[] args) ...
public static MethodProxy create(ClassLoader loader, Class c1, String m1, Class c2, String m2) { return new MethodProxy(loader, c1, m1, c2, m2); }
private FastClass helper(ClassLoader loader, Class type) {
private static FastClass helper(ClassLoader loader, Class type) {
private FastClass helper(ClassLoader loader, Class type) { FastClass.Generator g = new FastClass.Generator(); g.setType(type); g.setClassLoader(loader); return g.create(); }
if (i1 == -1) { throw new IllegalAccessException("Protected method: " + m1); } else { try { return f1.invoke(i1, obj, args); } catch (InvocationTargetException e) { throw e.getTargetException(); }
try { return f1.invoke(i1, obj, args); } catch (InvocationTargetException e) { throw e.getTargetException();
public Object invoke(Object obj, Object[] args) throws Throwable { if (i1 == -1) { throw new IllegalAccessException("Protected method: " + m1); } else { try { return f1.invoke(i1, obj, args); } catch (InvocationTargetException e) { throw e...
if (i2 == -1) { throw new IllegalAccessException("Protected method: " + m2); } else { try { return f2.invoke(i2, obj, args); } catch (InvocationTargetException e) { throw e.getTargetException(); }
try { return f2.invoke(i2, obj, args); } catch (InvocationTargetException e) { throw e.getTargetException();
public Object invokeSuper(Object obj, Object[] args) throws Throwable { if (i2 == -1) { throw new IllegalAccessException("Protected method: " + m2); } else { try { return f2.invoke(i2, obj, args); } catch (InvocationTargetException e) { th...
public CSMARTFactory(LDMServesPlugIn ldm) { RootFactory rf = ldm.getFactory(); rf.addAssetFactory( new org.cougaar.tools.csmart.runtime.ldm.asset.AssetFactory()); rf.addPropertyGroupFactory( new org.cougaar.tools.csmart.runtime.ldm.asset.PropertyGroupFactory()); ClusterServesPlugIn cspi = (ClusterServesPlugIn)ldm; se...
public CSMARTFactory() { }
public CSMARTFactory(LDMServesPlugIn ldm) { // attach our CSMART domain factories to the root factory RootFactory rf = ldm.getFactory(); rf.addAssetFactory( new org.cougaar.tools.csmart.runtime.ldm.asset.AssetFactory()); rf.addPropertyGroupFactory( new org.cougaar.tools.csmart.runtime.ldm.as...
public void updateUI() { setUI((MenuItemUI) UIManager.get(this)); invalidate(); }
public void updateUI() { MenuItemUI mi = ((MenuItemUI) UIManager.getUI(this)); setUI(mi); invalidate(); }
public void updateUI() { setUI((MenuItemUI) UIManager.get(this)); invalidate(); } // updateUI()
public void setMnemonic(int mne)
public void setMnemonic(char mne)
public void setMnemonic(int mne) { getModel().setMnemonic(mne); }
DefaultModuleDescriptor md = genCallerMD(id, new String[] {"*"}, false, false);
DefaultModuleDescriptor md = DefaultModuleDescriptor.newCallerInstance(id, new String[] {"*"}, false, false);
public ResolvedModuleRevision findModule(ModuleRevisionId id) { DependencyResolver r = getResolver(id.getModuleId()); if (r == null) { throw new IllegalStateException("no resolver found for "+id.getModuleId()); } DefaultModuleDescriptor md = genCallerMD(id, new String[] {"*"}, false, false); try { retur...
public abstract long get ();
public LongBuffer get (long[] dst, int offset, int length) { for (int i = offset; i < offset + length; i++) { dst [i] = get (); } return this; }
public abstract long get ();
public abstract LongBuffer put (long b);
public LongBuffer put (LongBuffer src) { if (src == this) throw new IllegalArgumentException (); if (src.remaining () > remaining ()) throw new BufferOverflowException (); if (src.remaining () > 0) { long[] toPut = new long [src.remaining ()]; src.get (toPut); src.put (toPut); } return this; }
public abstract LongBuffer put (long b);
_data.getReport().addDependency(this);
private boolean handleConfiguration(boolean loaded, String conf) { if ("*".equals(conf)) { if (_md != null) { _fetchedConfigurations.addAll(Arrays.asList(_md.getPublicConfigurationsNames())); _confsToFetch.clear(); addRootModuleConfigurations(_rootModul...
throw new RuntimeException("'id' XPath expression '"+idXPath+"' does not return a text node: "+e);
throw new SAXException("'id' XPath expression '"+idXPath+"' does not return a text node: "+e, e);
private Document addIds(Document doc, String elementXPath, String idXPath) throws SAXException { getLogger().debug("## Using element XPath "+elementXPath); NodeList sects = processor.selectNodeList(doc, elementXPath); getLogger().debug("## .. got "+sects.getLength()+" sections"); for (in...
public long generateKey() { return HashUtil.hash(this.elementXPath+this.idXPath);
public Serializable generateKey() { return ""+HashUtil.hash(this.elementXPath+this.idXPath);
public long generateKey() { return HashUtil.hash(this.elementXPath+this.idXPath); }
public CacheValidity generateValidity() { return new NOPCacheValidity();
public SourceValidity generateValidity() { return new NOPValidity();
public CacheValidity generateValidity() { return new NOPCacheValidity(); }
getLogger().error("Error when transforming XML", se); throw new RuntimeException("Error transforming XML. See error log for details: "+se);
getLogger().error("Error when transforming XML: "+se.getMessage(), se.getException()); throw new RuntimeException("Error transforming XML. See error log for details: "+se.getMessage()+". Nested exception: "+se.getException().getMessage());
protected Document transform(Document doc) { getLogger().debug("## Transforming with element='"+elementXPath+"', id='"+idXPath+"'"); Document newDoc = null; try { newDoc = addIds(doc, elementXPath, idXPath); } catch (SAXException se) { // Really ought to be able to ...
public Component getContainer ()
public Container getContainer ()
public Component getContainer () { return (Component) source; }
return (Component) source;
return (Container) source;
public Component getContainer () { return (Component) source; }
ArrayList assemblyIds = getTrialAssemblyIds(trialId);
ArrayList assemblyIds = getTrialAssemblyIds(experimentId, trialId);
private void createCMTExperiment(DefaultMutableTreeNode node, String experimentName, String experimentId, String trialId) { System.out.println("Creating society"); // get assembly ids for trial ArrayList ass...
System.out.println("Nodes query: " + query);
private ArrayList getNodes(String trialId, String assemblyMatch) { ArrayList nodes = new ArrayList(); try { Connection conn = DBUtils.getConnection(); Map substitutions = new HashMap(); substitutions.put(":trial_id", trialId); substitutions.put(":assemblyMatch", assemblyMatch); Statemen...
private ArrayList getTrialAssemblyIds(String trialId) {
private ArrayList getTrialAssemblyIds(String experimentId, String trialId) {
private ArrayList getTrialAssemblyIds(String trialId) { ArrayList assemblyIds = new ArrayList(); try { Connection conn = DBUtils.getConnection(); Map substitutions = new HashMap(); substitutions.put(":trial_id", trialId); Statement stmt = conn.createStatement(); String query = DBUtils.g...
break;
private ArrayList getTrialAssemblyIds(String trialId) { ArrayList assemblyIds = new ArrayList(); try { Connection conn = DBUtils.getConnection(); Map substitutions = new HashMap(); substitutions.put(":trial_id", trialId); Statement stmt = conn.createStatement(); String query = DBUtils.g...
if(log.isDebugEnabled()) {
if(log.isErrorEnabled()) {
public CommunityTimePhasedData() { super(); createLogger(); communities = new ArrayList(); try { setStartTime(""); } catch (ParseException pe) { if(log.isDebugEnabled()) { log.error("Caught an exception setting startTime"); } } try { setStopTime(""); } catch (ParseEx...
hostConfigurationBuilder.save();
private void exit() { // before exiting, restore experiment's and society's editability // FIXME Restore on society!!!! if (isEditable) experiment.setEditable(isEditable); if (isRunnable) experiment.setRunnable(isRunnable); // If the experiment now has a society and is otherwise runnable, sa...
if (isConsole && ((CSMARTConsole)frameArg).dontClose) return;
private void addTool(String toolName, String docName, JFrame tool) { NamedFrame.getNamedFrame().addFrame(toolName + ": " + docName, tool); final JFrame frameArg = tool; tool.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); tool.addWindowListener(new WindowAdapter() { public void windowC...
if (isConsole && ((CSMARTConsole)frameArg).dontClose) return;
public void windowClosing(WindowEvent e) { if(!frameArg.getGlassPane().isVisible()) { NamedFrame.getNamedFrame().removeFrame(frameArg); // Next line can cause NPE in Container.removeNotify(line 1878) // Is there some test we can/should do on the JFrame before calling? try { frameArg.disp...
animator.stop(); System.exit(0);
new Thread(new Runnable() { public void run() { animator.stop(); System.exit(0); } }).start();
public static void main(String[] argv) { Frame frame = new Frame("NVidia Cg Toolkit \"cgGL_vertex_example\" demo"); GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); canvas.addGLEventListener(new cgGL_vertex_example()); frame.add(canvas); frame.setSize(500, 500...
String resolvedFileName = IvyPatternHelper.substitute(pattern, artifact);
String resolvedFileName = IvyPatternHelper.substitute(pattern, used);
protected void logArtifactNotFound(Artifact artifact) { if (_artifactPatterns.isEmpty()) { if (artifact.getUrl() == null) { logArtifactAttempt(artifact, "no artifact pattern => no attempt to find artifact "+artifact); } } for (Iterator iter = _artifactPatterns.iterator(...
if (artifact.getUrl() != null) { logArtifactAttempt(artifact, artifact.getUrl().toString());
if (used.getUrl() != null) { logArtifactAttempt(artifact, used.getUrl().toString());
protected void logArtifactNotFound(Artifact artifact) { if (_artifactPatterns.isEmpty()) { if (artifact.getUrl() == null) { logArtifactAttempt(artifact, "no artifact pattern => no attempt to find artifact "+artifact); } } for (Iterator iter = _artifactPatterns.iterator(...
if (isM2compatible()) { mrid = convertM2IdForResourceSearch(mrid); }
protected void logIvyNotFound(ModuleRevisionId mrid) { Artifact artifact = DefaultArtifact.newIvyArtifact(mrid, null); logMdNotFound(mrid, artifact); }
assertTrue(e.getMessage().indexOf("[ org1 | mod1.2 | 2.0.0 ]:2.0 (needed by [ jayasoft | resolve-noconflict | 1.0 ]) conflicts with [ org1 | mod1.2 | 2.1.0 ]:2.1 (needed by [ jayasoft | resolve-noconflict | 1.0 ])")!=-1);
assertTrue(e.getMessage().indexOf("[ org1 | mod1.2 | 2.0.0 ]:2.0 (needed by [ jayasoft | resolve-noconflict | 1.0 ])")!=-1); assertTrue(e.getMessage().indexOf("conflicts with")!=-1); assertTrue(e.getMessage().indexOf("[ org1 | mod1.2 | 2.1.0 ]:2.1 (needed by [ jayasoft | resolve-noconflict | 1.0 ])")!=-1);
public void testConflictResolve() throws Exception { try { ivy.resolve( RegexpConflictManagerTest.class .getResource( "ivy-conflict.xml" ), null, new String[] { "*" }, null, new Date(), false ); fail( "Resolve should have failed with a con...
gtkTextGetSize (rows, cols, dims);
gtkTextGetSize (dims);
public Dimension getMinimumSize (int rows, int cols) { int dims[] = new int[2]; gtkTextGetSize (rows, cols, dims); return (new Dimension (dims[0], dims[1])); }
gtkTextGetSize (rows, cols, dims);
gtkTextGetSize (dims);
public Dimension getPreferredSize (int rows, int cols) { int dims[] = new int[2]; gtkTextGetSize (rows, cols, dims); return (new Dimension (dims[0], dims[1])); }
public String getUserObjectClassName() { return getParameter(userObjectClassParameter);
public static String getUserObjectClassName(DataFlavor flavor) { return flavor.getParameter(userObjectClassParameter);
public String getUserObjectClassName() { return getParameter(userObjectClassParameter); }
if (mouseEventTarget != null)
if (mouseEventTarget != null && e.getID() != MouseEvent.MOUSE_ENTERED)
boolean handleEvent (AWTEvent e) { if ((eventMask & e.getID ()) == 0) return false; if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; acquireComponentForMouseEvent (me); if (mouseEventTarget != null) { Component oldSource = (Component) me.getSourc...
Point parentLocation = nativeContainer.getLocationOnScreen(); Point childLocation = mouseEventTarget.getLocationOnScreen(); me.translatePoint(parentLocation.x - childLocation.x, parentLocation.y - childLocation.y);
boolean handleEvent (AWTEvent e) { if ((eventMask & e.getID ()) == 0) return false; if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; acquireComponentForMouseEvent (me); if (mouseEventTarget != null) { Component oldSource = (Component) me.getSourc...
new NSArray(EOSortOrdering.sortOrderingWithKey("description", EOSortOrdering.CompareAscending)));
new NSArray(EOSortOrdering.sortOrderingWithKey("toString", EOSortOrdering.CompareAscending)));
public NSArray list() { if (_list == null) { _list = EOSortOrdering.sortedArrayUsingKeyOrderArray(choices.allKeys(), new NSArray(EOSortOrdering.sortOrderingWithKey("description", EOSortOrdering.CompareAscending))); } return _lis...
atts = new SimpleAttributeSet[4];
atts = new SimpleAttributeSet[3];
public ConsoleNodeListener(CSMARTConsole console, NodeComponent nodeComponent, String logFileName, NodeStatusButton statusButton, ConsoleStyledDocument doc) throws IOException { createLogger(); this.console = console; this.nodeComponent = nodeComponent; no...
StyleConstants.setForeground(atts[2], new Color(205, 205, 205)); atts[3] = new SimpleAttributeSet(); StyleConstants.setForeground(atts[3], new Color(64, 64, 192));
StyleConstants.setForeground(atts[2], new Color(64, 64, 192));
public ConsoleNodeListener(CSMARTConsole console, NodeComponent nodeComponent, String logFileName, NodeStatusButton statusButton, ConsoleStyledDocument doc) throws IOException { createLogger(); this.console = console; this.nodeComponent = nodeComponent; no...
case NodeEvent.HEARTBEAT: return "@";
private final String getNodeEventDescription(final NodeEvent nodeEvent) { switch (nodeEvent.getType()) { case NodeEvent.STANDARD_OUT: case NodeEvent.STANDARD_ERR: return nodeEvent.getMessage(); case NodeEvent.HEARTBEAT: return "@"; default: return nodeEvent.toString(); } }
case NodeEvent.HEARTBEAT:
default:
private final SimpleAttributeSet getNodeEventStyle(final int type) { switch (type) { case NodeEvent.STANDARD_OUT: return atts[0]; case NodeEvent.STANDARD_ERR: return atts[1]; case NodeEvent.HEARTBEAT: return atts[2]; default: return atts[3]; } }
default: return atts[3];
private final SimpleAttributeSet getNodeEventStyle(final int type) { switch (type) { case NodeEvent.STANDARD_OUT: return atts[0]; case NodeEvent.STANDARD_ERR: return atts[1]; case NodeEvent.HEARTBEAT: return atts[2]; default: return atts[3]; } }
Transfer[] types = new Transfer[] { FileTransfer.getInstance()}; treeViewer.addDropSupport(operations, types, new SiteDropListener(projectName ,document, treeViewer));
Transfer[] types = new Transfer[] { FileTransfer.getInstance() }; treeViewer.addDropSupport(operations, types, new DropTargetListener() { public void dragEnter(DropTargetEvent event) { } public void dragLeave(DropTargetEvent event) { } public void dragOperationChanged(DropTargetEvent event) { } public void d...
public void createPartControl(Composite parent) { treeViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); getSite().setSelectionProvider(treeViewer); int operations = DND.DROP_COPY | DND.DROP_MOVE; Transfer[] types = new Transfer[] { FileTransfer.getInstance()}; treeViewer.addDropSupport(ope...
return "site.xml"; }
return Utilities.getPathToXDocs() + java.io.File.separator + "site.xml"; }
protected String getFilename() { return "site.xml"; }
Node deletionElement = (Element) treeSelection.getFirstElement(); Node deletionParent = deletionElement.getParentNode(); deletionParent.removeChild(deletionElement);
NewSiteElement elementCreation_ = new NewSiteElement( treeSelection, document); elementCreation_.init(PlatformUI.getWorkbench(), null); WizardDialog dialog = new WizardDialog(treeViewer .getControl().getShell(), elementCreation_); dialog.open();
public void run() { if (treeSelection != null) { //TODO: Code to remove Element does here. Node deletionElement = (Element) treeSelection.getFirstElement(); Node deletionParent = deletionElement.getParentNode(); deletionParent.removeChild(deletionElement); treeViewer.refresh(); } }
DOMUtilities.SaveDOM(document,path);
if (treeSelection != null) { Node deletionElement = (Element) treeSelection .getFirstElement(); Node deletionParent = deletionElement.getParentNode(); deletionParent.removeChild(deletionElement); treeViewer.refresh(); }
public void run() { DOMUtilities.SaveDOM(document,path); }
boolean canSave = canSave(); if (canSave) { if (hasBinding("saveAction")) { WOActionResults results = (WOActionResults) valueForBinding("saveAction"); canSave = canSave();
boolean canSave = canSave(); if (canSave) { if (hasBinding("saveAction")) { WOActionResults results = (WOActionResults) valueForBinding("saveAction"); canSave = canSave(); } if (canSave) { _editing = false; setValueForBinding(Boolean.FALSE, "editing"); }
public WOActionResults save() { // check to see if we can save before firing the action (for permissions) boolean canSave = canSave(); if (canSave) { if (hasBinding("saveAction")) { WOActionResults results = (WOActionResults) valueForBinding("saveAction"); canSave = canSave(); } // check to see if we can...
if (canSave) { _editing = false; setValueForBinding(Boolean.FALSE, "editing"); }
return null;
public WOActionResults save() { // check to see if we can save before firing the action (for permissions) boolean canSave = canSave(); if (canSave) { if (hasBinding("saveAction")) { WOActionResults results = (WOActionResults) valueForBinding("saveAction"); canSave = canSave(); } // check to see if we can...
return null; }
public WOActionResults save() { // check to see if we can save before firing the action (for permissions) boolean canSave = canSave(); if (canSave) { if (hasBinding("saveAction")) { WOActionResults results = (WOActionResults) valueForBinding("saveAction"); canSave = canSave(); } // check to see if we can...
log = CSMART.createLogger(this.getClass().getName());
public CSMARTPlugIn() { log = CSMART.createLogger(this.getClass().getName()); }
log = (LoggingService) getServiceBroker().getService(this, LoggingService.class, null);
public void load() throws StateModelException { // FIXME!!! What about ThreadingChoice?? super.load(); domainService = (DomainService) getServiceBroker().getService(this, DomainService.class, new ServiceRevokedListener() { public void serviceRevoked(ServiceRevokedEvent re) { if (Domain...
public ConcreteProcess (String[] progarray, String[] envp) throws IOException
public ConcreteProcess (String[] progarray, String[] envp, File dir) throws IOException
public ConcreteProcess (String[] progarray, String[] envp) throws IOException { startProcess (progarray, envp); }
startProcess (progarray, envp);
startProcess (progarray, envp, dir);
public ConcreteProcess (String[] progarray, String[] envp) throws IOException { startProcess (progarray, envp); }
public ERXMutableArray(Object aobj[]) { super(aobj);
public ERXMutableArray() { super();
public ERXMutableArray(Object aobj[]) { super(aobj); }
return (ModifiableConfigurableComponent)copyRecipe((RecipeComponent)comp, context);
return comp;
public ModifiableConfigurableComponent copyComponent(ModifiableConfigurableComponent comp, Object context) { if (comp instanceof SocietyComponent) return (ModifiableConfigurableComponent)copySociety((SocietyComponent)comp, context); else if (comp instanceof Experiment) return (ModifiableC...
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.experiment");
createLogger();
public HostConfigurationBuilder(Experiment experiment, ExperimentBuilder experimentBuilder) { log = CSMART.createLogger("org.cougaar.tools.csmart.ui.experiment"); this.experiment = experiment; this.experimentBuilder = experimentBuilder; hostConfigurationBuilder = this; //...
} else if (throwable instanceof NoClassDefFoundError) {
} else if (throwable instanceof NoClassDefFoundError || throwable instanceof AbstractMethodError || throwable instanceof InstantiationError || throwable instanceof NoSuchFieldError || throwable instanceof NoSuchMethodError) {
public void handlePotentiallyFatalException(Exception exception) { Throwable throwable = null; if (exception instanceof InvocationTargetException) { throwable = ((InvocationTargetException)exception).getTargetException(); } else if (exception instanceof NSForwardException ) { ...
return getBounds();
return new Rectangle (x, y, width, height);
public Rectangle bounds() { return getBounds(); }
return x >= 0 && y >= 0 && x < width && y < height;
return inside (x, y);
public boolean contains(int x, int y) { return x >= 0 && y >= 0 && x < width && y < height; }
setEnabled(false);
this.enabled = false; if (peer != null) peer.setEnabled (false);
public void disable() { setEnabled(false); }