@Override
protected void setPortPositions() {
// inputs
List<? extends Port> inputPorts = this.node.getInputPorts();
for (int i = 0; i < inputPorts.size(); i++) {
Port port = inputPorts.get(i);
Point offset;
if (i < inputPorts.size() / 2) {
offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight
+ PORT_INITIAL_GAP + PORT_GAP * i);
} else {
offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight
+ PORT_INITIAL_GAP + PORT_GAP * (i + 1));
}
port.getGUI().setOffset(offset);
}
// outputs
List<? extends Port> outputPorts = this.node.getOutputPorts();
for (int i = 0; i < outputPorts.size(); i++) {
Port port = outputPorts.get(i);
Point offset = new Point(this.getBounds().width
- PortGUI.DATA_PORT_SIZE / 2, (int) (this.headHeight
+ PORT_INITIAL_GAP + PORT_GAP
* (outputPorts.size() / 2.0 + i)));
port.getGUI().setOffset(offset);
}
// control-in
Port controlInPort = this.node.getControlInPort();
if (controlInPort != null) {
controlInPort.getGUI().setOffset(new Point(0, 0));
}
// control-out
for (Port controlOutPort : this.node.getControlOutPorts()) {
controlOutPort.getGUI().setOffset(