*/
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 = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
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);
// 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);
port.getGUI().setOffset(offset);
}
// control-in
Port controlInPort = this.node.getControlInPort();
if (controlInPort != null) {
controlInPort.getGUI().setOffset(new Point(0, 0));
}
// control-outs
for (Port controlOutPort : this.node.getControlOutPorts()) {
// By default, all ports will be drawn at the same place. Subclass