@Override public void setup(Manipulator m, DialogControls dialogControls) { manipulator = (LinkNodes) m; nodes = manipulator.getNodes(); if (manipulator.isDirected()) { directedEdge.setSelected(true); } else { undirectedEdge.setSelected(true); } Node sourceNode = manipulator.getSourceNode(); // Prepare combo box with nodes data: for (int i = 0; i < nodes.length; i++) { sourceNodeComboBox.addItem(nodes[i].getId() + " - " + nodes[i].getLabel()); if (nodes[i] == sourceNode) { sourceNodeComboBox.setSelectedIndex(i); } } }
@Override public String getDisplayName() { return manipulator.getName(); }
@Override public void unSetup() { manipulator.setSourceNode(nodes[sourceNodeComboBox.getSelectedIndex()]); manipulator.setDirected(directedEdge.isSelected()); }