*/
@Override
protected void setPortPositions() {
List<? extends Port> inputPorts = this.node.getInputPorts();
for (int i = 0; i < inputPorts.size(); i++) {
Port port = inputPorts.get(i);
Point offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
NodeController.getGUI(port).setOffset(offset);
}
// outputs
List<? extends Port> outputPorts = this.node.getOutputPorts();
for (int i = 0; i < outputPorts.size(); i++) {
Port port = outputPorts.get(i);
// Use getBounds() instead of this.dimension because subclass might
// overwrite getBounds() to have different shape.
Point offset = new Point(this.getBounds().width
- PortGUI.DATA_PORT_SIZE / 2, this.headHeight
+ PORT_INITIAL_GAP + PORT_GAP * i);
NodeController.getGUI(port).setOffset(offset);
}
PortImpl controlInPort = this.node.getControlInPort();
if (controlInPort != null) {
Point offset = new Point(0, this.headHeight / 2);
NodeController.getGUI(controlInPort).setOffset(offset);
}
// There are two controlOutPorts.
List<? extends Port> controlOutPorts = this.node.getControlOutPorts();
Port controlOutPort1 = controlOutPorts.get(0);
Point offset = new Point(getBounds().width, +this.headHeight / 2);
NodeController.getGUI(controlOutPort1).setOffset(offset);
Port controlOutPort2 = controlOutPorts.get(1);
offset = new Point(this.getBounds().width, getBounds().height - this.headHeight / 2);
NodeController.getGUI(controlOutPort2).setOffset(offset);
}