Port[] ps;
if (parallelObj == null || parallelObj.booleanValue()) {
Integer lenObj = instance.getAttributeValue(ATTR_LENGTH);
int len = lenObj == null ? 8 : lenObj.intValue();
ps = new Port[6 + 2 * len];
ps[LD] = new Port(10, -20, Port.INPUT, 1);
ps[LD].setToolTip(Strings.getter("shiftRegLoadTip"));
for (int i = 0; i < len; i++) {
ps[6 + 2 * i] = new Port(20 + 10 * i, -20, Port.INPUT, width);
ps[6 + 2 * i + 1] = new Port(20 + 10 * i, 20, Port.OUTPUT, width);
}
} else {
ps = new Port[5];
}
ps[OUT] = new Port(bds.getWidth(), 0, Port.OUTPUT, width);
ps[SH] = new Port( 0, -10, Port.INPUT, 1);
ps[IN] = new Port( 0, 0, Port.INPUT, width);
ps[CK] = new Port( 0, 10, Port.INPUT, 1);
ps[CLR] = new Port(10, 20, Port.INPUT, 1);
ps[OUT].setToolTip(Strings.getter("shiftRegOutTip"));
ps[SH].setToolTip(Strings.getter("shiftRegShiftTip"));
ps[IN].setToolTip(Strings.getter("shiftRegInTip"));
ps[CK].setToolTip(Strings.getter("shiftRegClockTip"));
ps[CLR].setToolTip(Strings.getter("shiftRegClearTip"));