\r
public class GUIMux extends Mux implements BasicGUIComponent\r
{\r
- private final double height;\r
- private final List<WireArray> connectedWireArrays;\r
- private final List<Point> wireArrayConnectionPoints;\r
+ private final double height;\r
+ private final List<WireArray> connectedWireArrays;\r
+ private final List<Point> wireArrayConnectionPoints;\r
\r
public GUIMux(int processTime, WireArray out, WireArray select, WireArray... inputs)\r
{\r
super(processTime, out, select, inputs);\r
\r
double height = inputs.length * 5;\r
- if(height < 10)\r
+ if (height < 10)\r
height = 10;\r
this.height = height;\r
\r
connectedWireArraysModifiable.addAll(Arrays.asList(inputs));\r
double inputHeightIncrement = (height + 20) / inputs.length;\r
double inputHeight = inputHeightIncrement / 2;\r
- for(int i = 0; i < inputs.length; i ++, inputHeight += inputHeightIncrement)\r
+ for (int i = 0; i < inputs.length; i++, inputHeight += inputHeightIncrement)\r
wireArrayConnectionPointsModifiable.add(new Point(0, inputHeight));\r
}\r
\r
{\r
return new Rectangle(0, 0, 20, height + 20);\r
}\r
+\r
@Override\r
public void render(GeneralGC gc)\r
{\r
- gc.drawPolygon(new double[] {\r
- 0, 0,\r
- 20, 10,\r
- 20, height + 10,\r
- 0, height + 20});\r
+ gc.drawPolygon(new double[] { 0, 0, 20, 10, 20, height + 10, 0, height + 20 });\r
}\r
+\r
@Override\r
public int getConnectedWireArraysCount()\r
{\r
return connectedWireArrays.size();\r
}\r
+\r
@Override\r
public WireArray getConnectedWireArray(int connectionIndex)\r
{\r
return connectedWireArrays.get(connectionIndex);\r
}\r
+\r
@Override\r
public Point getWireArrayConnectionPoint(int connectionI)\r
{\r