/** * @param args */ public static void main(String[] args) { IterationStrategyImpl iterationStrategyImpl = new IterationStrategyImpl(); NamedInputPortNode fishPort = new NamedInputPortNode("fish", 2); NamedInputPortNode otherPort = new NamedInputPortNode("other", 0); NamedInputPortNode soupPort = new NamedInputPortNode("soup", 1); iterationStrategyImpl.addInput(fishPort); iterationStrategyImpl.addInput(soupPort); iterationStrategyImpl.addInput(otherPort); iterationStrategyImpl.connectDefault(otherPort); iterationStrategyImpl.connectDefault(fishPort); iterationStrategyImpl.connectDefault(soupPort); IterationStrategyEditorControl editorControl = new IterationStrategyEditorControl(iterationStrategyImpl); JFrame frame = new JFrame("Iteration strategy editor"); frame.add(editorControl); frame.setSize(500,400); frame.setVisible(true); }
/** * @param args */ public static void main(String[] args) { IterationStrategyImpl iterationStrategyImpl = new IterationStrategyImpl(); NamedInputPortNode fishPort = new NamedInputPortNode("fish", 2); NamedInputPortNode otherPort = new NamedInputPortNode("other", 0); NamedInputPortNode soupPort = new NamedInputPortNode("soup", 1); iterationStrategyImpl.addInput(fishPort); iterationStrategyImpl.addInput(soupPort); iterationStrategyImpl.addInput(otherPort); iterationStrategyImpl.connectDefault(otherPort); iterationStrategyImpl.connectDefault(fishPort); iterationStrategyImpl.connectDefault(soupPort); IterationStrategyEditorControl editorControl = new IterationStrategyEditorControl(iterationStrategyImpl); JFrame frame = new JFrame("List handling editor"); frame.add(editorControl); frame.setSize(500,400); frame.setVisible(true); }
@Override protected void doEditAction(ProcessorImpl processor) throws EditException { // Add a new InputPort object to the processor and also create an // appropriate NamedInputPortNode in any iteration strategies. By // default set the desired drill depth on each iteration strategy node // to the same as the input port, so this won't automatically trigger // iteration staging unless the depth is altered on the iteration // strategy itself.) if (processor.getInputPortWithName(newPortName) != null) { throw new EditException( "Attempt to create duplicate input port with name '" + newPortName + "'"); } previousIterationStrategyState = processor.iterationStack.asXML(); processor.inputPorts.add(new ProcessorInputPortImpl(processor, newPortName, newPortDepth)); for (IterationStrategyImpl is : processor.iterationStack.getStrategies()) { NamedInputPortNode nipn = new NamedInputPortNode(newPortName, newPortDepth); is.addInput(nipn); is.connectDefault(nipn); } }
@Override protected void doEditAction(ProcessorImpl processor) throws EditException { // Add a new InputPort object to the processor and also create an // appropriate NamedInputPortNode in any iteration strategies. By // default set the desired drill depth on each iteration strategy node // to the same as the input port, so this won't automatically trigger // iteration staging unless the depth is altered on the iteration // strategy itself.) if (processor.getInputPortWithName(port.getName()) != null) { throw new EditException( "Attempt to create duplicate input port with name '" + port.getName() + "'"); } previousIterationStrategyState = processor.iterationStack.asXML(); processor.inputPorts.add(port); for (IterationStrategyImpl is : processor.iterationStack.getStrategies()) { NamedInputPortNode nipn = new NamedInputPortNode(port.getName(), port.getDepth()); is.addInput(nipn); is.connectDefault(nipn); } }
@Override protected void doEditAction(ProcessorImpl processor) throws EditException { // Add a new InputPort object to the processor and also create an // appropriate NamedInputPortNode in any iteration strategies. By // default set the desired drill depth on each iteration strategy node // to the same as the input port, so this won't automatically trigger // iteration staging unless the depth is altered on the iteration // strategy itself.) if (processor.getInputPortWithName(port.getName()) != null) { throw new EditException( "Attempt to create duplicate input port with name '" + port.getName() + "'"); } previousIterationStrategyState = processor.iterationStack.asXML(); processor.inputPorts.add(port); for (IterationStrategyImpl is : processor.iterationStack.getStrategies()) { NamedInputPortNode nipn = new NamedInputPortNode(port.getName(), port.getDepth()); is.addInput(nipn); is.connectDefault(nipn); } }