X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fmodel%2Fcomponents%2FSimpleRectangularGUIGate.java;fp=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fmodel%2Fcomponents%2FSimpleRectangularGUIGate.java;h=eb396ccab796415403a6ec25185701f10fa91b8c;hb=e9b72fcd41c45807f9e126cae897c9b17e79961d;hp=6edf164775355e36e903b2519190bd1054f89940;hpb=73c2a2608cc57cbe1ddb8e99a944fd18216ffd34;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/model/components/SimpleRectangularGUIGate.java b/LogicUI/src/era/mi/gui/model/components/SimpleRectangularGUIGate.java index 6edf1647..eb396cca 100644 --- a/LogicUI/src/era/mi/gui/model/components/SimpleRectangularGUIGate.java +++ b/LogicUI/src/era/mi/gui/model/components/SimpleRectangularGUIGate.java @@ -1,6 +1,7 @@ package era.mi.gui.model.components; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import era.mi.gui.model.ViewModel; @@ -25,6 +26,7 @@ public class SimpleRectangularGUIGate extends GUIComponent private MovablePin outputPin; private final List inputPins; + private final List inputPinsUnmodifiable; protected SimpleRectangularGUIGate(ViewModel model, int logicWidth, String label, boolean isInverted) { @@ -36,6 +38,7 @@ public class SimpleRectangularGUIGate extends GUIComponent this.outputPin = new MovablePin(this, logicWidth, width, 0); addPin(outputPin); this.inputPins = new ArrayList<>(); + this.inputPinsUnmodifiable = Collections.unmodifiableList(inputPins); setInputCount(1); } @@ -56,6 +59,16 @@ public class SimpleRectangularGUIGate extends GUIComponent outputPin.setRelPos(width, inputCount * pinDistance / 2); } + public Pin getOutputPin() + { + return outputPin; + } + + public List getInputPins() + { + return inputPinsUnmodifiable; + } + @Override public void render(GeneralGC gc, Rectangle visibleRegion) {