public void actionPerformed(ActionEvent e) { modelMap.setModel(ModelMap.CURRENT_PERSPECTIVE, perspective); } };
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(); } };
public void modelAdded(ScuflModel model) { modelmap.setModel(ModelMap.CURRENT_WORKFLOW, model); menuBar.refreshWorkflowsMenu(); }
public void actionPerformed(ActionEvent e) { if (runningWorkflows.size()!=0) { JOptionPane.showMessageDialog(EnactorInvocation.this, "Sorry, unable to close whilst other workflows are running","Unable to close results",JOptionPane.OK_OPTION); } else { int r=JOptionPane.showConfirmDialog(EnactorInvocation.this, "Are you sure you wish to close this workflow run?","Close workflow run?",JOptionPane.YES_NO_OPTION); if (r==JOptionPane.YES_OPTION) { ModelMap.getInstance().setModel(workflowInstance.getID(), null); } } }
public void modelRemoved(ScuflModel model) { if (model == modelmap.getNamedModel(ModelMap.CURRENT_WORKFLOW)) { // Need to find some other current workflow modelmap.setModel(ModelMap.CURRENT_WORKFLOW, null); try { ScuflModel firstmodel = workflowModels.getModels() .iterator().next(); modelmap .setModel(ModelMap.CURRENT_WORKFLOW, firstmodel); } catch (NoSuchElementException ex) { // No more models, make a new empty one createWorkflow(); return; } } menuBar.refreshWorkflowsMenu(); } };
private void selectFirstPerspective() { boolean set = false; for (Component c : toolBar.getComponents()) { if (c instanceof AbstractButton && c.isVisible()) { ((AbstractButton) c).doClick(); set = true; break; } } if (!set) // no visible perspectives were found { logger.info("No visible perspectives."); modelMap.setModel(ModelMap.CURRENT_PERSPECTIVE, new BlankPerspective()); } }
ModelMap.getInstance().setModel(ModelMap.CURRENT_WORKFLOW, model);
/** * Immediately execute workflow. Workflow is submitted to the enactor with the * given input values, and invocation is initiated. Switches to the * @link{EnactPerspective}. * * @param workflow Workflow to run * @param inputs Map of input values to run the workflow with * @throws */ public static void executeWorkflow(ScuflModel workflow, Map<String, DataThing> inputs) { EnactorProxy enactor = FreefluoEnactorProxy.getInstance(); WorkflowInstance instance; try { instance = enactor.compileWorkflow(workflow, inputs, EnactorInvocation.USERCONTEXT); } catch (WorkflowSubmissionException e) { logger.error("Could not compile workflow " + workflow, e); return; } logger.debug("Compiled workflow " + instance); ModelMap.getInstance().setModel(instance.getID(), instance); logger.info("Running the workflow " + instance); try { instance.run(); } catch (InvalidInputException e) { logger.warn("Could not run workflow " + instance, e); } }
ModelMap.CURRENT_PERSPECTIVE); if (p != null) { modelMap.setModel(ModelMap.CURRENT_PERSPECTIVE, null); basePane.setEditable(false); // cancel edit mode
return; modelMap.setModel(ModelMap.CURRENT_PERSPECTIVE, foundPerspective);
"Sorry, unable to change perspectives whilst in edit mode", "Cannot change perspective", JOptionPane.INFORMATION_MESSAGE); modelMap.setModel(ModelMap.CURRENT_PERSPECTIVE, currentPerspective); return;
modelmap.setModel(ModelMap.CURRENT_WORKFLOW, model);
/** * Unless the current perspective does, finds the first instance of a perspective that contains a WorkflowInstanceContainer and is visible * and then switch the current perspective to that one, so that the results of the running workflow can be seen. * The correct perspective is found by parsing the XML looking a named or static ZRavenComponent containing the class org.embl.ebi.escience.scuflui.WorkflowInstanceContainerFactory */ private void switchToWorkflowInstanceContainerPerspective() { PerspectiveSPI currentPerspective = (PerspectiveSPI)modelmap.getNamedModel(ModelMap.CURRENT_PERSPECTIVE); if (currentPerspective==null || !perspectiveContainsWorkflowInstanceContainer(currentPerspective)) { for (PerspectiveSPI perspective : perspectives.getPerspectives()) { if (perspective.isVisible()) { if (perspectiveContainsWorkflowInstanceContainer(perspective)) { modelmap.setModel(ModelMap.CURRENT_PERSPECTIVE, perspective); break; } } } } }
public void actionPerformed(ActionEvent e) { perspective.setVisible(!perspective.isVisible()); perspectives.get(perspective).setVisible( perspective.isVisible()); putValue(NAME, perspective.isVisible() ? "Hide" : "Show"); PerspectiveSPI current = (PerspectiveSPI) modelMap.getNamedModel(ModelMap.CURRENT_PERSPECTIVE); if (!perspective.isVisible()) { // change to the first available if the current is being // hidden if (current == perspective) { selectFirstPerspective(); } } else { // if no perspectives are currently visible, then change to // the one just made visible if (current == null || current instanceof BlankPerspective) { modelMap.setModel(ModelMap.CURRENT_PERSPECTIVE, perspective); } } } });