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.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());
}
ret.type = SimpleRectangularSubmodelComponent.class.getSimpleName();
Map<String, Object> m = new TreeMap<>();
m.put(kLabel, label);
- m.put(kInCount, inputPinNames.size());
- m.put(kOutCount, outputPinNames.size());
+ m.put(kInCount, inputPinNames.toArray());
+ m.put(kOutCount, outputPinNames.toArray());
m.put(kLogicWidth, logicWidth);
ret.specialized = m;
return ret;