private static JPopupMenu getDataConstraintMenu(DataConstraint dc, ScuflModel model) { JPopupMenu theMenu = new JPopupMenu(); theMenu.add(new ShadedLabel("Link : " + dc.getName(), ShadedLabel.TAVERNA_GREEN)); theMenu.addSeparator(); theMenu.add(new RemoveAction(model, dc)); return theMenu; }
public void actionPerformed(ActionEvent e) { remove(modelObject); }
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; }
private void remove(Object object) { Class clazz = object.getClass(); if (clazz.isArray()) { Object[] array = (Object[]) object; for (int index = 0; index < array.length; index++) { remove(array[index]); } } else { if (object instanceof Collection) { Iterator iterator = ((Collection) object).iterator(); while (iterator.hasNext()) { remove(iterator.next()); } } else if (object instanceof Processor) { model.destroyProcessor((Processor) object); } else if (object instanceof Port) { Port port = (Port) object; port.getProcessor().removePort(port); } else if (object instanceof DataConstraint) { model.destroyDataConstraint((DataConstraint) object); } else if (object instanceof ConcurrencyConstraint) { model .destroyConcurrencyConstraint((ConcurrencyConstraint) object); } } } }
menu.add(new RemoveAction(model, selected)); menu.show(WorkflowEditor.this, event.getX(), event .getY());
final Port sinkPort = theInputPort; theMenu.add(new RenameAction(model, sinkPort)); theMenu.add(new RemoveAction(model, sinkPort)); theMenu.addSeparator(); theMenu.add(new EditMetadataAction(model, sinkPort)); theMenu.add(new RemoveAction(model, theInputPort));
theMenu.addSeparator(); theMenu.add(new RenameAction(processor.getModel(), processor)); theMenu.add(new RemoveAction(processor.getModel(), processor)); theMenu.addSeparator();
+ sourcePort.getName(), ShadedLabel.TAVERNA_GREEN)); theMenu.add(new RenameAction(model, fromPort)); theMenu.add(new RemoveAction(model, fromPort)); theMenu.addSeparator(); theMenu.add(new EditMetadataAction(model, fromPort));