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 1124233..22868cc 100644 (file)
@@ -9,6 +9,7 @@ import net.mograsim.logic.core.LogicObserver;
 import net.mograsim.logic.core.types.BitVectorFormatter;
 import net.mograsim.logic.core.wires.Wire.ReadEnd;
 import net.mograsim.logic.ui.ColorHelper;
+import net.mograsim.logic.ui.model.ModelVisitor;
 import net.mograsim.logic.ui.model.ViewModelModifiable;
 import net.mograsim.logic.ui.model.components.GUIComponent;
 import net.mograsim.logic.ui.model.components.SimpleRectangularGUIGate;
@@ -42,9 +43,8 @@ public class WireCrossPoint extends GUIComponent
        @Override
        public void render(GeneralGC gc, Rectangle visibleRegion)
        {
-               Rectangle bounds = getBounds();
                ColorHelper.executeWithDifferentBackground(gc, BitVectorFormatter.formatAsColor(end),
-                               () -> gc.fillOval(bounds.x, bounds.y, CIRCLE_DIAM, CIRCLE_DIAM));
+                               () -> gc.fillOval(getPosX(), getPosY(), CIRCLE_DIAM, CIRCLE_DIAM));
        }
 
        public void setLogicModelBinding(ReadEnd end)
@@ -84,4 +84,9 @@ public class WireCrossPoint extends GUIComponent
                return m;
        }
 
+       @Override
+       public void accept(ModelVisitor mv)
+       {
+               mv.visit(this);
+       }
 }
\ No newline at end of file