X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fwires%2FWireConnectionPoint.java;fp=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fwires%2FWireConnectionPoint.java;h=9c1aae1480ac72b1bd83618bf8adfc79fee47db4;hb=d3a382377768fdb1434d5baebf73c9413e61e46f;hp=0000000000000000000000000000000000000000;hpb=0cfea6ef89dea8a797708ff685aa2ef9aefd85b9;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/wires/WireConnectionPoint.java b/LogicUI/src/era/mi/gui/wires/WireConnectionPoint.java new file mode 100644 index 00000000..9c1aae14 --- /dev/null +++ b/LogicUI/src/era/mi/gui/wires/WireConnectionPoint.java @@ -0,0 +1,51 @@ +package era.mi.gui.wires; + +import org.eclipse.swt.graphics.Color; + +import era.mi.gui.components.BasicGUIComponent; +import era.mi.logic.wires.WireArray; +import net.haspamelodica.swt.helper.gcs.GeneralGC; +import net.haspamelodica.swt.helper.swtobjectwrappers.Point; +import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; + +public class WireConnectionPoint implements BasicGUIComponent +{ + private final WireArray wa; + private final int wiresCrossing; + + public WireConnectionPoint(WireArray wa, int wiresCrossing) + { + this.wa = wa; + this.wiresCrossing = wiresCrossing; + } + + @Override + public void render(GeneralGC gc) + { + Color oldBG = gc.getBackground(); + Color fg = gc.getForeground(); + gc.setBackground(fg); + gc.fillOval(-2, -2, 4, 4); + gc.setBackground(oldBG); + } + @Override + public Rectangle getBounds() + { + return new Rectangle(0, 0, 0, 0); + } + @Override + public int getConnectedWireArraysCount() + { + return wiresCrossing; + } + @Override + public WireArray getConnectedWireArray(int connectionIndex) + { + return wa; + } + @Override + public Point getWireArrayConnectionPoint(int connectionIndex) + { + return new Point(0, 0); + } +} \ No newline at end of file