import java.util.Map;
import java.util.TreeMap;
+import org.eclipse.swt.graphics.Color;
+
import net.haspamelodica.swt.helper.gcs.GeneralGC;
import net.haspamelodica.swt.helper.swtobjectwrappers.Font;
import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
-import net.mograsim.logic.ui.model.ModelVisitor;
import net.mograsim.logic.ui.model.ViewModelModifiable;
import net.mograsim.logic.ui.model.wires.MovablePin;
import net.mograsim.logic.ui.model.wires.Pin;
+import net.mograsim.preferences.Preferences;
public class SimpleRectangularSubmodelComponent extends SubmodelComponent
{
Font oldFont = gc.getFont();
gc.setFont(new Font(oldFont.getName(), labelFontHeight, oldFont.getStyle()));
Point textExtent = gc.textExtent(label);
+ Color textColor = Preferences.current().getColor("net.mograsim.logic.ui.color.text");
+ if (textColor != null)
+ gc.setForeground(textColor);
gc.drawText(label, getPosX() + (getWidth() - textExtent.x) / 2, getPosY() + (getHeight() - textExtent.y) / 2, true);
gc.setFont(new Font(oldFont.getName(), pinNameFontHeight, oldFont.getStyle()));
for (int i = 0; i < inputPinNames.size(); i++)
@Override
protected void renderOutline(GeneralGC gc, Rectangle visibleRegion)
{
+ Color foreground = Preferences.current().getColor("net.mograsim.logic.ui.color.foreground");
+ if (foreground != null)
+ gc.setForeground(foreground);
gc.drawRectangle(getBounds());
}
throw new UnsupportedOperationException(
"Can't set the size of a SimpleRectangularSubmodelComponent directly, call setInputPins / setOutputPins instead");
}
-
- @Override
- public void accept(ModelVisitor mv)
- {
- mv.visit(this);
- }
}
\ No newline at end of file