Speedup by changing redraw listener system
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / model / components / atomic / GUIBitDisplay.java
index 46c8546..c837fd4 100644 (file)
@@ -36,7 +36,7 @@ public class GUIBitDisplay extends GUIComponent
        public GUIBitDisplay(ViewModelModifiable model, String name)
        {
                super(model, name);
-               logicObs = (i) -> requestRedraw();
+               logicObs = (i) -> model.requestRedraw();
 
                setSize(width, height);
                addPin(this.inputPin = new Pin(this, "", 1, 0, height / 2));
@@ -45,7 +45,7 @@ public class GUIBitDisplay extends GUIComponent
        @Override
        public void render(GeneralGC gc, Rectangle visibleRegion)
        {
-               Color foreground = Preferences.current().getColor("net.mograsim.logic.ui.color.foreground");
+               Color foreground = Preferences.current().getColor("net.mograsim.logic.model.color.foreground");
                if (foreground != null)
                        gc.setForeground(foreground);
                gc.drawRectangle(getBounds());
@@ -55,7 +55,7 @@ public class GUIBitDisplay extends GUIComponent
                Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
                gc.setFont(labelFont);
                Point textExtent = gc.textExtent(label);
-               Color textColor = Preferences.current().getColor("net.mograsim.logic.ui.color.text");
+               Color textColor = Preferences.current().getColor("net.mograsim.logic.model.color.text");
                if (textColor != null)
                        gc.setForeground(textColor);
                gc.drawText(label, getPosX() + (width - textExtent.x) / 2, getPosY() + (height - textExtent.y) / 2, true);