rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
outbuffer[outpos++] = (char) (0xDA00+(partial>>4));
outbuffer[outpos++] = (char) (0xD800 + ((partial - 0x400) >> 4));
public int read (char[] outbuffer, int outpos, int count) { int origpos = outpos; for (;;) { if (outpos - origpos >= count) break; if (inpos >= inlength) break; int b = inbuffer[inpos++]; if (b >= 0) outbuffer[outpos++] = (char) b; else { if ((b & 0xC0) == 0x80) // Continuation byte { p...
return new Integer(Integer.parseInt(s));
return ERXConstant.integerForString(s);
public static Integer integerWithString(String s) { try { return new Integer(Integer.parseInt(s)); } catch (Exception e) { } return null; }
suite.addTest(TestKeyFactory.suite());
public static Test suite() { System.getProperties().list(System.out); TestSuite suite = new TestSuite(); suite.addTest(TestEnhancer.suite()); suite.addTest(TestMetaClass.suite()); suite.addTest(TestDelegator.suite()); return suite; }
Class[] args = method.getParameterTypes();
private void generateMethod(String fieldName, Method method, Method invokeSuper, Method afterReturn) { Class[] args = method.getParameterTypes(); Class returnType = method.getReturnType(); boolean returnsValue = !returnType.equals(Void.TYPE); int mod = method.getModifiers(); boole...
} catch (SAXException ex) { ParseException pe = new ParseException(ex.getMessage()+" in "+xmlURL, 0); pe.initCause(ex); throw pe;
_md.check();
private void parse(URL xmlURL, Resource res, boolean validate) throws ParseException, IOException { try { setResource(res); URL schemaURL = validate?getClass().getResource("ivy.xsd"):null; XMLHelper.parse(xmlURL, schemaURL, this); checkConfigurations(); ...
} catch (Exception ex) { ParseException pe = new ParseException(ex.getMessage()+" in "+xmlURL, 0); pe.initCause(ex); throw pe;
private void parse(URL xmlURL, Resource res, boolean validate) throws ParseException, IOException { try { setResource(res); URL schemaURL = validate?getClass().getResource("ivy.xsd"):null; XMLHelper.parse(xmlURL, schemaURL, this); checkConfigurations(); ...
setLabel(label);
prop.setLabel(label);
public void setLabel(String label) { setLabel(label); }
tool.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
private void addTool(String toolName, String docName, JFrame tool) { NamedFrame.getNamedFrame().addFrame(toolName + ": " + docName, tool); final JFrame frameArg = tool; tool.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { if(!frameArg.getGlassPane().isVisible())...
+ "; guard=" + getGuard()
public String toString() { return "[Transition: origin=" + getOrigin() + "; destination=" + getDestination() + "; description=" + getDescription() + "]"; }
if (last == -1) last = 0; return path.substring(last);
return path.substring(last + 1);
public String getName () { int last = path.lastIndexOf(separatorChar); if (last == -1) last = 0; return path.substring(last); }
if (cname == null) cname = parent.getName() + "|" + self.getClassName();
String type = self.getType();
public static String getSubComponentUniqueName(ComponentData parent, ComponentData self) { if (self == null) return null; String cname = self.getName(); if (parent == null) if (cname != null) return cname; else return self.getClassName(); if (cname == null) cname = parent.getNa...
if (cname == null) cname = self.getClassName(); if (type != null && ! type.equals(ComponentData.NODE) && ! type.equals(ComponentData.AGENT) && ! cname.startsWith(parent.getName() + "|")) cname = parent.getName() + "|" + cname;
public static String getSubComponentUniqueName(ComponentData parent, ComponentData self) { if (self == null) return null; String cname = self.getName(); if (parent == null) if (cname != null) return cname; else return self.getClassName(); if (cname == null) cname = parent.getNa...
Object o=ERD2WModel.erDefaultModel();
ERD2WModel model=ERD2WModel.erDefaultModel();
public void finishInitialization() { Object o=ERD2WModel.erDefaultModel(); // force initialization // NOTE: doing Class.ERD2WModel doesn't seem enough // to guarantee fire of ERD2WModel's static initializer// Configures the system for trace rule firing. D2W.setFactory(new ERD2WFactory()); ...
model.checkRules();
public void finishInitialization() { Object o=ERD2WModel.erDefaultModel(); // force initialization // NOTE: doing Class.ERD2WModel doesn't seem enough // to guarantee fire of ERD2WModel's static initializer// Configures the system for trace rule firing. D2W.setFactory(new ERD2WFactory()); ...
if(log.isDebugEnabled()) { log.debug("TESTING- got a local Asset to match: " + lasset); }
public boolean matches(Asset asset) { // If its an ABC LocalAsset, treat it separately if (asset instanceof LocalAsset) { LocalAsset lasset = (LocalAsset)asset; if(log.isDebugEnabled()) { log.debug("TESTING- got a local Asset to match: " + lasset); } RolesPG rolesPG = ((lasset !=...
log = CSMART.createLogger(this.getClass().getName());
public void setupSubscriptions() { log = CSMART.createLogger(this.getClass().getName()); if (log.isDebugEnabled()) { log.debug(" entering setupSubscriptions"); } // parse the "template" rules from our configuration info try { parseTemplateRules(); } catch (Exception e) { // unable to ...
public boolean readBoolean() throws IOException { Object obj = vec.elementAt(ptr++); return (((Boolean)obj).booleanValue()); }
public boolean readBoolean() throws IOException { Object obj = vec.elementAt(ptr++); return ((Boolean) obj).booleanValue(); }
public boolean readBoolean() throws IOException { Object obj = vec.elementAt(ptr++); return (((Boolean)obj).booleanValue());}
public byte readByte() throws IOException { Object obj = vec.elementAt(ptr++); return (((Byte)obj).byteValue()); }
public byte readByte() throws IOException { Object obj = vec.elementAt(ptr++); return ((Byte) obj).byteValue(); }
public byte readByte() throws IOException { Object obj = vec.elementAt(ptr++); return (((Byte)obj).byteValue());}
public char readChar() throws IOException { Object obj = vec.elementAt(ptr++); return (((Character)obj).charValue()); }
public char readChar() throws IOException { Object obj = vec.elementAt(ptr++); return ((Character) obj).charValue(); }
public char readChar() throws IOException { Object obj = vec.elementAt(ptr++); return (((Character)obj).charValue());}
public double readDouble() throws IOException { Object obj = vec.elementAt(ptr++); return (((Double)obj).doubleValue()); }
public double readDouble() throws IOException { Object obj = vec.elementAt(ptr++); return ((Double) obj).doubleValue(); }
public double readDouble() throws IOException { Object obj = vec.elementAt(ptr++); return (((Double)obj).doubleValue());}
public float readFloat() throws IOException { Object obj = vec.elementAt(ptr++); return (((Float)obj).floatValue()); }
public float readFloat() throws IOException { Object obj = vec.elementAt(ptr++); return ((Float) obj).floatValue(); }
public float readFloat() throws IOException { Object obj = vec.elementAt(ptr++); return (((Float)obj).floatValue());}
public int readInt() throws IOException { Object obj = vec.elementAt(ptr++); return (((Integer)obj).intValue()); }
public int readInt() throws IOException { Object obj = vec.elementAt(ptr++); return ((Integer) obj).intValue(); }
public int readInt() throws IOException { Object obj = vec.elementAt(ptr++); return (((Integer)obj).intValue());}
public long readLong() throws IOException { Object obj = vec.elementAt(ptr++); return (((Long)obj).longValue()); }
public long readLong() throws IOException { Object obj = vec.elementAt(ptr++); return ((Long) obj).longValue(); }
public long readLong() throws IOException { Object obj = vec.elementAt(ptr++); return (((Long)obj).longValue());}
public Object readObject() throws IOException { return (vec.elementAt(ptr++)); }
public Object readObject() throws IOException { return vec.elementAt(ptr++); }
public Object readObject() throws IOException { return (vec.elementAt(ptr++));}
public short readShort() throws IOException { Object obj = vec.elementAt(ptr++); return (((Short)obj).shortValue()); }
public short readShort() throws IOException { Object obj = vec.elementAt(ptr++); return ((Short) obj).shortValue(); }
public short readShort() throws IOException { Object obj = vec.elementAt(ptr++); return (((Short)obj).shortValue());}
Object[] getArguments() { return (vec.toArray()); }
Object[] getArguments() { return vec.toArray(); }
Object[] getArguments() { return (vec.toArray());}
long getHash() { return (hash); }
long getHash() { return hash; }
long getHash() { return (hash);}
public ObjectInput getInputStream() throws IOException { if (conn != null) { return (conn.getObjectInputStream()); } else { ptr = 0; return (new DummyObjectInputStream()); } }
public ObjectInput getInputStream() throws IOException { if (conn != null) return conn.getObjectInputStream(); ptr = 0; return new DummyObjectInputStream(); }
public ObjectInput getInputStream() throws IOException { if (conn != null) { return (conn.getObjectInputStream()); } else { ptr = 0; return (new DummyObjectInputStream()); }}
Object getObject() { return (object); }
Object getObject() { return object; }
Object getObject() { return (object);}
int getOpnum() { return (opnum); }
int getOpnum() { return opnum; }
int getOpnum() { return (opnum);}
public ObjectOutput getOutputStream() throws IOException { vec = new Vector(); return (new DummyObjectOutputStream()); }
public ObjectOutput getOutputStream() throws IOException { vec = new Vector(); return new DummyObjectOutputStream(); }
public ObjectOutput getOutputStream() throws IOException { vec = new Vector(); return (new DummyObjectOutputStream());}
public ObjectOutput getResultStream(boolean success) throws IOException, StreamCorruptedException { vec = new Vector(); return (new DummyObjectOutputStream()); }
public ObjectOutput getResultStream(boolean success) throws IOException, StreamCorruptedException { vec = new Vector(); return new DummyObjectOutputStream(); }
public ObjectOutput getResultStream(boolean success) throws IOException, StreamCorruptedException { vec = new Vector(); return (new DummyObjectOutputStream());}
Object returnValue() { return (vec.elementAt(0)); }
Object returnValue() { return vec.elementAt(0); }
Object returnValue() { return (vec.elementAt(0));}
if (WOApplication.application().isCachingEnabled() || !ERXExtensions.safeEquals(request().stringFormValueForKey("pw"), System.getProperty("er.extensions.ERXLog4JPassword")))
if (!WOApplication.application().isCachingEnabled() || ERXExtensions.safeEquals(request().stringFormValueForKey("pw"), System.getProperty("er.extensions.ERXLog4JPassword")))
public WOComponent log4jAction() { // FIXME: password protection? WOComponent result=null; if (WOApplication.application().isCachingEnabled() || !ERXExtensions.safeEquals(request().stringFormValueForKey("pw"), System.getProperty("er.extensions.ERXLog4JPassword"))) result=p...
if (WOApplication.application().isCachingEnabled() || !ERXExtensions.safeEquals(request().stringFormValueForKey("pw"), System.getProperty("er.extensions.ERXJUnitPassword"))) {
if (!WOApplication.application().isCachingEnabled() || ERXExtensions.safeEquals(request().stringFormValueForKey("pw"), System.getProperty("er.extensions.ERXJUnitPassword"))) {
public WOComponent testAction() { // FIXME: password protection? WOComponent result=null; if (WOApplication.application().isCachingEnabled() || !ERXExtensions.safeEquals(request().stringFormValueForKey("pw"), System.getProperty("er.extensions.ERXJUnitPassword"))) { ...
propUIC = addProperty(PROP_UIC, (aad.getUIC() != null) ? aad.getUIC() : "");
propUIC = addProperty(PROP_UIC, (aad.getUIC() != null) ? aad.getUIC() : "UIC/" + aad.getClusterID());
public void initProperties() { // strip off extension if it exists int index = filename.indexOf('.'); if (index != -1) filename = filename.substring(0, index); // Since there are two possible types of asset files, we // need to determine which parser to use. // We will determine this by lookin...
String s = e.getMessage();
String s = e.getMessage().toLowerCase();
private static Long getNextPkValueForEntityIncreaseBy(String ename, int count, int _increaseBy) { if (_increaseBy < 1) _increaseBy = 1; Connection con = ERXJDBCConnectionBroker.connectionBrokerForEntityNamed(ename).getConnection(); try { con.setAutoCommit(false); con.setRe...
s.indexOf("ORA-00942: table or view does not exist") != -1) {
s.indexOf("ora-00942") != -1) {
private static Long getNextPkValueForEntityIncreaseBy(String ename, int count, int _increaseBy) { if (_increaseBy < 1) _increaseBy = 1; Connection con = ERXJDBCConnectionBroker.connectionBrokerForEntityNamed(ename).getConnection(); try { con.setAutoCommit(false); con.setRe...
String rev = (String)resolvedRevisions.get(systemMid.getModuleId());
String rev = (String)resolvedRevisions.get(systemMid);
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (_justOpen != null) { out.print(">"); } _context.push(qName);...
throw new RuntimeException( "ERXEOControlUtilities: localInstancesOfObjects: Array is null");
throw new RuntimeException("ERXUtilites: localInstancesOfObjects: Array is null");
public static NSArray localInstancesOfObjects(EOEditingContext ec, NSArray eos) { if (eos == null) throw new RuntimeException( "ERXEOControlUtilities: localInstancesOfObjects: Array is null"); if (ec == null) throw new RuntimeException( ...
throw new RuntimeException( "ERXEOControlUtilities: localInstancesOfObjects: EditingContext is null");
throw new RuntimeException("ERXUtilites: localInstancesOfObjects: EditingContext is null");
public static NSArray localInstancesOfObjects(EOEditingContext ec, NSArray eos) { if (eos == null) throw new RuntimeException( "ERXEOControlUtilities: localInstancesOfObjects: Array is null"); if (ec == null) throw new RuntimeException( ...
fixLockingForMysql(model.connectionDictionary().valueForKey("URL"), eoentity);
public static void registerDescriptionForEntitiesInModel(EOModel model) { if (!_registeredModelNames.containsObject(model.name())) { for (Enumeration e = model.entities().objectEnumerator(); e.hasMoreElements();) { EOEntity eoentity = (EOEntity)e.nextElement(); String...
public Parser getParser () throws SAXException { if (parser == null) parser = new XMLReaderAdapter (ae2); return parser; }
public Parser getParser() throws SAXException { if (parser == null) { parser = new XMLReaderAdapter(ae2); } return parser; }
public Parser getParser () throws SAXException { if (parser == null) parser = new XMLReaderAdapter (ae2); return parser; }
public boolean getFeature (String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException { Boolean value = (Boolean) flags.get (name); if (value != null) return value.booleanValue (); else try { return new JaxpParser ().getXMLReader ().getFeature (name); } catch (SAXNotRecognize...
public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException { Boolean value = (Boolean) flags.get(name); if (value != null) { return value.booleanValue(); } else { try { return new JaxpParser().getXMLReader().getFeature(name); } catch (SAXNotRecognize...
public boolean getFeature (String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException { Boolean value = (Boolean) flags.get (name); if (value != null) return value.booleanValue (); else try { return new JaxpParser ().getXMLReader ().getFeature (name); ...
parser.setFeature ( SAXDriver.FEATURE + "namespaces", isNamespaceAware ()); parser.setFeature ( SAXDriver.FEATURE + "validation", isValidating ());
parser.setFeature(SAXDriver.FEATURE + "namespaces", isNamespaceAware()); parser.setFeature(SAXDriver.FEATURE + "validation", isValidating()); while (e.hasMoreElements()) { String uri = (String) e.nextElement(); Boolean value = (Boolean) flags.get(uri); parser.setFeature(uri, value.booleanValue()); }
public SAXParser newSAXParser () throws ParserConfigurationException, SAXException { JaxpParser jaxp = new JaxpParser (); Enumeration e = flags.keys (); XMLReader parser = jaxp.getXMLReader (); parser.setFeature ( SAXDriver.FEATURE + "namespaces", isNamespaceAware ()); parser.setFeature ( SAXDriver.FEATURE...
while (e.hasMoreElements ()) { String uri = (String) e.nextElement (); Boolean value = (Boolean) flags.get (uri); parser.setFeature (uri, value.booleanValue ()); } return jaxp; }
return jaxp; }
public SAXParser newSAXParser () throws ParserConfigurationException, SAXException { JaxpParser jaxp = new JaxpParser (); Enumeration e = flags.keys (); XMLReader parser = jaxp.getXMLReader (); parser.setFeature ( SAXDriver.FEATURE + "namespaces", isNamespaceAware ()); parser.setFeature ( SAXDriver.FEATURE...
relData.setItem("");
relData.setItem(relName);
private void addRelationship() { Vector relationships = new Vector(); AgentComponent[] agents = ((SocietyComponent)componentToConfigure).getAgents(); for (int i = 0; i < agents.length; i++) relationships.add(agents[i].getShortName()); String relName = (String)ComboDialog.showDialog(this, ...
return (ComponentData[])children.toArray();
return (ComponentData[])children.toArray(new ComponentData[0]);
public ComponentData[] getChildren() { return (ComponentData[])children.toArray(); }
return (LeafComponentData[]) leafComponents.toArray();
return (LeafComponentData[]) leafComponents.toArray(new LeafComponentData[0]);
public LeafComponentData[] getLeafComponents() { return (LeafComponentData[]) leafComponents.toArray(); }
if(value.length() < 1) return null;
public String strippedValue() { String value=(String)valueForBinding("value"); StringTokenizer tokenizer = new StringTokenizer(value, "<", false); if(value.length() < 1) return null; int token = value.charAt(0) == '<' ? 0 : 1; String nextPart = null; StringBuffer...
if (count + add >= buf.length)
if (count + add > buf.length)
private void resize (int add) { if (count + add >= buf.length) { int newlen = buf.length * 2; if (count + add > newlen) newlen = count + add; byte[] newbuf = new byte[newlen]; System.arraycopy(buf, 0, newbuf, 0, count); buf = newbuf; } }
(String)ComboDialog.showDialog(this, "Binder", new Vector(sortedNames));
(String)ComboDialog.showDialog(this, "Select Binder or Enter New Name", new Vector(sortedNames));
private void addBinder() { Enumeration components = componentToNode.keys(); ArrayList binderNames = new ArrayList(); ArrayList binderClasses = new ArrayList(); while (components.hasMoreElements()) { Object o = components.nextElement(); if (o instanceof BinderComponent) { BinderComponent b...
if (ec == null) throw new IllegalStateException("EditingContext is null. Required to know which model group to use.");
public static EOAttribute createAggregateAttribute(EOEditingContext ec, String function, String attributeName, String entityName) { if (ec == null)...
EOEntity entity = EOUtilities.entityNamed(ec, entityName);
EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
public static EOAttribute createAggregateAttribute(EOEditingContext ec, String function, String attributeName, String entityName) { if (ec == null)...
EOModel m = EOModelGroup.defaultGroup().modelNamed(modelName);
EOModel m = modelGroup(null).modelNamed(modelName);
public static String createSchemaSQLForEntitiesInModelWithNameAndOptions(NSArray entities, String modelName, NSDictionary optionsCreate) { //get the JDBCAdaptor EODatabaseContext dc = EOUtilities.databaseContextForModelNamed(ERXEC.newEditingContext(), ...
EOModelGroup group = (ec == null) ? EOModelGroup.defaultGroup() : EOUtilities.modelGroup(ec);
EOModelGroup group = modelGroup(ec);
public static EOEntity entityMatchingString(EOEditingContext ec, String string) { EOEntity result = null; if(string != null) { String lowerCaseName = string.toLowerCase(); if (entityNames == null) { EOModelGroup group = (ec == null) ? EOModelGroup.defaultGroup() : ...
if (ec == null) throw new IllegalStateException("Editing context argument is null for method: entityWithNamedIsShared");
public static boolean entityWithNamedIsShared(EOEditingContext ec, String entityName) { if (ec == null) throw new IllegalStateException("Editing context argument is null for method: entityWithNamedIsShared"); if (entityName == null) throw new IllegalStateException("Entity name ar...
EOEntity entity = EOUtilities.entityNamed(ec, entityName);
EOEntity entity = entityNamed(ec, entityName);
public static boolean entityWithNamedIsShared(EOEditingContext ec, String entityName) { if (ec == null) throw new IllegalStateException("Editing context argument is null for method: entityWithNamedIsShared"); if (entityName == null) throw new IllegalStateException("Entity name ar...
String modelNamed,
String modelName,
public static Number getNextValFromSequenceNamed(EOEditingContext ec, String modelNamed, String sequenceName) { String sqlString = "select "+sequenceName+".nextVal from dual"; NSArray array = EOUtil...
NSArray array = EOUtilities.rawRowsForSQL(ec, modelNamed, sqlString);
NSArray array = EOUtilities.rawRowsForSQL(ec, modelName, sqlString);
public static Number getNextValFromSequenceNamed(EOEditingContext ec, String modelNamed, String sequenceName) { String sqlString = "select "+sequenceName+".nextVal from dual"; NSArray array = EOUtil...
throw new RuntimeException("Unable to generate value from sequence named: " + sequenceName + " in model: " + modelNamed);
throw new RuntimeException("Unable to generate value from sequence named: " + sequenceName + " in model: " + modelName);
public static Number getNextValFromSequenceNamed(EOEditingContext ec, String modelNamed, String sequenceName) { String sqlString = "select "+sequenceName+".nextVal from dual"; NSArray array = EOUtil...
EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName);
EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
public static NSDictionary primaryKeyDictionaryForEntity(EOEditingContext ec, String entityName) { // FIXME: Should use the modelgroup for the root object store of the // editing context. EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName); EODatabaseContext dbContext...
elementID = "foo";
protected void updateVarNames() { String elementID = context().elementID(); elementID = ERXStringUtilities.replaceStringByStringInString(".", "_", elementID); elementID = "foo"; pickerName = "picker_"+ elementID; parentSelectName = "parent_" + elementID; childSelectName = "...
ArrayList values = (ArrayList)o; for (int i = 0; i < values.size(); i++) node.setAttribute(name + "_" + i, (String)values.get(i));
ArrayList values = (ArrayList)o; try { for (int i = 0; i < values.size(); i++) node.setAttribute(name + "_" + i, (String)values.get(i)); } catch (ClassCastException e) { System.out.println("CSMARTGraph: exception setting attribute with name: " + name + " " + e); }
private Node makeNode(NodeObject obj) { String UID = obj.getUID(); if (UIDToNode.get(UID) != null) return null; // don't make duplicates Node node = new Node(this, UID); UIDToNode.put(UID, node); if (!obj.isVisible()) { node.setAttribute(INVISIBLE_ATTRIBUTE, "true"); node.visible = false...
else System.out.println("CSMARTGraph: WARNING: Displaying property: " + name + " of class: " + o.getClass() + " not supported");
private Node makeNode(NodeObject obj) { String UID = obj.getUID(); if (UIDToNode.get(UID) != null) return null; // don't make duplicates Node node = new Node(this, UID); UIDToNode.put(UID, node); if (!obj.isVisible()) { node.setAttribute(INVISIBLE_ATTRIBUTE, "true"); node.visible = false...
public EnumSyntax[] getEnumValueTable()
protected EnumSyntax[] getEnumValueTable()
public EnumSyntax[] getEnumValueTable() { return null; }
public String[] getStringTable()
protected String[] getStringTable()
public String[] getStringTable() { return null; }
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
GLCanvas canvas = new GLCanvas();
public void run(String[] args) { dev = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); origMode = dev.getDisplayMode(); DisplayMode newMode = null; if (dev.isFullScreenSupported()) { newMode = ScreenResSelector.showSelectionDialog(); if (newMode != null) { init...
eq.postEvent(ie);
public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { // FIXME: Is this an appropriate way to access the event queue? EventQueue eq = Toolkit.systemEventQueue; Thread current = Thread.currentThread(); if (current == eq.dispatchThread) throw ...
eq.postEvent(ie);
public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { // FIXME: Is this an appropriate way to access the event queue? EventQueue eq = Toolkit.systemEventQueue; Thread current = Thread.currentThread(); if (current == eq.dispatchThread) throw ...
public Object newInstance(Class declaring, Class iface);
public Object newInstance(String declaring, String iface);
public Object newInstance(Class declaring, Class iface);
Object key = KEY_FACTORY.newInstance(iface, targetClass);
Object key = KEY_FACTORY.newInstance(iface.getName(), targetClass.getName());
public ConstructorDelegate create() { setNamePrefix(targetClass.getName()); Object key = KEY_FACTORY.newInstance(iface, targetClass); return (ConstructorDelegate)super.create(key); }
updateExperimentEditability();
public void exitMenuItem_actionPerformed(AWTEvent e) { updateExperimentEditability(); stopExperiments(); updateExperimentControls(experiment, false); // If this was this frame's exit menu item, we have to remove // the window from the list // if it was a WindowClose, the parent notices this as well ...
updateExperimentEditability();
public void exitMenuItem_actionPerformed(AWTEvent e) { updateExperimentEditability(); stopExperiments(); updateExperimentControls(experiment, false); // If this was this frame's exit menu item, we have to remove // the window from the list // if it was a WindowClose, the parent notices this as well ...
runButton.setEnabled(true); return;
for (int j = 0; j < nodes.length; j++) { AgentComponent[] agents = nodes[j].getAgents(); if (agents != null && agents.length > 0) { runButton.setEnabled(true); return; } }
private void initRunButton() { HostComponent[] hosts = experiment.getHosts(); for (int i = 0; i < hosts.length; i++) { NodeComponent[] nodes = hosts[i].getNodes(); if (nodes != null && nodes.length > 0) { runButton.setEnabled(true); return; } } runButton.setEnabled(false); }
ArrayList hostsToUse = new ArrayList();
hostsToUse = new ArrayList();
public void runButton_actionPerformed(ActionEvent e) { destroyOldNodes(); // Get rid of any old stuff before creating the new userStoppedTrials = false; ArrayList nodesToUse = new ArrayList(); ArrayList hostsToUse = new ArrayList(); // hosts that nodes are on nameServerHostName = null; HostComponent...
if (! hostsToUse.contains(hostName)) continue;
private void saveResults() { if (currentTrial < 0) return; // nothing to save File resultDir = getResultDir(); if (resultDir == null) return; // can't save, user didn't specify metrics directory Trial trial = experiment.getTrials()[currentTrial]; if (runStart == null) runStart = new Date...
saveResults();
public void stopButton_actionPerformed(ActionEvent e) { stopButton.setSelected(true); // indicate stopping stopButton.setEnabled(false); // disable until experiment stops // determine if societies in an experiment are self terminating // Experiment experiment = csmart.getExperiment(); // if user sel...
animator.stop(); System.exit(0);
new Thread(new Runnable() { public void run() { animator.stop(); System.exit(0); } }).start();
public void run(String[] args) { if (args.length > 1) { usage(getClass().getName()); } if (args.length == 1) { if (args[0].equals("-slow")) { vboEnabled = false; } else { usage(getClass().getName()); } } setFlag(' ', true); // animation on setFlag('i', true); //...
public PropertyBuilder(CSMART csmart, ModifiableComponent mc) {
public PropertyBuilder(CSMART csmart, ModifiableComponent mc, Experiment experiment) {
public PropertyBuilder(CSMART csmart, ModifiableComponent mc) { log = CSMART.createLogger(this.getClass().getName()); this.csmart = csmart; // initialize menus and gui panels JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); JMenu fileMenu = new JMenu(FILE_MENU); saveMenuItem...
this.experiment = experiment;
public PropertyBuilder(CSMART csmart, ModifiableComponent mc) { log = CSMART.createLogger(this.getClass().getName()); this.csmart = csmart; // initialize menus and gui panels JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); JMenu fileMenu = new JMenu(FILE_MENU); saveMenuItem...
propertyEditor.exit();
private void exit() { propertyEditor.stopEditing(); // accept any edit in progress saveToDatabase(true); // silently save }
if (configComponent instanceof RecipeComponent) {
if (experiment != null) { saveExperiment(); return; } if (configComponent instanceof SocietyComponent) { ((SocietyComponent)configComponent).saveToDatabase(); CSMART.getOrganizer().displayExperiments((SocietyComponent)configComponent); } else if (configComponent instanceof RecipeComponent) {
private void saveToDatabase(boolean silently) { if (configComponent instanceof RecipeComponent) { try { RecipeComponent rc = (RecipeComponent) configComponent; PDbBase pdb = new PDbBase(); switch (pdb.recipeExists(rc)) { case PDbBase.RECIPE_STATUS_EXISTS: if (silently) ...
displayExperiments(rc);
CSMART.getOrganizer().displayExperiments(rc);
private void saveToDatabase(boolean silently) { if (configComponent instanceof RecipeComponent) { try { RecipeComponent rc = (RecipeComponent) configComponent; PDbBase pdb = new PDbBase(); switch (pdb.recipeExists(rc)) { case PDbBase.RECIPE_STATUS_EXISTS: if (silently) ...
saveMenuItem.setEnabled(configComponent instanceof RecipeComponent);
private void setConfigComponent(ModifiableComponent newConfigComponent) { configComponent = newConfigComponent; saveMenuItem.setEnabled(configComponent instanceof RecipeComponent); }
ERXEOControlUtilities.saveChanges(editingContext());
editingContext().saveChanges();
public boolean tryToSaveChanges(boolean validateObjects) { if (log.isDebugEnabled()) log.debug("tryToSaveChanges() validateObjects: "+validateObjects+" shouldSaveChanges: "+shouldSaveChanges()); boolean saved = false; try { if (!isListEmpty() && validateObjects && shouldValidateBefo...
errorMessage = ERXLocalizer.currentLocalizer().localizedTemplateStringForKeyWithObject("CouldNotSave", ex);
setErrorMessage(ERXLocalizer.currentLocalizer().localizedTemplateStringForKeyWithObject("CouldNotSave", ex));
public boolean tryToSaveChanges(boolean validateObjects) { if (log.isDebugEnabled()) log.debug("tryToSaveChanges() validateObjects: "+validateObjects+" shouldSaveChanges: "+shouldSaveChanges()); boolean saved = false; try { if (!isListEmpty() && validateObjects && shouldValidateBefo...
if(shouldRecoverFromOptimisticLockingFailure() && ERXEOAccessUtilities.recoverFromAdaptorException(object().editingContext(), ex)) { errorMessage = ERXLocalizer.currentLocalizer().localizedTemplateStringForKeyWithObject("CouldNotSavePleaseReapply", d2wContext());
if(shouldRecoverFromOptimisticLockingFailure()) { EOEnterpriseObject eo = ERXEOAccessUtilities.refetchFailedObject(editingContext(), ex); setErrorMessage(ERXLocalizer.currentLocalizer().localizedTemplateStringForKeyWithObject("CouldNotSavePleaseReapply", d2wContext())); validationFailedWithException(ex, eo, "CouldNotSa...
public boolean tryToSaveChanges(boolean validateObjects) { if (log.isDebugEnabled()) log.debug("tryToSaveChanges() validateObjects: "+validateObjects+" shouldSaveChanges: "+shouldSaveChanges()); boolean saved = false; try { if (!isListEmpty() && validateObjects && shouldValidateBefo...
if (impl == null) throw new SocketException ( "MulticastSocket: Cant access socket implementation");
public void setLoopbackMode(boolean disable) throws SocketException { impl.setOption (SocketOptions.IP_MULTICAST_LOOP, new Boolean (disable)); }
single = new Dimension(fixedCellWidth, fixedCellHeight); } else if (nrows != 0 && getUI() != null) { Rectangle tmp = getUI().getCellBounds(this, 0, 0); if (tmp != null) single = tmp.getSize(); }
if (fixedCellWidth != -1) { int size = getModel().getSize(); retVal = new Dimension(fixedCellWidth, size * fixedCellHeight); } }
public Dimension getPreferredScrollableViewportSize() { int vis = getVisibleRowCount(); int nrows = getModel() == null ? 0 : getModel().getSize(); // FIXME: this is a somewhat arbitrary default, but.. ? Dimension single = new Dimension(10, 10);; Rectangle bounds = null; if (vis > nrows) { ...
if (debug) log.debug ("Sending a message ... " + aMessage);
if (debug) { log.debug ("Sending a message ... " + aMessage); Enumeration enum = aMessage.getAllHeaderLines(); while(enum.hasMoreElements()) { String header = (String)enum.nextElement(); log.debug(header); } }
protected void _sendMessageNow (ERMessage message, Transport transport) throws MessagingException { boolean debug = log.isDebugEnabled (); MimeMessage aMessage = message.mimeMessage (); Object callbackObject = message.callbackObject (); MessagingException exception = null; if (me...
exception = e; } catch (Throwable t) { log.error ("An unexpected error occured while sending message: " + message + " mime message: " + aMessage + " sending to: " + aMessage.getAllRecipients () + " transport: " + transport, t); throw new NSForwardException(t); } finally { stats.incrementMailCount (); if (exception !=...
protected void _sendMessageNow (ERMessage message, Transport transport) throws MessagingException { boolean debug = log.isDebugEnabled (); MimeMessage aMessage = message.mimeMessage (); Object callbackObject = message.callbackObject (); MessagingException exception = null; if (me...
if (s == null || s.length() == 0) {
if (s == null || s.length() == 0)
private void notifyMenuItem_actionPerformed() { String s = (String)JOptionPane.showInputDialog(this, "Notify if any node writes:", "Notification", JOptionPane.QUESTION_MESSAGE, ...
return; }
else notifyCondition = s;
private void notifyMenuItem_actionPerformed() { String s = (String)JOptionPane.showInputDialog(this, "Notify if any node writes:", "Notification", JOptionPane.QUESTION_MESSAGE, ...
((ConsoleNodeListener)i.next()).setNotifyCondition(s); notifyCondition = s;
((ConsoleNodeListener)i.next()).setNotifyCondition(notifyCondition);
private void notifyMenuItem_actionPerformed() { String s = (String)JOptionPane.showInputDialog(this, "Notify if any node writes:", "Notification", JOptionPane.QUESTION_MESSAGE, ...
getImpl().setOption(SocketOptions.SO_BROADCAST, new Boolean(enable));
getImpl().setOption(SocketOptions.SO_BROADCAST, Boolean.valueOf(enable));
public void setBroadcast(boolean enable) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); getImpl().setOption(SocketOptions.SO_BROADCAST, new Boolean(enable)); }
getImpl().setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
getImpl().setOption (SocketOptions.SO_REUSEADDR, Boolean.valueOf(on));
public void setReuseAddress(boolean on) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); getImpl().setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); }
result = data.getType() + "|" + data.getClassName();
String nodeName = findAncestorOfType(data, ComponentData.NODE).getName(); result = nodeName + "|" + data.getClassName(); System.out.println("Result = " + result);
public String getComponentAlibId(ComponentData data) { if (data == null) return null; String result = data.getAlibID(); if (result == null) { String componentType = data.getType(); if (componentType.equals(ComponentData.PLUGIN)) { String agentName = ...
String [] interfaceNames = new String[interfaces.length];
List interfaceNames = new ArrayList(interfaces.length);
public static Object writeReplace(Object enhanced) throws ObjectStreamException { MethodInterceptor mi = Enhancer.getMethodInterceptor(enhanced); String parentClassName = enhanced.getClass().getSuperclass().getName(); Class interfaces[] = enhanced.getClass().getInterfaces(); ...
interfaceNames[i] = interfaces[i].getName();
if (interfaces[i].getPackage() != Enhancer.class.getPackage()) { interfaceNames.add(interfaces[i].getName()); }
public static Object writeReplace(Object enhanced) throws ObjectStreamException { MethodInterceptor mi = Enhancer.getMethodInterceptor(enhanced); String parentClassName = enhanced.getClass().getSuperclass().getName(); Class interfaces[] = enhanced.getClass().getInterfaces(); ...