/** * @param scuflModel * @throws EditException */ private void connectConditions() throws EditException { for (ConcurrencyConstraint concurrencyConstraint : scuflModel .getConcurrencyConstraints()) { Processor controlProcessor = processorMap.get(concurrencyConstraint .getControllingProcessor()); Processor targetProcessor = processorMap.get(concurrencyConstraint .getTargetProcessor()); Edit<OrderedPair<Processor>> addConditionEdit = edits .getCreateConditionEdit(controlProcessor, targetProcessor); addConditionEdit.doEdit(); } }
public void actionPerformed(ActionEvent ae) { String ccName = target.getName() + "_BLOCKON_" + controller.getName(); try { // Constraints created by this menu are, for now, // always // of the form 'block scheduled to running until // completed', // as this is all the enactor can currently support. ConcurrencyConstraint cc = new ConcurrencyConstraint(model, ccName, controller, target, ConcurrencyConstraint.SCHEDULED, ConcurrencyConstraint.RUNNING, ConcurrencyConstraint.COMPLETED); model.addConcurrencyConstraint(cc); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Something wasn't happy : \n" + e.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } } });
private static JPopupMenu getConcurrencyConstraintMenu(ConcurrencyConstraint cc, ScuflModel model) { JPopupMenu theMenu = new JPopupMenu(); theMenu.add(new ShadedLabel("Coordination : " + cc.getName(), ShadedLabel.TAVERNA_GREEN)); theMenu.addSeparator(); theMenu.add(new RemoveAction(model, cc)); return theMenu; }
public Object getSource(Object edge) { if (edge instanceof DataConstraint) { Object source = ((DataConstraint) edge).getSource(); if (isPortOnWorkflowEdge(source)) { return getDummyPort(source); } return source; } else if (edge instanceof ConcurrencyConstraint) { return getDummyPort(((ConcurrencyConstraint) edge).getControllingProcessor()); } return null; }
public Object getTarget(Object edge) { if (edge instanceof DataConstraint) { Object target = ((DataConstraint) edge).getSink(); if (isPortOnWorkflowEdge(target)) { return getDummyPort(target); } return target; } else if (edge instanceof ConcurrencyConstraint) { return getDummyPort(((ConcurrencyConstraint) edge).getTargetProcessor()); } return null; }
/** * @param scuflModel * @throws EditException */ private void connectConditions() throws EditException { for (ConcurrencyConstraint concurrencyConstraint : scuflModel .getConcurrencyConstraints()) { Processor controlProcessor = processorMap.get(concurrencyConstraint .getControllingProcessor()); Processor targetProcessor = processorMap.get(concurrencyConstraint .getTargetProcessor()); Edit<OrderedPair<Processor>> addConditionEdit = edits .getCreateConditionEdit(controlProcessor, targetProcessor); addConditionEdit.doEdit(); } }
public void actionPerformed(ActionEvent ae) { String ccName = target.getName() + "_BLOCKON_" + controller.getName(); try { // Constraints created by this menu are, for now, // always // of the form 'block scheduled to running until // completed', // as this is all the enactor can currently support. ConcurrencyConstraint cc = new ConcurrencyConstraint(model, ccName, controller, target, ConcurrencyConstraint.SCHEDULED, ConcurrencyConstraint.RUNNING, ConcurrencyConstraint.COMPLETED); model.addConcurrencyConstraint(cc); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Something wasn't happy : \n" + e.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } } });
public boolean isBoring(Object object) { if (object instanceof Processor) { return ((Processor) object).isBoring(); } else if (object instanceof DataConstraint) { DataConstraint constraint = (DataConstraint) object; return constraint.getSource().getProcessor().isBoring() || constraint.getSink().getProcessor().isBoring(); } else if (object instanceof ConcurrencyConstraint) { ConcurrencyConstraint constraint = (ConcurrencyConstraint) object; return constraint.getControllingProcessor().isBoring() || constraint.getTargetProcessor().isBoring(); } return false; }