X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fcomponents%2FGUIAndGate.java;h=fa51232b8770fa07cb22e3034d68772036ed6d6f;hb=fb169b120e97337093a8707c62bbc4bb06098a9c;hp=8ff6068c8361e6241e9e9d27647cd20d0dcb7174;hpb=d3a382377768fdb1434d5baebf73c9413e61e46f;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/components/GUIAndGate.java b/LogicUI/src/era/mi/gui/components/GUIAndGate.java index 8ff6068c..fa51232b 100644 --- a/LogicUI/src/era/mi/gui/components/GUIAndGate.java +++ b/LogicUI/src/era/mi/gui/components/GUIAndGate.java @@ -16,10 +16,10 @@ public class GUIAndGate extends AndGate implements BasicGUIComponent { private static final String LABEL = "&"; - private final int inputCount; - private final double height; - private final List connectedWireArrays; - private final List wireArrayConnectionPoints; + private final int inputCount; + private final double height; + private final List connectedWireArrays; + private final List wireArrayConnectionPoints; public GUIAndGate(int processTime, WireArray out, WireArray... in) { @@ -34,7 +34,7 @@ public class GUIAndGate extends AndGate implements BasicGUIComponent { connectedWireArraysModifiable.addAll(Arrays.asList(in)); double inputHeight = 5; - for(int i = 0; i < inputCount; i ++, inputHeight += 10) + for (int i = 0; i < inputCount; i++, inputHeight += 10) wireArrayConnectionPointsModifiable.add(new Point(0, inputHeight)); } @@ -50,17 +50,17 @@ public class GUIAndGate extends AndGate implements BasicGUIComponent { return new Rectangle(0, 0, 20, height); } + @Override public void render(GeneralGC gc) { - gc.drawRectangle(0, 0, 17, height); + gc.drawRectangle(0, 0, 20, height); Font oldFont = gc.getFont(); Font labelFont = new Font(oldFont.getName(), 5, oldFont.getStyle()); gc.setFont(labelFont); Point textExtent = gc.textExtent(LABEL); - gc.drawText(LABEL, 8.5 - textExtent.x / 2, (height - textExtent.y) / 2, true); + gc.drawText(LABEL, 10 - textExtent.x / 2, (height - textExtent.y) / 2, true); gc.setFont(oldFont); - gc.drawOval(17, height / 2 - 1.5, 3, 3); } @Override @@ -68,11 +68,13 @@ public class GUIAndGate extends AndGate implements BasicGUIComponent { return connectedWireArrays.size(); } + @Override public WireArray getConnectedWireArray(int connectionIndex) { return connectedWireArrays.get(connectionIndex); } + @Override public Point getWireArrayConnectionPoint(int connectionI) {