public void testCreationDuplicate() throws Exception { proc.addPort(new DummyPort(proc, "sillyport")); try { // Should ignore case new DummyPort(proc, "SillyPort"); } catch (DuplicatePortNameException e) { // expected return; } throw new Exception("Should not allow duplicate port names"); } public void testCreationDuplicateOtherType() throws Exception {
public void actionPerformed(ActionEvent e) { Component parent = UIUtils.getActionEventParentWindow(e); String name = (String) JOptionPane.showInputDialog(parent, "Name for the new workflow output?", "Name required", JOptionPane.QUESTION_MESSAGE, null, null, ""); if (name != null) { try { model.getWorkflowSinkProcessor().addPort( new InputPort(model.getWorkflowSinkProcessor(), name)); model.forceUpdate(); } catch (PortCreationException pce) { JOptionPane.showMessageDialog(parent, "Port creation exception : \n" + pce.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } catch (DuplicatePortNameException dpne) { JOptionPane.showMessageDialog(parent, "Duplicate name : \n" + dpne.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } } }
public void testCreationDuplicateOtherType() throws Exception { // Duplicates are OK if they are different classes. // (But what if they are subclassing each other?) proc.addPort(new InputPort(proc, "sillyport")); new DummyPort(proc, "sillyport"); }
public void actionPerformed(ActionEvent e) { Component parent = UIUtils.getActionEventParentWindow(e); String name = (String) JOptionPane.showInputDialog(parent, "Name for the new workflow input?", "Name required", JOptionPane.QUESTION_MESSAGE, null, null, ""); if (name != null) { try { model.getWorkflowSourceProcessor() .addPort( new OutputPort(model .getWorkflowSourceProcessor(), name)); model.forceUpdate(); } catch (PortCreationException pce) { JOptionPane.showMessageDialog(parent, "Port creation exception : \n" + pce.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } catch (DuplicatePortNameException dpne) { JOptionPane.showMessageDialog(parent, "Duplicate name : \n" + dpne.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } } } }
void addInputPort(String name) throws DuplicatePortNameException, PortCreationException { model.getWorkflowSourceProcessor().addPort( new OutputPort(model.getWorkflowSourceProcessor(), name)); model.forceUpdate(); }
void addOutputPort(String name) throws DuplicatePortNameException, PortCreationException { model.getWorkflowSinkProcessor().addPort( new InputPort(model.getWorkflowSinkProcessor(), name)); model.forceUpdate(); }
String portName = ip[i].getName(); OutputPort port = new OutputPort(m.getWorkflowSourceProcessor(), portName); m.getWorkflowSourceProcessor().addPort(port); m.addDataConstraint(new DataConstraint(m, port, ip[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));