X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fcomponents%2FGUINotGate.java;h=fa4730a1121204e9a9d796e170ea9a62da71b525;hb=6c67a9ff8361cd9fc082f40e2676f2c8b5911fe4;hp=78bed33f6fac82c11096f0f0043255951de64470;hpb=d3a382377768fdb1434d5baebf73c9413e61e46f;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/components/GUINotGate.java b/LogicUI/src/era/mi/gui/components/GUINotGate.java index 78bed33f..fa4730a1 100644 --- a/LogicUI/src/era/mi/gui/components/GUINotGate.java +++ b/LogicUI/src/era/mi/gui/components/GUINotGate.java @@ -5,7 +5,9 @@ import java.util.Collections; import java.util.List; import era.mi.logic.components.gates.NotGate; -import era.mi.logic.wires.WireArray; +import era.mi.logic.timeline.Timeline; +import era.mi.logic.wires.Wire.ReadEnd; +import era.mi.logic.wires.Wire.ReadWriteEnd; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Font; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; @@ -13,26 +15,26 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; public class GUINotGate extends NotGate implements BasicGUIComponent { - private static final String LABEL = "\u22651";//>=1 + private static final String LABEL = "\u22651";// >=1 - private final List connectedWireArrays; - private final List wireArrayConnectionPoints; + private final List connectedWireEnds; + private final List WireEndConnectionPoints; - public GUINotGate(int processTime, WireArray in, WireArray out) + public GUINotGate(Timeline timeline, int processTime, ReadEnd in, ReadWriteEnd out) { - super(processTime, in, out); + super(timeline, processTime, in, out); - List connectedWireArraysModifiable = new ArrayList<>(); - List wireArrayConnectionPointsModifiable = new ArrayList<>(); + List connectedWireEndsModifiable = new ArrayList<>(); + List WireEndConnectionPointsModifiable = new ArrayList<>(); - connectedWireArraysModifiable.add(in); - wireArrayConnectionPointsModifiable.add(new Point(0, 5)); + connectedWireEndsModifiable.add(in); + WireEndConnectionPointsModifiable.add(new Point(0, 5)); - connectedWireArraysModifiable.add(out); - wireArrayConnectionPointsModifiable.add(new Point(20, 5)); + connectedWireEndsModifiable.add(out); + WireEndConnectionPointsModifiable.add(new Point(20, 5)); - this.connectedWireArrays = Collections.unmodifiableList(connectedWireArraysModifiable); - this.wireArrayConnectionPoints = Collections.unmodifiableList(wireArrayConnectionPointsModifiable); + this.connectedWireEnds = Collections.unmodifiableList(connectedWireEndsModifiable); + this.WireEndConnectionPoints = Collections.unmodifiableList(WireEndConnectionPointsModifiable); } @Override @@ -40,6 +42,7 @@ public class GUINotGate extends NotGate implements BasicGUIComponent { return new Rectangle(0, 0, 20, 10); } + @Override public void render(GeneralGC gc) { @@ -54,18 +57,20 @@ public class GUINotGate extends NotGate implements BasicGUIComponent } @Override - public int getConnectedWireArraysCount() + public int getConnectedWireEndsCount() { - return connectedWireArrays.size(); + return connectedWireEnds.size(); } + @Override - public WireArray getConnectedWireArray(int connectionIndex) + public ReadEnd getConnectedWireEnd(int connectionIndex) { - return connectedWireArrays.get(connectionIndex); + return connectedWireEnds.get(connectionIndex); } + @Override - public Point getWireArrayConnectionPoint(int connectionI) + public Point getWireEndConnectionPoint(int connectionI) { - return wireArrayConnectionPoints.get(connectionI); + return WireEndConnectionPoints.get(connectionI); } } \ No newline at end of file