setInstancePoker(Poker.class);
setInstanceLogger(Logger.class);
Port[] ps = new Port[numInputs + STD_PORTS];
if (numInputs == 1) {
ps[0] = new Port(-40, 20, Port.INPUT, 1);
ps[1] = new Port(-40, 0, Port.INPUT, 1);
} else if (numInputs == 2) {
ps[0] = new Port(-40, 0, Port.INPUT, 1);
ps[1] = new Port(-40, 20, Port.INPUT, 1);
ps[2] = new Port(-40, 10, Port.INPUT, 1);
} else {
throw new RuntimeException("flip-flop input > 2");
}
ps[numInputs + 1] = new Port( 0, 0, Port.OUTPUT, 1);
ps[numInputs + 2] = new Port( 0, 20, Port.OUTPUT, 1);
ps[numInputs + 3] = new Port(-10, 30, Port.INPUT, 1);
ps[numInputs + 4] = new Port(-30, 30, Port.INPUT, 1);
ps[numInputs + 5] = new Port(-20, 30, Port.INPUT, 1);
ps[numInputs].setToolTip(Strings.getter("flipFlopClockTip"));
ps[numInputs + 1].setToolTip(Strings.getter("flipFlopQTip"));
ps[numInputs + 2].setToolTip(Strings.getter("flipFlopNotQTip"));
ps[numInputs + 3].setToolTip(Strings.getter("flipFlopResetTip"));
ps[numInputs + 4].setToolTip(Strings.getter("flipFlopPresetTip"));