BitDisplay, ManualSwitch now Observable. More Docs added in Timeline.
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / wires / WireCrossPoint.java
index 0949ffb..b4aaa98 100644 (file)
@@ -1,49 +1,49 @@
-package net.mograsim.logic.ui.model.wires;
-
-import net.mograsim.logic.ui.ColorHelper;
-import net.mograsim.logic.ui.model.ViewModel;
-import net.mograsim.logic.ui.model.components.GUIComponent;
-import net.haspamelodica.swt.helper.gcs.GeneralGC;
-import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
-import net.mograsim.logic.core.types.BitVectorFormatter;
-import net.mograsim.logic.core.wires.Wire.ReadEnd;
-
-public class WireCrossPoint extends GUIComponent
-{
-       private final Pin pin;
-
-       private ReadEnd end;
-       private final int logicWidth;
-
-       public WireCrossPoint(ViewModel model, int logicWidth)
-       {
-               super(model);
-               this.logicWidth = logicWidth;
-               setSize(0, 0);
-               addPin(this.pin = new Pin(this, logicWidth, 0, 0));
-       }
-
-       @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
-       {
-               Rectangle bounds = getBounds();
-               ColorHelper.executeWithDifferentBackground(gc, BitVectorFormatter.formatAsColor(end),
-                               () -> gc.fillOval(bounds.x - 1, bounds.y - 1, 2, 2));
-       }
-
-       public void setLogicModelBinding(ReadEnd end)
-       {
-               this.end = end;
-               end.addObserver((i, o) -> callComponentLookChangedListeners());
-       }
-
-       public int getLogicWidth()
-       {
-               return logicWidth;
-       }
-
-       public Pin getPin()
-       {
-               return pin;
-       }
+package net.mograsim.logic.ui.model.wires;\r
+\r
+import net.mograsim.logic.ui.ColorHelper;\r
+import net.mograsim.logic.ui.model.ViewModel;\r
+import net.mograsim.logic.ui.model.components.GUIComponent;\r
+import net.haspamelodica.swt.helper.gcs.GeneralGC;\r
+import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;\r
+import net.mograsim.logic.core.types.BitVectorFormatter;\r
+import net.mograsim.logic.core.wires.Wire.ReadEnd;\r
+\r
+public class WireCrossPoint extends GUIComponent\r
+{\r
+       private final Pin pin;\r
+\r
+       private ReadEnd end;\r
+       private final int logicWidth;\r
+\r
+       public WireCrossPoint(ViewModel model, int logicWidth)\r
+       {\r
+               super(model);\r
+               this.logicWidth = logicWidth;\r
+               setSize(0, 0);\r
+               addPin(this.pin = new Pin(this, logicWidth, 0, 0));\r
+       }\r
+\r
+       @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 - 1, bounds.y - 1, 2, 2));\r
+       }\r
+\r
+       public void setLogicModelBinding(ReadEnd end)\r
+       {\r
+               this.end = end;\r
+               end.registerObserver((i) -> callComponentLookChangedListeners());\r
+       }\r
+\r
+       public int getLogicWidth()\r
+       {\r
+               return logicWidth;\r
+       }\r
+\r
+       public Pin getPin()\r
+       {\r
+               return pin;\r
+       }\r
 }
\ No newline at end of file