Completely changed the structure and switched to Eclipse Plugin.
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / wires / WireCrossPoint.java
index ed4407d..2b07238 100644 (file)
@@ -9,6 +9,7 @@ import net.mograsim.logic.core.LogicObserver;
 import net.mograsim.logic.core.types.BitVectorFormatter;\r
 import net.mograsim.logic.core.wires.Wire.ReadEnd;\r
 import net.mograsim.logic.ui.ColorHelper;\r
+import net.mograsim.logic.ui.model.ModelVisitor;\r
 import net.mograsim.logic.ui.model.ViewModelModifiable;\r
 import net.mograsim.logic.ui.model.components.GUIComponent;\r
 import net.mograsim.logic.ui.model.components.SimpleRectangularGUIGate;\r
@@ -42,9 +43,8 @@ public class WireCrossPoint extends GUIComponent
        @Override\r
        public void render(GeneralGC gc, Rectangle visibleRegion)\r
        {\r
-               Rectangle bounds = getBounds();\r
                ColorHelper.executeWithDifferentBackground(gc, BitVectorFormatter.formatAsColor(end),\r
-                               () -> gc.fillOval(bounds.x, bounds.y, CIRCLE_DIAM, CIRCLE_DIAM));\r
+                               () -> gc.fillOval(getPosX(), getPosY(), CIRCLE_DIAM, CIRCLE_DIAM));\r
        }\r
 \r
        public void setLogicModelBinding(ReadEnd end)\r
@@ -84,4 +84,9 @@ public class WireCrossPoint extends GUIComponent
                return m;\r
        }\r
 \r
+       @Override\r
+       public void accept(ModelVisitor mv)\r
+       {\r
+               mv.visit(this);\r
+       }\r
 }
\ No newline at end of file