1 package era.mi.gui.wires;
\r
3 import org.eclipse.swt.graphics.Color;
\r
5 import era.mi.gui.components.BasicGUIComponent;
\r
6 import era.mi.logic.wires.WireArray;
\r
7 import net.haspamelodica.swt.helper.gcs.GeneralGC;
\r
8 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
\r
9 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
\r
11 public class WireConnectionPoint implements BasicGUIComponent
\r
13 private final WireArray wa;
\r
14 private final int wiresCrossing;
\r
16 public WireConnectionPoint(WireArray wa, int wiresCrossing)
\r
19 this.wiresCrossing = wiresCrossing;
\r
23 public void render(GeneralGC gc)
\r
25 Color oldBG = gc.getBackground();
\r
27 gc.setBackground(gc.getDevice().getSystemColor(GUIWire.getSWTColorConstantForBit(wa.getValue())));
\r
28 gc.fillOval(-1, -1, 2, 2);
\r
29 gc.setBackground(oldBG);
\r
33 public Rectangle getBounds()
\r
35 return new Rectangle(0, 0, 0, 0);
\r
39 public int getConnectedWireArraysCount()
\r
41 return wiresCrossing;
\r
45 public WireArray getConnectedWireArray(int connectionIndex)
\r
51 public Point getWireArrayConnectionPoint(int connectionIndex)
\r
53 return new Point(0, 0);
\r