Logic model binding of WireCrossPoints is now being set
[Mograsim.git] / LogicUI / src / era / mi / gui / model / wires / WireCrossPoint.java
index ebe30c3..724de54 100644 (file)
@@ -10,13 +10,17 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 
 public class WireCrossPoint extends GUIComponent
 {
+       private final Pin pin;
+
        private ReadEnd end;
+       private final int logicWidth;
 
-       public WireCrossPoint(ViewModel model)
+       public WireCrossPoint(ViewModel model, int logicWidth)
        {
                super(model);
+               this.logicWidth = logicWidth;
                setSize(0, 0);
-               addPin(new Pin(this, 0, 0));
+               addPin(this.pin = new Pin(this, logicWidth, 0, 0));
        }
 
        @Override
@@ -28,6 +32,16 @@ public class WireCrossPoint extends GUIComponent
        public void setLogicModelBinding(ReadEnd end)
        {
                this.end = end;
-               end.addObserver((i, o) -> callComponentChangedListeners());
+               end.addObserver((i, o) -> callComponentLookChangedListeners());
+       }
+
+       public int getLogicWidth()
+       {
+               return logicWidth;
+       }
+
+       public Pin getPin()
+       {
+               return pin;
        }
 }
\ No newline at end of file