public class GUIOrGate extends OrGate implements BasicGUIComponent
{
- private static final String LABEL = "\u22651";//>=1
+ private static final String LABEL = "\u22651";// >=1
- private final int inputCount;
- private final double height;
- private final List<WireArray> connectedWireArrays;
- private final List<Point> wireArrayConnectionPoints;
+ private final int inputCount;
+ private final double height;
+ private final List<WireArray> connectedWireArrays;
+ private final List<Point> wireArrayConnectionPoints;
public GUIOrGate(int processTime, WireArray out, WireArray... in)
{
{
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));
}
{
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
{
return connectedWireArrays.size();
}
+
@Override
public WireArray getConnectedWireArray(int connectionIndex)
{
return connectedWireArrays.get(connectionIndex);
}
+
@Override
public Point getWireArrayConnectionPoint(int connectionI)
{