1 package era.mi.gui.model.wires;
3 import era.mi.gui.ColorHelper;
4 import era.mi.gui.model.ViewModel;
5 import era.mi.gui.model.components.GUIComponent;
6 import era.mi.logic.types.BitVectorFormatter;
7 import era.mi.logic.wires.Wire.ReadEnd;
8 import net.haspamelodica.swt.helper.gcs.GeneralGC;
9 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
11 public class WireCrossPoint extends GUIComponent
13 private final Pin pin;
16 private final int logicWidth;
18 public WireCrossPoint(ViewModel model, int logicWidth)
21 this.logicWidth = logicWidth;
23 addPin(this.pin = new Pin(this, logicWidth, 0, 0));
27 public void render(GeneralGC gc, Rectangle visibleRegion)
29 ColorHelper.executeWithDifferentBackground(gc, BitVectorFormatter.formatAsColor(end), () -> gc.fillOval(-1, -1, 2, 2));
32 public void setLogicModelBinding(ReadEnd end)
35 end.addObserver((i, o) -> callComponentLookChangedListeners());
38 public int getLogicWidth()