public void attachToModel(ScuflModel theModel) { if (theModel != null) { theModel.addListener(this); } }
/** * */ public OfflineToggleModel(ScuflModel model) { super(); this.model = model; this.model.addListener(this); }
public void attachToModel(ScuflModel theModel) { if (theModel != null) { theModel.addListener(this); } }
public void attachToModel(ScuflModel theModel) { theModel.addListener(this); }
/** * Attach a listener to the contained workflow instance which will set the * location string to null, indicating that the original workflow (if any) * has been changed, effectively performing a copy on write style caching. */ private void createListener() { if (eventListener==null) { eventListener=new ScuflModelEventListener() { 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) { // } } }; } theInternalModel.addListener(eventListener); }
public void modelCreated(String modelName, Object model) { ScuflModel workflow = (ScuflModel) model; workflow.addListener(listener); setWorkflow(workflow); }
public void modelAdded(final ScuflModel workflow) { ChangedModelListener listener = new ChangedModelListener(workflow); listeners.put(workflow, listener); workflow.addListener(listener); synced(workflow); // initially unchanged }
public void modelChanged(String modelName, Object oldModel, Object newModel) { ScuflModel oldWorkflow = (ScuflModel) oldModel; ScuflModel newWorkflow = (ScuflModel) newModel; oldWorkflow.removeListener(listener); newWorkflow.addListener(listener); setWorkflow(newWorkflow); }
/** * @param model */ public ScuflModelReconciler(ScuflGraphModel model) { this.model = model; model.getModel().addListener(this); events.add(new ScuflModelEvent(model.getModel(), "Woo")); reconciler.start(); }
public static void main(String[] args) throws Exception { System.out.println("Starting test : SoaplabProcessorCreation"); // Create a new ScuflModel ScuflModel model = new ScuflModel(); // Register a listener to print to stdout model.addListener(new ScuflModelEventPrinter(null)); // Attempt to create a new SoaplabProcessor model.addProcessor(new SoaplabProcessor(model, "my_processor", "http://industry.ebi.ac.uk/soap/soaplab/nucleic_gene_finding::getorf")); System.out.println("Finished test : SoaplabProcessorCreation"); }
public void attachToModel(ScuflModel model) { if (this.scuflModel!=null) { logger.warn("Did not detachFromModel() before attachToModel()"); detachFromModel(); } if (! initialised) { initialise(populate()); initialised = true; } this.scuflModel = model; tree.attachToModel(model); model.addListener(eventListener); }
public void attachToModel(ScuflModel model) { if (!initialized) { init(); } if (this.model == model) { return; } if (this.model != null) { logger.warn("Didn't call detachFromModel() before attachToModel()"); detachFromModel(); } this.model = model; model.addListener(this); updateModel(); setVisible(true); }
public void testNotifyThread() { ScuflModel model = new ScuflModel(); assertNull("notify thread should be null",model.notifyThread); ScuflModelEventListener listener = new ScuflModelEventListener() { public void receiveModelEvent(ScuflModelEvent event) { } }; model.addListener(listener); assertNotNull("notify thread should not be null",model.notifyThread); model.removeListener(listener); assertNull("notify thread should be null",model.notifyThread); }
model.addListener(new ScuflModelEventListener() { public void receiveModelEvent(ScuflModelEvent event) { synchronized (events) {