Removed ConnectionPoint causing confusion
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / wires / GUIWire.java
index 99adc4c..7b641ff 100644 (file)
@@ -14,8 +14,9 @@ import net.mograsim.logic.core.types.BitVector;
 import net.mograsim.logic.core.types.BitVectorFormatter;
 import net.mograsim.logic.core.wires.Wire;
 import net.mograsim.logic.core.wires.Wire.ReadEnd;
-import net.mograsim.logic.ui.ColorHelper;
 import net.mograsim.logic.ui.model.ViewModelModifiable;
+import net.mograsim.preferences.ColorDefinition;
+import net.mograsim.preferences.ColorManager;
 
 /**
  * A wire connecting exactly two {@link Pin}s.
@@ -276,7 +277,10 @@ public class GUIWire
         */
        public void render(GeneralGC gc)
        {
-               ColorHelper.executeWithDifferentForeground(gc, BitVectorFormatter.formatAsColor(end), () -> gc.drawPolyline(effectivePath));
+               ColorDefinition wireColor = BitVectorFormatter.formatAsColor(end);
+               if (wireColor != null)
+                       gc.setForeground(ColorManager.current().toColor(wireColor));
+               gc.drawPolyline(effectivePath);
        }
 
        /**
@@ -312,6 +316,8 @@ public class GUIWire
 
        /**
         * Returns whether this {@link GUIWire} has a logic model binding or not.
+        * 
+        * @author Daniel Kirschten
         */
        public boolean hasLogicModelBinding()
        {
@@ -321,6 +327,8 @@ public class GUIWire
        /**
         * If this {@link GUIWire} has a logic model binding, delegates to {@link Wire#forceValues(BitVector)} for the {@link Wire}
         * corresponding to this {@link GUIWire}.
+        * 
+        * @author Daniel Kirschten
         */
        public void forceWireValues(BitVector values)
        {
@@ -330,6 +338,8 @@ public class GUIWire
        /**
         * If this {@link GUIWire} has a logic model binding, delegates to {@link ReadEnd#getValues()} for the {@link ReadEnd} corresponding to
         * this {@link GUIWire}.
+        * 
+        * @author Daniel Kirschten
         */
        public BitVector getWireValues()
        {