/** * Unregister as listener with ScuflModelSet and known ScuflModels */ public void destroy() { ScuflModelSet.getInstance().removeListener(registerListener); reset(); }
/** * As for the method above but allows a non-ScuflUIComponent JComponent. * Internally this component is wrapped up in a trivial ScuflUIComponent * which entirely ignores the workflow model settings. */ public static void createFrame(JComponent rawComponent, int posX, int posY, int width, int height) { UIComponentSPI p = new WrapperFrame(rawComponent); createFrame(null, p, posX, posY, width, height); }
/** * Launches the address in a browser. Currently very crude. On Linux will open in firefox * and in Windows in IExplorer using an example taken from (http://www.javaworld.com/javaworld/javatips/jw-javatip66.html). * <br>Ultimately this should be done using BasicService of javaws.jnlp * e.g. BasicService.showDocument(address), but unable to do this at the moment due to licensing concerns with * the sun jnlp jar (we are not able to host it in a Maven repository). * * @param address to launch */ public static void launchBrowser(String address) { BrowserControl.displayURL(address); }
@Override protected ScuflModel getModel() { return (ScuflModel)ModelMap.getInstance().getNamedModel(ModelMap.CURRENT_WORKFLOW); } }
public void actionPerformed(ActionEvent e) { modelMap.setModel(ModelMap.CURRENT_PERSPECTIVE, perspective); } };
/** * Private constructor, use singleton pattern getInstance() instead. * <p> * Register as a listener with the ScuflModelSet. * @param workbench TODO */ private WorkflowChanges() { ScuflModelSet.getInstance().addListener(registerListener); }
/** * Set the pattern to highlight */ public void setPattern(String pattern) { this.pattern = (pattern == null) ? "" : pattern; // If there's a colouring renderer defined then use it // to highlight the term selected. if (getCellRenderer() instanceof NodeColouringRenderer) { NodeColouringRenderer renderer = (NodeColouringRenderer) getCellRenderer(); if (this.pattern.equals("")) { renderer.setPattern(null); } else { renderer.setPattern(".*" + this.pattern.toLowerCase() + ".*"); } repaint(); } }
private Color getStatusColour(String status) { if (status.equals("ProcessComplete")) { return GraphColours.getColour("medium sea green", Color.GREEN); } else if (status.equals("ServiceError") || status.equals("ServiceFailure")) { return GraphColours.getColour("firebrick1", Color.RED); } else if (status.startsWith("Invoking")) { return GraphColours.getColour("medium purple", Color.MAGENTA); } return GraphColours.getColour("light gray", Color.GRAY); }
public XMLTree(Document document) { super(); init(document.getRootElement()); revalidate(); }
private void modelChanged(String modelName, Object oldModel, Object newModel) { for (ModelChangeListener listener : listeners) { if (! listener.canHandle(modelName, newModel)) { continue; } try { listener.modelChanged(modelName, oldModel, newModel); } catch (Error er) { logger.error("Could not notify model listener " + listener,er); } } }
public void modelAdded(final ScuflModel workflow) { ChangedModelListener listener = new ChangedModelListener(workflow); listeners.put(workflow, listener); workflow.addListener(listener); synced(workflow); // initially unchanged }
/** * Get the singleton WorkflowChanges instance. * * @return The WorkflowChanges instance. */ public static WorkflowChanges getInstance() { if (instance == null) { instance = new WorkflowChanges(); } return instance; }
private static void doAddColor(String name, Color color) { doAddColor(name, color, true); }
private void launchURL(String address) { UIUtils.launchBrowser(address); }
public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { doEvent(e); } }
public void removeModel(ScuflModel model) { modelSet.remove(model); for (ScuflModelSetListener l : listeners) { l.modelRemoved(model); } }
public void addModel(ScuflModel model) { modelSet.add(model); for (ScuflModelSetListener l : listeners) { l.modelAdded(model); } }
@Override protected ScuflModel getModel() { return (ScuflModel)ModelMap.getInstance().getNamedModel(ModelMap.CURRENT_WORKFLOW); }
public void actionPerformed(ActionEvent e) { modelmap.setModel(ModelMap.CURRENT_WORKFLOW, model); // Normally the above would change perspective if needed, // unless the user selected the current workflow (no-op), // so we'll also ensure the perspective here perspectives.setWorkflowPerspective(); } };
/** * Simple example. */ public static void main(String[] args) { displayURL("http://www.javaworld.com"); } // Used to identify the windows platform.