public class GUIand extends SubmodelComponent
{
+ private final Pin pinA;
+ private final Pin pinB;
+ private final Pin pinY;
+
public GUIand(ViewModelModifiable model)
{
super(model, "GUIand");
setSize(35, 25);
setSubmodelScale(.4);
- initSubmodelComponents();
- }
- @SuppressWarnings("unused") // for GUIWires being created
- private void initSubmodelComponents()
- {
Pin A = addSubmodelInterface(1, 0, 5);
Pin B = addSubmodelInterface(1, 0, 20);
Pin Y = addSubmodelInterface(1, 35, 12.5);
+ this.pinA = getSupermodelPin(A);
+ this.pinB = getSupermodelPin(B);
+ this.pinY = getSupermodelPin(Y);
+
+ initSubmodelComponents(A, B, Y);
+ }
+
+ @SuppressWarnings("unused") // for GUIWires being created
+ private void initSubmodelComponents(Pin A, Pin B, Pin Y)
+ {
GUINandGate nand = new GUINandGate(submodelModifiable, 1);
- nand.moveTo(20, 21.25);
GUINandGate not = new GUINandGate(submodelModifiable, 1);
- not.moveTo(50, 21.25);
WireCrossPoint cp1 = new WireCrossPoint(submodelModifiable, 1);
+
+ nand.moveTo(20, 21.25);
+ not.moveTo(50, 21.25);
cp1.moveTo(45, 31.25);
new GUIWire(submodelModifiable, A, nand.getInputPins().get(0), new Point(10, 12.5), new Point(10, 26.25));
new GUIWire(submodelModifiable, cp1.getPin(), not.getInputPins().get(1), new Point(45, 36.25));
new GUIWire(submodelModifiable, not.getOutputPin(), Y);
}
+
+ public Pin getPinA()
+ {
+ return pinA;
+ }
+
+ public Pin getPinB()
+ {
+ return pinB;
+ }
+
+ public Pin getPinY()
+ {
+ return pinY;
+ }
+
}
\ No newline at end of file