/** * Set the string value for the string constant */ public void setStringValue(String theStringValue) { this.theStringValue = theStringValue; // Fire a model event fireModelEvent(new ScuflModelEvent(this, "String value changed to '"+theStringValue+"'")); }
public void receiveModelEvent(ScuflModelEvent event) { if (event.getEventType() == ScuflModelEvent.LOAD && ScavengerTreePanel.this.isWatchingLoads) { new Thread("Scavenger tree adding from model") { public void run() { try { ScavengerTreePanel.this.tree .addScavengersFromModel(); } catch (Exception ex) { // Ignore silently } } }.start(); } } };
public void receiveModelEvent(ScuflModelEvent event) { if (event.getSource() == model) { // Send ChangeEvent fireStateChanged(); // Send ItemEvent fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, this.isSelected() ? ItemEvent.SELECTED : ItemEvent.DESELECTED)); } } }
String getEvent(List<ScuflModelEvent> events, NotifyThread notifier) { // Poke the notifier (again!) so it can process some events and we don't have to wait notifier.interrupt(); ScuflModelEvent event; synchronized (events) { try { events.wait(1000); } catch (InterruptedException e) { // OK } if (events.size() == 0) { fail("Did not get any event"); } assertEquals("Too many events", 1, events.size()); event = events.get(0); events.remove(0); } return event.getMessage(); }
/** * Set the script */ public void setScript(String theScript) { if (theScript != null) { this.theScript = theScript; } else { this.theScript = ""; } fireModelEvent(new ScuflModelEvent(this, "Script modified")); }
/** * Set the script */ public void setScript(String theScript) { if (theScript != null) { this.theScript = theScript; } else { this.theScript = ""; } fireModelEvent(new ScuflModelEvent(this, "Script modified")); }
/** * Set the script */ public void setScript(String script) { if (script == null) { script = ""; } this.script = script; fireModelEvent(new ScuflModelEvent(this, "Script modified")); }
/** * Set the script * * @param newScript * the new script */ public void setScript(String script) { this.script = (script != null) ? script : ""; fireModelEvent(new ScuflModelEvent(this, "Script modified")); }
public void actionPerformed(ActionEvent a) { // Swap this alternate with the one one lower in the // list List theList = parentProcessor.getAlternatesList(); Object o = theList.get(alternateIndex); theList.remove(o); theList.add(alternateIndex + 1, o); parentProcessor.fireModelEvent(new ScuflModelEvent(parentProcessor, "Alternates reordered")); } });
public void actionPerformed(ActionEvent a) { // Swap this alternate with the one one lower in the // list List theList = parentProcessor.getAlternatesList(); Object o = theList.get(alternateIndex); theList.remove(o); theList.add(alternateIndex - 1, o); parentProcessor.fireModelEvent(new ScuflModelEvent(parentProcessor, "Alternates reordered")); } });
public void receiveModelEvent(ScuflModelEvent event) { definitionURL = null; try { if (buildPorts() == false) { // Only throw a new event up if nothing has changed in // the port // list, if something has been changed then the parent // workflow // will already have been kicked by the port creation or // destruction fireModelEvent(new ScuflModelEvent(WorkflowProcessor.this, "Underlying workflow changed")); } } catch (PortCreationException pce) { // } catch (DuplicatePortNameException dpne) { // } } };
/** * @param model */ public ScuflModelReconciler(ScuflGraphModel model) { this.model = model; model.getModel().addListener(this); events.add(new ScuflModelEvent(model.getModel(), "Woo")); reconciler.start(); }
/** * Set the endpoint for this biomoby processor */ void setEndpoint(String specifier) throws MalformedURLException, ProcessorCreationException { URL new_endpoint = new URL(specifier); if (this.endpoint != null) { if (!this.endpoint.equals(new_endpoint)) { fireModelEvent(new ScuflModelEvent(this, "Service endpoint changed to '" + specifier + "'")); } else { // Do nothing if the endpoint was the same as before return; } } else { fireModelEvent(new ScuflModelEvent(this, "Service endpoint set to '" + specifier + "'")); } this.endpoint = new_endpoint; try { generatePorts(); getDescriptionText(); } catch (PortCreationException e) { throw new ProcessorCreationException(formatError("When trying to create ports: " + e.getMessage())); } catch (DuplicatePortNameException e) { throw new ProcessorCreationException(formatError("When trying to create ports: " + e.getMessage())); } }
if (this.endpoint != null) { if (!this.endpoint.equals(new_endpoint)) { fireModelEvent(new ScuflModelEvent(this, "Object endpoint changed to '" + specifier + "'")); fireModelEvent(new ScuflModelEvent(this, "Object endpoint set to '" + specifier + "'"));
/** * @param showBoring */ public void setShowBoring(boolean showBoring) { if(this.showBoring != showBoring) { this.showBoring = showBoring; if(model != null) { ScuflGraphModelChange change = new ScuflGraphModelChange(this); change.addChanges(new ScuflModelEvent(model, "Changed show boring")); change.execute(); graphChanged(new GraphModelEvent(model, change)); } } }
/** * Set the endpoint for this soaplab processor */ void setEndpoint(String specifier) throws MalformedURLException, ProcessorCreationException { URL new_endpoint = new URL(specifier); if (endpoint != null) { if (endpoint.equals(new_endpoint) == false) { fireModelEvent(new ScuflModelEvent(this, "Service endpoint changed to '" + specifier + "'")); } else { // Do nothing if the endpoint was the same as before return; } } else { fireModelEvent(new ScuflModelEvent(this, "Service endpoint set to '" + specifier + "'")); } endpoint = new_endpoint; try { if (this.isOffline() == false) { generatePorts(); getDescriptionText(); } } catch (PortCreationException pce) { throw new ProcessorCreationException(getName() + ": Exception when trying to create ports\n from Soaplab endpoint : " + pce.getMessage()); } catch (DuplicatePortNameException dpne) { throw new ProcessorCreationException(getName() + ": Exception when trying to create ports\n from Soaplab endpoint : " + dpne.getMessage()); } }
model.getDescription().setTitle(new_name); name = model.getDescription().getTitle(); model.fireModelEvent(new org.embl.ebi.escience.scufl.ScuflModelEvent(this, "Title Changed")); } else {