X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fcomponents%2FGUIMux.java;fp=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fcomponents%2FGUIMux.java;h=88ccbd73a0e2b1c370699cd1f74afde071771d47;hb=873c7cd58e0a035e68b5af352260da9f4d667c96;hp=0082a768521842abbac122f3e7545bc3cb8ae205;hpb=340eb95b6ab64f2c1a784d1dc36002537b1cbd15;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/components/GUIMux.java b/LogicUI/src/era/mi/gui/components/GUIMux.java index 0082a768..88ccbd73 100644 --- a/LogicUI/src/era/mi/gui/components/GUIMux.java +++ b/LogicUI/src/era/mi/gui/components/GUIMux.java @@ -13,16 +13,16 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; public class GUIMux extends Mux implements BasicGUIComponent { - private final double height; - private final List connectedWireArrays; - private final List wireArrayConnectionPoints; + private final double height; + private final List connectedWireArrays; + private final List wireArrayConnectionPoints; public GUIMux(int processTime, WireArray out, WireArray select, WireArray... inputs) { super(processTime, out, select, inputs); double height = inputs.length * 5; - if(height < 10) + if (height < 10) height = 10; this.height = height; @@ -39,7 +39,7 @@ public class GUIMux extends Mux implements BasicGUIComponent connectedWireArraysModifiable.addAll(Arrays.asList(inputs)); double inputHeightIncrement = (height + 20) / inputs.length; double inputHeight = inputHeightIncrement / 2; - for(int i = 0; i < inputs.length; i ++, inputHeight += inputHeightIncrement) + for (int i = 0; i < inputs.length; i++, inputHeight += inputHeightIncrement) wireArrayConnectionPointsModifiable.add(new Point(0, inputHeight)); } @@ -52,25 +52,25 @@ public class GUIMux extends Mux implements BasicGUIComponent { return new Rectangle(0, 0, 20, height + 20); } + @Override public void render(GeneralGC gc) { - gc.drawPolygon(new double[] { - 0, 0, - 20, 10, - 20, height + 10, - 0, height + 20}); + gc.drawPolygon(new double[] { 0, 0, 20, 10, 20, height + 10, 0, height + 20 }); } + @Override public int getConnectedWireArraysCount() { return connectedWireArrays.size(); } + @Override public WireArray getConnectedWireArray(int connectionIndex) { return connectedWireArrays.get(connectionIndex); } + @Override public Point getWireArrayConnectionPoint(int connectionI) {