@Override protected ScuflModel getModel() { return (ScuflModel)ModelMap.getInstance().getNamedModel(ModelMap.CURRENT_WORKFLOW); }
@Override protected ScuflModel getModel() { return (ScuflModel)ModelMap.getInstance().getNamedModel(ModelMap.CURRENT_WORKFLOW); } }
public void actionPerformed(ActionEvent e) { WorkflowInputPanelFactory.invokeWorkflow( (ScuflModel) modelMap.getNamedModel(ModelMap.CURRENT_WORKFLOW), parentComponent); }
/** * Close the current workflow. * * @return true if the workflow was closed, false if anything went wrong or * the operation was cancelled. */ public boolean closeWorkflow() { ScuflModel currentModel = (ScuflModel) modelmap .getNamedModel(ModelMap.CURRENT_WORKFLOW); if (currentModel == null) { return false; } return closeWorkflow(currentModel); }
@Override protected void registerComponent(JComponent comp) { if (comp instanceof WorkflowModelViewSPI) { ScuflModel model = (ScuflModel) ModelMap.getInstance() .getNamedModel(ModelMap.CURRENT_WORKFLOW); if (model != null) { ((WorkflowModelViewSPI) comp).attachToModel(model); } } }
/** * Prompt for a file name, and then save the current workflow to the file. * * @return true if file was saved, or false if the action was cancelled * @throws FileNotFoundException * if the file exists but is a directory rather than a regular * file, does not exist but cannot be created, or cannot be * opened for any other reason * @throws SecurityException * if a security manager exists and its <code>checkWrite</code> * method denies write access to the file. */ public boolean saveToFile() throws FileNotFoundException, SecurityException { ScuflModel currentModel = (ScuflModel) ModelMap.getInstance() .getNamedModel(ModelMap.CURRENT_WORKFLOW); if (currentModel == null) { logger.warn("Can't save null model"); return false; } return saveToFile(parentComponent, currentModel); }
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(); } };
if (ret == JOptionPane.YES_OPTION) { PerspectiveSPI p = (PerspectiveSPI) ModelMap.getInstance().getNamedModel( ModelMap.CURRENT_PERSPECTIVE); if (p != null) {
public void saveAll() throws FileNotFoundException, IOException { // update current perspective PerspectiveSPI current = (PerspectiveSPI) modelMap.getNamedModel(ModelMap.CURRENT_PERSPECTIVE); if (current != null) { current.update(basePane.getElement()); } CustomPerspectiveFactory.getInstance().saveAll(customPerspectives); for (PerspectiveSPI perspective : perspectives.keySet()) { if (!(perspective instanceof CustomPerspective)) { savePerspective(perspective); } } }
(PerspectiveSPI) modelMap.getNamedModel(ModelMap.CURRENT_PERSPECTIVE); if (!(currentPerspective instanceof WorkflowPerspective)) {
storeUserPrefs(); PerspectiveSPI currentPerspective = (PerspectiveSPI) modelmap .getNamedModel(ModelMap.CURRENT_PERSPECTIVE); if (currentPerspective != null && currentPerspective instanceof CustomPerspective) {
JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(selectModel); group.add(menuItem); if (model == modelmap.getNamedModel(ModelMap.CURRENT_WORKFLOW)) { menuItem.setSelected(true);
/** * 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); } } } });