rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int num)
public Point2D transform(Point2D src, Point2D dst)
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int num) { if (srcPts == dstPts && dstOff > srcOff && num > 1 && srcOff + 2 * num > dstOff) { float[] f = new float[2 * num]; System.arraycopy(srcPts, srcOff, f, 0, 2 * num); srcPt...
if (srcPts == dstPts && dstOff > srcOff && num > 1 && srcOff + 2 * num > dstOff) { float[] f = new float[2 * num]; System.arraycopy(srcPts, srcOff, f, 0, 2 * num); srcPts = f; } while (--num >= 0) { float x = srcPts[srcOff++]; float y = srcPts[srcOff++]; dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02); dstPts[dstO...
if (dst == null) dst = new Point2D.Double(); double x = src.getX(); double y = src.getY(); double nx = m00 * x + m01 * y + m02; double ny = m10 * x + m11 * y + m12; dst.setLocation(nx, ny); return dst;
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int num) { if (srcPts == dstPts && dstOff > srcOff && num > 1 && srcOff + 2 * num > dstOff) { float[] f = new float[2 * num]; System.arraycopy(srcPts, srcOff, f, 0, 2 * num); srcPt...
postActionEvent (((List)awtComponent).getSelectedItem (), me.getModifiers ());
{ String selectedItem = ((List)awtComponent).getSelectedItem (); if (selectedItem != null) postActionEvent (((List)awtComponent).getSelectedItem (), me.getModifiers ()); }
public void handleEvent (AWTEvent e) { if (e.getID () == MouseEvent.MOUSE_CLICKED && isEnabled ()) { /* Only generate the ActionEvent on the second click of a multiple click */ MouseEvent me = (MouseEvent) e; if (!me.isConsumed () && (me.getModifiers () & MouseEvent.BUTTON1_MASK) != 0 && me...
return(multipleMode);
return allowsMultipleSelections ();
isMultipleMode(){ return(multipleMode);}
return(items.size());
return countItems ();
getItemCount(){ return(items.size());}
Thread.dumpStack();
protected void fireModification() { Thread.dumpStack(); super.fireModification(); }
Thread.dumpStack();
public void setEditable(boolean editable) { if (editable == this.editable) return; this.editable = editable; System.err.println("new editable " + editable); Thread.dumpStack(); for (int i = 0; i < getComponentCount(); i++) getComponent(i).setEditable(editable); fireModification(); }
if (entity.subEntities().size() > 0) { for (Iterator it = entity.subEntities().iterator(); it.hasNext();) { EOEntity entity1 = (EOEntity) it.next(); entityNames.addObjectsFromArray(externalNamesForEntity(entity1, includeParentEntities));
if (entity.subEntities().count() > 0) { for (Enumeration it = entity.subEntities().objectEnumerator(); it.hasMoreElements();) { EOEntity entity1 = (EOEntity) it.nextElement(); NSArray names = externalNamesForEntity(entity1, includeParentEntities); entityNames.addObjectsFromArray(names);
public static NSArray externalNamesForEntity(EOEntity entity, boolean includeParentEntities) { if (includeParentEntities) { entity = rootEntityForEntity(entity); } NSMutableArray entityNames = new NSMutableArray(); if (entity.subEntities().size() > 0) { for (Iterat...
sourceCode = JavaCCtoHTML.prettyString(sourceCode);
try { Class JavaCCtoHTML = Class.forName("JavaCCtoHTML"); NSSelector prettyString = new NSSelector("prettyString", new Class [] {String.class}); prettyString.invoke(JavaCCtoHTML, sourceCode); } catch (Exception ex) { log.error(ex); }
public String sourceCode() { if(sourceCode != null) return sourceCode; StringWriter writer = new StringWriter(); try { Decompiler decompiler = new Decompiler(); decompiler.setClassPath(cp); decompiler.decompile(classInf...
Organizer organizer = CSMART.getOrganizer(); organizer.addChildren(experiment);
private void exit() { saveSilently(); // if experiment from database was modified, save it experiment.setEditInProgress(false); }
splitPane.setLeftComponent(tree);
splitPane.setLeftComponent(new JScrollPane(tree));
public UnboundPropertyBuilder(Experiment experiment, ExperimentBuilder experimentBuilder) { this.experiment = experiment; this.experimentBuilder = experimentBuilder; isEditable = experiment.isEditable(); isRunnable = experiment.isRunnable(); root = new DefaultMutableTree...
public synchronized int read(byte[] b, int off, int len) throws IOException
public synchronized int read() throws IOException
public synchronized int read(byte[] b, int off, int len) throws IOException { if (off < 0 || len < 0 || off + len > b.length) throw new ArrayIndexOutOfBoundsException(); if (pos >= count && !refill()) return -1; // No bytes were read before EOF. int remain = Math.min(count - pos, len); System....
if (off < 0 || len < 0 || off + len > b.length) throw new ArrayIndexOutOfBoundsException();
public synchronized int read(byte[] b, int off, int len) throws IOException { if (off < 0 || len < 0 || off + len > b.length) throw new ArrayIndexOutOfBoundsException(); if (pos >= count && !refill()) return -1; // No bytes were read before EOF. int remain = Math.min(count - pos, len); System....
return -1; int remain = Math.min(count - pos, len); System.arraycopy(buf, pos, b, off, remain); pos += remain;
return -1;
public synchronized int read(byte[] b, int off, int len) throws IOException { if (off < 0 || len < 0 || off + len > b.length) throw new ArrayIndexOutOfBoundsException(); if (pos >= count && !refill()) return -1; // No bytes were read before EOF. int remain = Math.min(count - pos, len); System....
return remain;
return ((int) buf[pos++]) & 0xFF;
public synchronized int read(byte[] b, int off, int len) throws IOException { if (off < 0 || len < 0 || off + len > b.length) throw new ArrayIndexOutOfBoundsException(); if (pos >= count && !refill()) return -1; // No bytes were read before EOF. int remain = Math.min(count - pos, len); System....
private boolean refill() throws IOException
boolean refill() throws IOException
private boolean refill() throws IOException { if (markpos < 0) count = pos = 0; else if (markpos > 0) { // Shift the marked bytes (if any) to the beginning of the array // but don't grow it. This saves space in case a reset is done // before we reach the max capacity of this array. Sys...
drawable.setGL(new DebugGL(drawable.getGL()));
if (!(drawable.getGL() instanceof DebugGL)) { drawable.setGL(new DebugGL(drawable.getGL())); }
public void init(GLDrawable drawable) { drawable.setGL(new DebugGL(drawable.getGL())); GL gl = drawable.getGL(); float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f }; gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos); gl.glEnable(GL.GL_CULL_FACE); gl.glEnable(GL.GL_LIGHTING); gl.glEnable(GL.GL...
public Transition addTransition(Node destination, Guard guard, String description)
void addTransition(Transition transition)
public Transition addTransition(Node destination, Guard guard, String description) { Transition transition = new Transition( this, destination, ...
Transition transition = new Transition( this, destination, guard, description ); addTransition( transition ); return transition;
this.transitions.add( transition );
public Transition addTransition(Node destination, Guard guard, String description) { Transition transition = new Transition( this, destination, ...
AbstractButton(String text, Icon icon)
AbstractButton()
AbstractButton(String text, Icon icon) { this.text = text; setIcon(icon); setAlignmentX(LEFT_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); addFocusListener( new JFocusListener(this) ); setModel(new DefaultButtonModel(this)); updateUI(); // get a proper ui }
this.text = text; setIcon(icon); setAlignmentX(LEFT_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); addFocusListener( new JFocusListener(this) ); setModel(new DefaultButtonModel(this)); updateUI();
this("",null);
AbstractButton(String text, Icon icon) { this.text = text; setIcon(icon); setAlignmentX(LEFT_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); addFocusListener( new JFocusListener(this) ); setModel(new DefaultButtonModel(this)); updateUI(); // get a proper ui }
"if (document.cookie.indexOf(\"session=on\") == -1){\n"+ "sessionCookies = false\n"+ " \n}"+ " var exp = new Date()\n"+
"if (document.cookie.indexOf(\"session=on\") == -1) {\n"+ " sessionCookies = false\n"+ "}"+ "var exp = new Date()\n"+
public String string1() { return "<script LANGUAGE=\"JavaScript\">\n"+ "<!--\n"+ "if (top.frames.length != 0) {\n"+ " top.location = self.document.location\n"+ "}\n"+ "var sessionCookies = true\n"+ "var persistentCookies = true\n"+ "document.cookie = \"sessi...
"if ( !persistentCookies || !persistentCookies ) {\n"+ "document.write(\"";
"if (" + ( negate() ? "sessionCookies && persistentCookies" : "!sessionCookies || !persistentCookies") + " ) {\n" + " document.write(\"";
public String string1() { return "<script LANGUAGE=\"JavaScript\">\n"+ "<!--\n"+ "if (top.frames.length != 0) {\n"+ " top.location = self.document.location\n"+ "}\n"+ "var sessionCookies = true\n"+ "var persistentCookies = true\n"+ "document.cookie = \"sessi...
String clause = assembleJoinClause(leftName, rightName, semantic);
JoinClause clause = createJoinClause(leftName, rightName, semantic);
public void addJoinClause(String leftName, String rightName, int semantic) { String clause = assembleJoinClause(leftName, rightName, semantic); _alreadyJoined.insertObjectAtIndex(clause, 0); }
public String assembleJoinClause(String leftName, String rightName, int semantic) { StringBuffer sb = new StringBuffer(); String leftAlias = leftName.substring(0, leftName.indexOf(".")); String rightAlias = rightName.substring(0, rightName.indexOf(".")); String leftCol = leftName.substring(leftName.indexOf(".") + 1); ...
public String assembleJoinClause(String leftName, String rightName, int semantic) { return createJoinClause(leftName, rightName, semantic).toString();
public String assembleJoinClause(String leftName, String rightName, int semantic) { StringBuffer sb = new StringBuffer(); String leftAlias = leftName.substring(0, leftName.indexOf(".")); String rightAlias = rightName.substr...
throw new IllegalArgumentException("relationship " + k + " relationship was null");
if (ent.anyAttributeNamed(k) != null) { break; } throw new IllegalArgumentException("relationship " + keyPath + " generated null");
private EOEntity entityForKeyPath(String keyPath) { NSArray keys = NSArray.componentsSeparatedByString(keyPath, "."); EOEntity ent = entity(); for (int i = 0; i < keys.count(); i++) { String k = (String)keys.objectAtIndex(i); EORelationship rel = ent.anyRelationshipNamed(k...
if (seenIt.objectForKey(jc.table1) == null && seenIt.objectForKey(jc.table2) == null) {
if (!seenTable1 && !seenTable2) {
public String joinClauseString() { NSMutableDictionary seenIt = new NSMutableDictionary(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < _alreadyJoined.count(); i++) { JoinClause jc = (JoinClause)_alreadyJoined.objectAtIndex(i); if (seenIt.objectForKey(jc.table...
} else if (seenIt.objectForKey(jc.table1) == null) {
} else if (!seenTable2) {
public String joinClauseString() { NSMutableDictionary seenIt = new NSMutableDictionary(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < _alreadyJoined.count(); i++) { JoinClause jc = (JoinClause)_alreadyJoined.objectAtIndex(i); if (seenIt.objectForKey(jc.table...
optionsCreate.setObjectForKey("YES", "DropTablesKey"); optionsCreate.setObjectForKey("YES", "DropPrimaryKeySupportKey"); optionsCreate.setObjectForKey("YES", "CreateTablesKey"); optionsCreate.setObjectForKey("YES", "CreatePrimaryKeySupportKey"); optionsCreate.setObjectForKey("YES", "PrimaryKeyConstraintsKey"); optionsC...
optionsCreate.setObjectForKey("YES", EOSchemaGeneration.DropTablesKey); optionsCreate.setObjectForKey("YES", EOSchemaGeneration.DropPrimaryKeySupportKey); optionsCreate.setObjectForKey("YES", EOSchemaGeneration.CreateTablesKey); optionsCreate.setObjectForKey("YES", EOSchemaGeneration.CreatePrimaryKeySupportKey); option...
public static String createSchemaSQLForEntitiesInModelWithName(NSArray entities, String modelName) { NSMutableDictionary optionsCreate = new NSMutableDictionary(); optionsCreate.setObjectForKey("YES", "DropTablesKey"); optionsCreate.setObjectForKey("YES", "DropPrimaryKeySupportKey"); opt...
convertedValue = ERXSimpleTemplateParser.sharedInstance().parseTemplateWithObject(convertedValue, "@@", sharedInstance, WOApplication.application());
convertedValue = new ERXSimpleTemplateParser("ERXSystem:KEY_NOT_FOUND").parseTemplateWithObject(convertedValue, "@@", sharedInstance, WOApplication.application());
public static String getProperty(String key) { String oriValue = (String) sharedInstance.valueForKey(key); String convertedValue = oriValue; String lastConvertedValue = null; while (convertedValue != lastConvertedValue && convertedValue.indexOf("@@") > -1) { lastConvertedValue...
if (convertedValue.indexOf("ERXSystem:KEY_NOT_FOUND") > -1) return oriValue;
public static String getProperty(String key) { String oriValue = (String) sharedInstance.valueForKey(key); String convertedValue = oriValue; String lastConvertedValue = null; while (convertedValue != lastConvertedValue && convertedValue.indexOf("@@") > -1) { lastConvertedValue...
if (idx == -1) file = file + "!" + url_string; else file = file.substring (0, idx + 1) + url_string;
if (idx < 0) throw new URLParseError("no !/ in spec"); file = file.substring (0, idx + 1) + url_string;
protected void parseURL (URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. String file = url.getFile(); if (file != null && file ...
file = file + "/" + url_string;
file = file.substring(0, idx + 1) + url_string;
protected void parseURL (URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. String file = url.getFile(); if (file != null && file ...
return;
throw new URLParseError("unexpected protocol " + url.getProtocol());
protected void parseURL (URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. String file = url.getFile(); if (file != null && file ...
if (url.getProtocol().equals("file")) { try { boolean endsWithSlash = file.charAt(file.length() - 1) == '/'; file = new File(file).getCanonicalPath(); file = file.replace(separator, '/'); if (endsWithSlash && file.charAt(file.length() - 1) != '/') file += '/'; } catch (IOException e) { } }
file = canonicalizeFilename(file);
protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); String userInfo = url.getUserInfo(); String authority = url.getAuthority(); String query = null; // On Windows...
if (newValue instanceof BigDecimal && !isDecimalNumber() && attribute().valueType().equals("i")) {
if (newValue instanceof BigDecimal && !isDecimalNumber() && attribute().valueType() != null && attribute().valueType().equals("i")) {
public Object convertNumber(Object anObject) { Number newValue=null; if (anObject!=null && anObject instanceof Number) { newValue=(Number)anObject; if (newValue instanceof BigDecimal && !isDecimalNumber() && attribute().valueType().equals("i")) { // we are getting ...
public void setTarget(ClassVisitor target) {
public void setTarget(ClassVisitor target, ClassVisitor outer) {
public void setTarget(ClassVisitor target) { cv = target; }
public TestKeyFactory(java.lang.String testName) {
public TestKeyFactory(String testName) {
public TestKeyFactory(java.lang.String testName) { super(testName); }
log.error("StripChartSource: " + e);
log.error("StripChartSource: ", e);
public void run() { if(log.isDebugEnabled()) { log.debug("Running...."); } while (true) { try { Thread.sleep(1000); addValue((System.currentTimeMillis() % 100)*.01, System.currentTimeMillis()); } catch (Exception e) { if(log.isErrorEnabled()) { log.error("StripChartSour...
protected Calendar(TimeZone zone, Locale locale)
protected Calendar()
protected Calendar(TimeZone zone, Locale locale) { this.zone = zone; lenient = true; ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale); firstDayOfWeek = ((Integer) rb.getObject("firstDayOfWeek")).intValue(); minimalDaysInFirstWeek = ((Integer) rb.getObject("minimalDaysInFirstWeek")...
this.zone = zone; lenient = true; ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale); firstDayOfWeek = ((Integer) rb.getObject("firstDayOfWeek")).intValue(); minimalDaysInFirstWeek = ((Integer) rb.getObject("minimalDaysInFirstWeek")).intValue();
this(TimeZone.getDefault(), Locale.getDefault());
protected Calendar(TimeZone zone, Locale locale) { this.zone = zone; lenient = true; ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale); firstDayOfWeek = ((Integer) rb.getObject("firstDayOfWeek")).intValue(); minimalDaysInFirstWeek = ((Integer) rb.getObject("minimalDaysInFirstWeek")...
protected void setTimeInMillis(long time)
public void setTimeInMillis(long time)
protected void setTimeInMillis(long time) { this.time = time; isTimeSet = true; computeFields(); }
public final void set(int year, int month, int date)
public final void set(int field, int value)
public final void set(int year, int month, int date) { isTimeSet = false; fields[YEAR] = year; fields[MONTH] = month; fields[DATE] = date; isSet[YEAR] = isSet[MONTH] = isSet[DATE] = true; isSet[WEEK_OF_YEAR] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WE...
fields[YEAR] = year; fields[MONTH] = month; fields[DATE] = date; isSet[YEAR] = isSet[MONTH] = isSet[DATE] = true; isSet[WEEK_OF_YEAR] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false;
fields[field] = value; isSet[field] = true; switch (field) { case YEAR: case MONTH: case DATE: isSet[WEEK_OF_YEAR] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; break; case AM_PM: isSet[HOUR_OF_DAY] = false; break; case HOUR_OF_DAY: i...
public final void set(int year, int month, int date) { isTimeSet = false; fields[YEAR] = year; fields[MONTH] = month; fields[DATE] = date; isSet[YEAR] = isSet[MONTH] = isSet[DATE] = true; isSet[WEEK_OF_YEAR] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WE...
object=(EOEnterpriseObject)super.valueForBinding("object");
object=(EOEnterpriseObject)valueForBinding(Keys.object);
public EOEnterpriseObject object() { if (object==null && !synchronizesVariablesWithBindings()) object=(EOEnterpriseObject)super.valueForBinding("object"); return object; }
public boolean permissionToEdit() { return hasBinding("permissionToEdit") ? booleanForBinding("permissionToEdit") : true; }
public boolean permissionToEdit() { return hasBinding(Keys.permissionToEdit) ? booleanValueForBinding(Keys.permissionToEdit) : true; }
public boolean permissionToEdit() { return hasBinding("permissionToEdit") ? booleanForBinding("permissionToEdit") : true; }
extraBindings = null; key = null;
public void reset() { super.reset(); extraBindings = null; key = null; object = null; d2wContext = null; }
d2wContext = null;
editingContext = null;
public void reset() { super.reset(); extraBindings = null; key = null; object = null; d2wContext = null; }
gtkWidgetSetBackground (c.getRed(), c.getGreen(), c.getBlue());
public void setBackground (Color c) { // System.out.println ("setBackground [UNIMPLEMENTED"); }
gtkWidgetSetForeground (c.getRed(), c.getGreen(), c.getBlue());
public void setForeground (Color c) { // System.out.println ("setForeground [UNIMPLEMENTED"); }
source.addConsumer (this);
if (source != null) source.addConsumer (this);
GtkImage (ImageProducer producer, Graphics g) { source = producer; this.g = g; source.addConsumer (this); }
public abstract Toolkit getToolkit ();
Toolkit getToolkit();
public abstract Toolkit getToolkit ();
public FocusEvent (Component source, int id, boolean temporary)
public FocusEvent (Component source, int id)
public FocusEvent (Component source, int id, boolean temporary) { super (source, id); this.temporary = temporary; }
this.temporary = temporary;
this.temporary = false;
public FocusEvent (Component source, int id, boolean temporary) { super (source, id); this.temporary = temporary; }
public void setBounds (int x, int y, int w, int h);
void setBounds(int x, int y, int width, int height);
public void setBounds (int x, int y, int w, int h);
return ERXUtilities.booleanValue(objectPropertyValue());
return ERXValueUtilities.booleanValue(objectPropertyValue());
public boolean isYes() { return ERXUtilities.booleanValue(objectPropertyValue()); }
((DefaultListModel)list_ress.getModel()).addElement(o[i]);
if(((Ressource)o[i]).getType().equals(type_ress.getSelectedItem())){ ((DefaultListModel)list_ress.getModel()).addElement(o[i]); }
private JButton noselect(){ JButton noselect=new JButton("<"); noselect.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { Object[] o=select_ress.getSelectedValues(); for (int i=0;i<o.length;++i){ Collection coll=(Collection) ress_found.get(((Ressource)o[i]).get...
((DefaultListModel)list_ress.getModel()).addElement(o[i]);
if(((Ressource)o[i]).getType().equals(type_ress.getSelectedItem())){ ((DefaultListModel)list_ress.getModel()).addElement(o[i]); }
public void actionPerformed(ActionEvent e) { Object[] o=select_ress.getSelectedValues(); for (int i=0;i<o.length;++i){ Collection coll=(Collection) ress_found.get(((Ressource)o[i]).getType()); ((DefaultListModel)select_ress.getModel()).removeElement(o[i]); coll.add(o[i]); ((DefaultListModel)lis...
if (containerListener != null) containerListener.componentAdded (ce);
protected void addImpl (Component comp, Object constraints, int index) { if (index > ncomponents || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf (this))) throw new IllegalArgumentException (); // Reparent component, and make sure component is instantiated if ...
if (containerListener != null) containerListener.componentAdded (ce);
public void remove (int index) { Component r = component[index]; r.removeNotify (); System.arraycopy (component, index + 1, component, index, ncomponents - index - 1); component[--ncomponents] = null; invalidate (); if (layoutMgr != null) layoutMgr.removeLayoutComponent (r); Containe...
public ContainerEvent (Container source, int id, Component child)
public ContainerEvent (Component source, int id, Component child)
public ContainerEvent (Container source, int id, Component child) { super (source, id); this.child = child; }
if(log.isDebugEnabled()) {
if(log.isErrorEnabled()) {
public void execute() { if (infEventSub.hasChanged()) { // for each new task for (Enumeration en = infEventSub.getAddedList(); en.hasMoreElements(); ) { InfrastructureEvent ie = (InfrastructureEvent)en.nextElement(); if (log.isDebugEnabled()) { log.debug("handli...
chain.setIvy(_ivy);
public void testName() throws Exception { ChainResolver chain = new ChainResolver(); chain.setName("chain"); assertEquals("chain", chain.getName()); }
chain.setIvy(_ivy);
public void testResolveOrder() throws Exception { ChainResolver chain = new ChainResolver(); MockResolver[] resolvers = new MockResolver[] { MockResolver.buildMockResolver("1", false, null), MockResolver.buildMockResolver("2", true, null), MockResolver.bu...
chain.setIvy(_ivy);
public void testReturnFirst() throws Exception { ChainResolver chain = new ChainResolver(); chain.setReturnFirst(true); MockResolver[] resolvers = new MockResolver[] { MockResolver.buildMockResolver("1", true, new GregorianCalendar(2005, 1, 20).getTime()), MockRes...
final MockResolver r = new MockResolver(); r.setName(name); if (findRevision) { r.rmr = new ResolvedModuleRevision() { public DependencyResolver getResolver() { return r; } public ModuleRevisionId getId() { return null; } public Date getPublicationDate() { return publicationDate; } public ModuleDescriptor getDescrip...
return buildMockResolver(name, findRevision, null, publicationDate);
static MockResolver buildMockResolver(String name, boolean findRevision, final Date publicationDate) { final MockResolver r = new MockResolver(); r.setName(name); if (findRevision) { r.rmr = new ResolvedModuleRevision() { public DependencyResolver getResolver() { ...
ResolvedModuleRevision mr = resolver.getDependency(dd, data);
LatestStrategy oldLatest = setLatestIfRequired(resolver, getLatestStrategy()); ResolvedModuleRevision mr = null; try { mr = resolver.getDependency(dd, data); } finally { if (oldLatest != null) { setLatest(resolver, oldLatest); } }
public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) throws ParseException { data = new ResolveData(data, doValidate(data)); ResolvedModuleRevision ret = null; for (Iterator iter = _chain.iterator(); iter.hasNext();) { DependencyResolver reso...
if (ret == null || mr.getPublicationDate().after(ret.getPublicationDate())) {
if (ret == null || isAfter(mr, ret, data.getDate())) {
public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) throws ParseException { data = new ResolveData(data, doValidate(data)); ResolvedModuleRevision ret = null; for (Iterator iter = _chain.iterator(); iter.hasNext();) { DependencyResolver reso...
String uniqueNodeName,
public NodeCreationInfo(RemoteHost remoteAppServer, String uniqueNodeName, Properties properties, java.util.List args, OutputListener listener, OutputPolicy outputPolicy, ...
NodeComponent nodeComponent,
public NodeCreationInfo(RemoteHost remoteAppServer, String uniqueNodeName, Properties properties, java.util.List args, OutputListener listener, OutputPolicy outputPolicy, ...
this.uniqueNodeName = uniqueNodeName;
public NodeCreationInfo(RemoteHost remoteAppServer, String uniqueNodeName, Properties properties, java.util.List args, OutputListener listener, OutputPolicy outputPolicy, ...
this.nodeComponent = nodeComponent;
public NodeCreationInfo(RemoteHost remoteAppServer, String uniqueNodeName, Properties properties, java.util.List args, OutputListener listener, OutputPolicy outputPolicy, ...
NodeComponent node = frame.getNodeComponent(); String nodeName = node.getShortName();
String nodeName = frame.getNodeName();
private void frameSelected(InternalFrameEvent e) { ConsoleInternalFrame frame = (ConsoleInternalFrame)e.getInternalFrame(); NodeComponent node = frame.getNodeComponent(); String nodeName = node.getShortName(); selectStatusButton(nodeName); selectNodeInHostTree(nodeName); }
experiment.setRunInProgress(true);
public CSMARTConsole(CSMART csmart, Experiment experiment) { this.csmart = csmart; this.experiment = experiment; console = this; experiment.setRunInProgress(true); currentTrial = -1; societyComponent = experiment.getSocietyComponent(); desktop = new ConsoleDesktop(); setSocietyComponent(societ...
societyComponent = experiment.getSocietyComponent(); desktop = new ConsoleDesktop(); setSocietyComponent(societyComponent);
remoteHostRegistry = RemoteHostRegistry.getInstance(); runningNodes = new Hashtable(); oldNodes = new ArrayList(); nodeListeners = new Hashtable(); nodePanes = new Hashtable(); nodeToNodeInfo = new Hashtable();
public CSMARTConsole(CSMART csmart, Experiment experiment) { this.csmart = csmart; this.experiment = experiment; console = this; experiment.setRunInProgress(true); currentTrial = -1; societyComponent = experiment.getSocietyComponent(); desktop = new ConsoleDesktop(); setSocietyComponent(societ...
initGui();
public CSMARTConsole(CSMART csmart, Experiment experiment) { this.csmart = csmart; this.experiment = experiment; console = this; experiment.setRunInProgress(true); currentTrial = -1; societyComponent = experiment.getSocietyComponent(); desktop = new ConsoleDesktop(); setSocietyComponent(societ...
String procName = experiment.getExperimentName() + "-" + nci.uniqueNodeName;
String experimentName = ""; if (experiment != null) experimentName = experiment.getExperimentName(); String procName = experimentName + "-" + nci.nodeName;
private void createNodes() { int delay = 1; // get inter-node start delay String tmp = Parameters.findParameter("org.cougaar.tools.csmart.startdelay"); if (tmp != null) { try { delay = Integer.parseInt(tmp); } catch (NumberFormatException nfe) { } } final int interNodeStar...
runningNodes.put(nci.nodeComponent, remoteNode);
runningNodes.put(nci.nodeName, remoteNode);
private void createNodes() { int delay = 1; // get inter-node start delay String tmp = Parameters.findParameter("org.cougaar.tools.csmart.startdelay"); if (tmp != null) { try { delay = Integer.parseInt(tmp); } catch (NumberFormatException nfe) { } } final int interNodeStar...
desktop.addNodeFrame(nci.nodeComponent, (ConsoleNodeListener)nci.listener, new NodeFrameListener(), nci.scrollPane, nci.statusButton, nci.logFileName, remoteNode, console); updateExperimentControls(experiment, true);
ConsoleInternalFrame frame = new ConsoleInternalFrame(nci.nodeName, nci.hostName, nci.properties, nci.args, (ConsoleNodeListener)nci.listener, nci.scrollPane, nci.statusButton, nci.logFileName, remoteNode, console); frame.addInternalFrameListener(new NodeFrameListener()); desktop.addNodeFrame(frame, nci.nodeName); upda...
private void createNodes() { int delay = 1; // get inter-node start delay String tmp = Parameters.findParameter("org.cougaar.tools.csmart.startdelay"); if (tmp != null) { try { delay = Integer.parseInt(tmp); } catch (NumberFormatException nfe) { } } final int interNodeStar...
if (nodeCreator == null) return; addStatusButton(nci.statusButton); desktop.addNodeFrame(nci.nodeComponent, (ConsoleNodeListener)nci.listener, new NodeFrameListener(), nci.scrollPane, nci.statusButton, nci.logFileName, remoteNode, console); updateExperimentControls(experiment, true); }
JInternalFrame jif = new JInternalFrame("GLS", true, false, true, true); glsClient = new GLSClient(getOPlanAgentURL(glsAgent)); jif.getContentPane().add(glsClient); jif.setSize(350, 350); jif.setLocation(0, 0); jif.setVisible(true); desktop.add(jif, JLayeredPane.DEFAULT_LAYER); try { jif.setIcon(true); } catch (Propert...
public void run() { // don't create gui controls if node creation has been stopped if (nodeCreator == null) return; addStatusButton(nci.statusButton); desktop.addNodeFrame(nci.nodeComponent, (ConsoleNodeListener)nci.listener, ...
Iterator nodeComponents = oldNodes.iterator(); while (nodeComponents.hasNext()) { NodeComponent nodeComponent = (NodeComponent)nodeComponents.next(); String nodeName = nodeComponent.getShortName();
Iterator nodeNames = oldNodes.iterator(); while (nodeNames.hasNext()) { String nodeName = (String)nodeNames.next();
private void destroyOldNodes() { Iterator nodeComponents = oldNodes.iterator(); while (nodeComponents.hasNext()) { NodeComponent nodeComponent = (NodeComponent)nodeComponents.next(); String nodeName = nodeComponent.getShortName(); removeStatusButton(nodeName); } oldNodes.clear(); nodeLis...
updateExperimentControls(experiment, false); experiment.setRunInProgress(false);
updateControls(false); if (experiment != null) experiment.setRunInProgress(false);
private void exitMenuItem_actionPerformed(AWTEvent e) { stopExperiments(); updateExperimentControls(experiment, false); // updateExperimentEditability(); experiment.setRunInProgress(false); // If this was this frame's exit menu item, we have to remove // the window from the list // if it was a...
trialProgressBar.setValue(experiment.getTrialCount() + 1); updateExperimentControls(experiment, false);
if (experiment != null) trialProgressBar.setValue(experiment.getTrialCount() + 1); updateControls(false);
private void experimentFinished() { trialProgressBar.setValue(experiment.getTrialCount() + 1); updateExperimentControls(experiment, false); // runButton.setEnabled(false); runButton.setSelected(false); // allow user to run experiment again runButton.setEnabled(true); // reset trial counter ...
if (experiment == null) return null;
private String findServlet() { ArrayList componentData = new ArrayList(); ComponentData societyData = experiment.getSocietyComponentData(); ComponentData[] cdata = societyData.getChildren(); for (int i = 0; i < cdata.length; i++) componentData.add(cdata[i]); for (int i = 0; i < componentData.size...
private String getLogFileName(String agentName) { String filename = agentName + fileDateFormat.format(runStart) + ".log"; File resultDir = experiment.getResultDirectory(); if (resultDir == null) return filename; Trial trial = experiment.getTrials()[currentTrial]; String dirname = resultDir.getAbsolutePath() + File.sep...
private String getLogFileName(String nodeName) { String filename = nodeName + fileDateFormat.format(runStart) + ".log"; String dirname = makeResultDirectory(); if (dirname == null)
private String getLogFileName(String agentName) { String filename = agentName + fileDateFormat.format(runStart) + ".log"; File resultDir = experiment.getResultDirectory(); // if user didn't specify results directory, save in local directory if (resultDir == null) return filename; Trial trial = ex...
} return dirname + File.separatorChar + filename;
else return dirname + File.separatorChar + filename;
private String getLogFileName(String agentName) { String filename = agentName + fileDateFormat.format(runStart) + ".log"; File resultDir = experiment.getResultDirectory(); // if user didn't specify results directory, save in local directory if (resultDir == null) return filename; Trial trial = ex...
return currentTrial < (experiment.getTrialCount()-1);
if (experiment == null) return false; else return currentTrial < (experiment.getTrialCount()-1);
private boolean haveMoreTrials() { return currentTrial < (experiment.getTrialCount()-1); }
HostComponent[] hosts = experiment.getHostComponents(); for (int i = 0; i < hosts.length; i++) { NodeComponent[] nodes = hosts[i].getNodes(); if (nodes != null && nodes.length > 0) { for (int j = 0; j < nodes.length; j++) { AgentComponent[] agents = nodes[j].getAgents(); if (agents != null && agents.length > 0) { runBu...
if (experiment != null) { HostComponent[] hosts = experiment.getHostComponents(); for (int i = 0; i < hosts.length; i++) { NodeComponent[] nodes = hosts[i].getNodes(); if (nodes != null && nodes.length > 0) { for (int j = 0; j < nodes.length; j++) { AgentComponent[] agents = nodes[j].getAgents(); if (agents != null && ...
private void initRunButton() { HostComponent[] hosts = experiment.getHostComponents(); for (int i = 0; i < hosts.length; i++) { NodeComponent[] nodes = hosts[i].getNodes(); if (nodes != null && nodes.length > 0) { for (int j = 0; j < nodes.length; j++) { AgentComponent[] agents = nodes[j].getAgents(...
if (experiment == null) return new ResultsFileFilter().accept(thisFile);
private boolean isResultFile(String filename) { File thisFile = new java.io.File(filename); SocietyComponent societyComponent = experiment.getSocietyComponent(); if (societyComponent != null) { java.io.FileFilter fileFilter = societyComponent.getResultFileFilter(); if(fileFilter != null && fileFilt...
public void nodeStopped(NodeComponent nodeComponent) {
public void nodeStopped(String nodeName) {
public void nodeStopped(NodeComponent nodeComponent) { synchronized (runningNodesLock) { if (runningNodes.get(nodeComponent) != null) { oldNodes.add(nodeComponent); runningNodes.remove(nodeComponent); } } // end synchronized // enable restart command on node output window, only if we'...
if (runningNodes.get(nodeComponent) != null) { oldNodes.add(nodeComponent); runningNodes.remove(nodeComponent);
if (runningNodes.get(nodeName) != null) { oldNodes.add(nodeName); runningNodes.remove(nodeName);
public void nodeStopped(NodeComponent nodeComponent) { synchronized (runningNodesLock) { if (runningNodes.get(nodeComponent) != null) { oldNodes.add(nodeComponent); runningNodes.remove(nodeComponent); } } // end synchronized // enable restart command on node output window, only if we'...
desktop.getNodeFrame(nodeComponent.getShortName());
desktop.getNodeFrame(nodeName);
public void nodeStopped(NodeComponent nodeComponent) { synchronized (runningNodesLock) { if (runningNodes.get(nodeComponent) != null) { oldNodes.add(nodeComponent); runningNodes.remove(nodeComponent); } } // end synchronized // enable restart command on node output window, only if we'...
public RemoteProcess restartNode(NodeComponent nodeComponent) {
public RemoteProcess restartNode(String nodeName) { NodeInfo nodeInfo = (NodeInfo)nodeToNodeInfo.get(nodeName); String hostName = nodeInfo.hostName; Properties properties = nodeInfo.properties; java.util.List args = nodeInfo.args;
public RemoteProcess restartNode(NodeComponent nodeComponent) { boolean doRun = false; synchronized (runningNodes) { if (oldNodes.size() + runningNodes.size() == 1) doRun = true; } // end synchronized if (doRun) { runButton_actionPerformed(); return null; // it doesn't matter what we...
RemoteHost remoteAppServer = null; String hostName = null; 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++) { if (nodes[j].equals(nodeComponent)) { hostName = hosts[i].getShortName(); bre...
public RemoteProcess restartNode(NodeComponent nodeComponent) { boolean doRun = false; synchronized (runningNodes) { if (oldNodes.size() + runningNodes.size() == 1) doRun = true; } // end synchronized if (doRun) { runButton_actionPerformed(); return null; // it doesn't matter what we...
java.util.List args = getNodeArguments(nodeComponent);
public RemoteProcess restartNode(NodeComponent nodeComponent) { boolean doRun = false; synchronized (runningNodes) { if (oldNodes.size() + runningNodes.size() == 1) doRun = true; } // end synchronized if (doRun) { runButton_actionPerformed(); return null; // it doesn't matter what we...
try { remoteAppServer = remoteHostRegistry.lookupRemoteHost( hostName, remotePort, true); } catch (Exception e) { if(log.isErrorEnabled()) { log.error("Exception getting Host Server", e); }
RemoteHost remoteAppServer = getAppServer(hostName, remotePort); if (remoteAppServer == null)
public RemoteProcess restartNode(NodeComponent nodeComponent) { boolean doRun = false; synchronized (runningNodes) { if (oldNodes.size() + runningNodes.size() == 1) doRun = true; } // end synchronized if (doRun) { runButton_actionPerformed(); return null; // it doesn't matter what we...
}
public RemoteProcess restartNode(NodeComponent nodeComponent) { boolean doRun = false; synchronized (runningNodes) { if (oldNodes.size() + runningNodes.size() == 1) doRun = true; } // end synchronized if (doRun) { runButton_actionPerformed(); return null; // it doesn't matter what we...
String nodeName = nodeComponent.getShortName();
public RemoteProcess restartNode(NodeComponent nodeComponent) { boolean doRun = false; synchronized (runningNodes) { if (oldNodes.size() + runningNodes.size() == 1) doRun = true; } // end synchronized if (doRun) { runButton_actionPerformed(); return null; // it doesn't matter what we...
nodeComponent,
nodeName,
public RemoteProcess restartNode(NodeComponent nodeComponent) { boolean doRun = false; synchronized (runningNodes) { if (oldNodes.size() + runningNodes.size() == 1) doRun = true; } // end synchronized if (doRun) { runButton_actionPerformed(); return null; // it doesn't matter what we...
String procName = experiment.getExperimentName() + "-" + nodeName;
String experimentName = ""; if (experiment != null) experimentName = experiment.getExperimentName(); String procName = experimentName + "-" + nodeName;
public RemoteProcess restartNode(NodeComponent nodeComponent) { boolean doRun = false; synchronized (runningNodes) { if (oldNodes.size() + runningNodes.size() == 1) doRun = true; } // end synchronized if (doRun) { runButton_actionPerformed(); return null; // it doesn't matter what we...