public String getName() { if (theProcessor == null) { return "Template editor for unknown processor"; } else { return "Template editor for " + theProcessor.getName(); } }
private Map<String, org.embl.ebi.escience.scufl.InputPort> getInputPortMap( org.embl.ebi.escience.scufl.Processor processor) { Map<String, org.embl.ebi.escience.scufl.InputPort> inputPorts = new HashMap<String, org.embl.ebi.escience.scufl.InputPort>(); for (org.embl.ebi.escience.scufl.InputPort inputPort : processor .getInputPorts()) { inputPorts.put(inputPort.getName(), inputPort); } return inputPorts; }
public void actionPerformed(ActionEvent ae) { try { int numberOfAlternates = theProcessor.getAlternatesArray().length; Processor alternateProcessor = pf.createProcessor("alternate" + (numberOfAlternates + 1), null); AlternateProcessor alternate = new AlternateProcessor(alternateProcessor); theProcessor.addAlternate(alternate); if (theProcessor.getModel() != null) { boolean isOffline = theProcessor.getModel().isOffline(); if (isOffline) { alternateProcessor.setOffline(); } else { alternateProcessor.setOnline(); } } // Set the appropriate offline / // online status } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(null, "Problem creating alternate : \n" + ex.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } }
public EnactorStatusTableModel(ScuflModel scufl) { this.scuflModel = scufl; // One row for each processor. Processor[] processors = scuflModel.getProcessors(); rows = processors.length; data = new Object[rows][columnNames.length]; // Put appropriate content in the rows for (int i = 0; i < rows; i++) { Processor p = processors[i]; // do the icon data[i][0] = org.embl.ebi.escience.scuflworkers.ProcessorHelper .getPreferredIcon(p); // do the name data[i][1] = p.getName(); // do status data[i][2] = "No data"; // do start time data[i][3] = "--"; // do end time data[i][4] = "--"; // do the breakpoint if (p.hasBreakpoint()) data[i][5] = TavernaIcons.tickIcon; else data[i][5] = TavernaIcons.nullIcon; } }
public void mouseClicked(MouseEvent e) { final Processor theProcessor = getPointedProcessor(e.getX(), e .getY(), processorTable); if (theProcessor != null) { if (!theProcessor.hasBreakpoint()) { theProcessor.addBreakpoint(); try { statusTableModel.update(getStatusText()); } catch (InvalidStatusReportException isre) { } processorTable.repaint(); workflowInstance.pause(theProcessor.getName()); } else { theProcessor.rmvBreakpoint(); try { statusTableModel.update(getStatusText()); } catch (InvalidStatusReportException isre) { } processorTable.repaint(); workflowInstance.resume(theProcessor.getName()); } } }
.getProcessors()) { for (org.embl.ebi.escience.scufl.InputPort t1InputPort : t1Processor .getInputPorts()) { if (!t1InputPort.isBound() && t1InputPort.getDefaultValue() != null) { String processorName = t1Processor.getName() + "_" + sanitiseName(t1InputPort.getName()) + "_defaultValue"; DataConstraint constraint = new DataConstraint( scuflModel, stringConstantProcessor .getOutputPorts()[0], t1InputPort); scuflModel.addDataConstraint(constraint); } catch (ProcessorCreationException e) {
private void populatePortSymanticTypeDetails(Processor processor, RshellActivityConfigurationBean bean) throws ActivityTranslationException { List<RShellPortSymanticTypeBean> inputDefinitions = new ArrayList<RShellPortSymanticTypeBean>(); List<RShellPortSymanticTypeBean> outputDefinitions = new ArrayList<RShellPortSymanticTypeBean>(); for (InputPort inputPort : processor.getInputPorts()) { RShellPortSymanticTypeBean symanticTypeBean = new RShellPortSymanticTypeBean(); symanticTypeBean.setName(inputPort.getName()); symanticTypeBean.setSymanticType(getSymanticType(inputPort)); inputDefinitions.add(symanticTypeBean); } for (OutputPort outPort : processor.getOutputPorts()) { RShellPortSymanticTypeBean symanticTypeBean = new RShellPortSymanticTypeBean(); symanticTypeBean.setName(outPort.getName()); symanticTypeBean.setSymanticType(getSymanticType(outPort)); outputDefinitions.add(symanticTypeBean); } bean.setInputSymanticTypes(inputDefinitions); bean.setOutputSymanticTypes(outputDefinitions); }
final ScuflModel model = sourcePort.getProcessor().getModel(); JPopupMenu theMenu = new JPopupMenu("Possible targets"); Processor[] processors = sourcePort.getProcessor().getModel() .getProcessors(); if (x<processors.length) { InputPort[] inputs = processors[x].getInputPorts(); if (inputs.length > 0 && processors[x] != sourcePort.getProcessor()) { ImageIcon icon = null; icon = org.embl.ebi.escience.scuflworkers.ProcessorHelper .getPreferredIcon(processors[x]); processMenu = new JMenu(processors[x].getName()); processMenu.add(new ShadedLabel("Choose an Input", ShadedLabel.TAVERNA_ORANGE)); if (!set) { InputPort[] inputs = processors[i].getInputPorts(); if (inputs.length > 0 && processors[i] != sourcePort.getProcessor()) { ImageIcon icon = null; icon = org.embl.ebi.escience.scuflworkers.ProcessorHelper .getPreferredIcon(processors[i]); processMenu = new JMenu(processors[i].getName()); processMenu.add(new ShadedLabel("Choose an Input", ShadedLabel.TAVERNA_ORANGE));
if (startPort instanceof InputPort) ports = processor.getOutputPorts(); ports = processor.getInputPorts(); .getModel(), startPort, ports[index])); new AddDataConstraintAction(startPort.getProcessor().getModel(), startPort, (Port) ((VertexView) target).getCell()).actionPerformed(null);
private static JPopupMenu getProcessorMenu(Processor processor) { final Processor theProcessor = processor; JPopupMenu theMenu = new JPopupMenu(); theMenu.add(new ShadedLabel("Processor : " + theProcessor.getName(), ShadedLabel.TAVERNA_GREEN)); theMenu.addSeparator(); theMenu.add(new RenameAction(processor.getModel(), processor)); theMenu.add(new RemoveAction(processor.getModel(), processor)); theMenu.addSeparator(); if (theProcessor.hasBreakpoint()) { theMenu.add(rmvBreakpoint); } else { Processor[] gp = processor.getModel().getProcessors(); if (gp.length > 1) { theMenu.add(block); JMenuItem gpi = new JMenuItem(gp[x].getName()); gpi.setIcon(org.embl.ebi.escience.scuflworkers.ProcessorHelper.getPreferredIcon(gp[x])); exp.add(gpi); final Processor controller = gp[x]; final Processor target = processor; final ScuflModel model = processor.getModel(); gpi.addActionListener(new ActionListener() { JMenuItem gpi = new JMenuItem(gp[i].getName()); gpi.setIcon(org.embl.ebi.escience.scuflworkers.ProcessorHelper.getPreferredIcon(gp[i])); block.add(gpi); final Processor controller = gp[i]; final Processor target = processor;
EditException, WorkflowTranslationException { Processor t2Processor = edits.createProcessor(t1Processor.getName()); .getAlternatesArray()) { org.embl.ebi.escience.scufl.Processor alternateT1Processor = alternateProcesor .getProcessor();
} else { Processor processor = (Processor) scuflObject; Port[] ports = processor.getPorts(); if (ports.length > 0) { JMenu linkMenu = new JMenu( linkMenu .setIcon(TavernaIcons.dataLinkIcon); ports = processor.getInputPorts(); if (ports.length > 0) { linkMenu ports = processor.getOutputPorts(); if (ports.length > 0) { linkMenu
public Object valueForCellChanged(Object cell, Object newValue) { if (cell instanceof Processor) { Processor processor = (Processor) cell; processor.setName(newValue.toString()); return processor.getName(); } if (cell instanceof Port) { Port port = (Port) cell; if (isPortOnWorkflowEdge(port)) { for (Port p : port.getProcessor().getPorts()) { //prevent renaming if a port already has that name if (p.getName().equals(newValue.toString())) { return port.getName(); } } port.setName(newValue.toString()); return port.getName(); } } return null; } }
InputPort[] ip = p.getInputPorts(); for (int i = 0; i < ip.length; i++) { String portName = ip[i].getName(); OutputPort port = new OutputPort(m.getWorkflowSourceProcessor(), portName); m.getWorkflowSourceProcessor().addPort(port); m.addDataConstraint(new DataConstraint(m, port, ip[i])); OutputPort[] op = p.getOutputPorts(); for (int i = 0; i < op.length; i++) { String portName = op[i].getName(); InputPort port = new InputPort(m.getWorkflowSinkProcessor(), portName); m.getWorkflowSinkProcessor().addPort(port); m.addDataConstraint(new DataConstraint(m, op[i], port));
null, "Would you like to add all of the subcomponents for the processor '" + bop.getName() + "' that was just added to the workflow? Data links would be added."); if (answer == JOptionPane.NO_OPTION scuflModel.addProcessor(subComponentProcessor); scuflModel.addDataConstraint(new DataConstraint(scuflModel, subComponentProcessor.locatePort("mobyData"), p)); } catch (ProcessorCreationException pce) { JOptionPane.showMessageDialog(null,
private void doChildren(ScuflModel model) { Processor[] processors = model.getProcessors(); for (int i = 0; i < processors.length; i++) { // Create a new node for the factory corresponding to this processor String tagName = ProcessorHelper.getTagNameForClassName(processors[i].getClass().getName()); XMLHandler xh = ProcessorHelper.getXMLHandlerForTagName(tagName); logger.info(tagName + ":" + processors[i].getName()); if (xh != null) { ProcessorFactory pf = xh.getFactory(xh.elementForProcessor(processors[i])); pf.setName(processors[i].getName()); if (processors[i].getDescription().equals("") == false) { pf.setDescription(processors[i].getDescription()); } else { if (processors[i] instanceof WorkflowProcessor) { // Nested workflow with no description, explicitly set // it to say // this otherwise a 'fetch descriptions' will attempt to // load it // in online mode, this could well fail. pf.setDescription("<font color=\"red\">No description supplied for nested workflow</font>"); } } add(new DefaultMutableTreeNode(pf)); } } } }
public void setSignificant(Object o) { if (o == null) { significantObject = null; return; } if (o instanceof Port) { significantObject = o; return; } else if (o instanceof Processor && ((Processor) o).getModel() != null) { significantObject = o; return; } significantObject = null; }
Map<String, DataThing> inputMap) throws TaskExecutionException { InputPort[] ip = activeProcessor.getInputPorts(); for (int i = 0; i < ip.length; i++) { if (ip[i].hasDefaultValue() transformOutputDataThings(inputMap, outputMap); AnnotationTemplate[] templates = activeProcessor .getAnnotationTemplates(); AnnotationTemplate[] defaultTemplates = activeProcessor .defaultAnnotationTemplates(); if (templates.length > 0 || defaultTemplates.length > 0) {
Engine e = flow.getEngine(); this.workflowInstance = WorkflowInstanceImpl.getInstance(e, activeProcessor.getModel(), flowID); for (int i = -1; i < proc.getAlternatesArray().length; i++) { schedule(proc.getAlternatesArray()[i]); if (i == proc.getAlternatesArray().length - 1) { throw tee; } else {