public GUIManualSwitch(ViewModelModifiable model, String name)
{
super(model, name);
- logicObs = (i) -> requestRedraw();
+ logicObs = (i) -> model.requestRedraw();
setSize(width, height);
addPin(this.outputPin = new Pin(this, "", 1, width, height / 2));
public void render(GeneralGC gc, Rectangle visibleRegion)
{
// TODO maybe draw switch state too?
- 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());
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);