import net.mograsim.logic.core.LogicObserver;
import net.mograsim.logic.core.components.BitDisplay;
import net.mograsim.logic.core.types.BitVectorFormatter;
-import net.mograsim.logic.ui.model.ViewModel;
+import net.mograsim.logic.ui.model.ViewModelModifiable;
import net.mograsim.logic.ui.model.wires.Pin;
public class GUIBitDisplay extends GUIComponent
private final LogicObserver logicObs;
private BitDisplay bitDisplay;
- public GUIBitDisplay(ViewModel model)
+ public GUIBitDisplay(ViewModelModifiable model)
{
super(model);
- logicObs = (i) -> callComponentLookChangedListeners();
+ logicObs = (i) -> requestRedraw();
setSize(width, height);
addPin(this.inputPin = new Pin(this, 1, 0, height / 2));
double posY = getBounds().y;
// TODO maybe draw switch state too?
- gc.drawRectangle(posX, posY, width, height);
+ gc.drawRectangle(getBounds());
String label = bitDisplay == null ? BitVectorFormatter.formatAsString(null)
: BitVectorFormatter.formatAsString(bitDisplay.getDisplayedValue());
Font oldFont = gc.getFont();