Made ModelBitDisplay/ManualSwitch smaller
[Mograsim.git] / plugins / net.mograsim.logic.model / src / net / mograsim / logic / model / model / components / atomic / ModelBitDisplay.java
index 5be3e22..8bff082 100644 (file)
@@ -8,7 +8,6 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.core.LogicObserver;
 import net.mograsim.logic.core.components.CoreBitDisplay;
-import net.mograsim.logic.core.types.BitVector;
 import net.mograsim.logic.core.types.BitVectorFormatter;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
@@ -23,7 +22,7 @@ import net.mograsim.preferences.Preferences;
 public class ModelBitDisplay extends ModelComponent
 {
        private static final double width = 20;
-       private static final double height = 15;
+       private static final double height = 10;
        private static final double fontHeight = 5;
 
        public final int logicWidth;
@@ -56,15 +55,7 @@ public class ModelBitDisplay extends ModelComponent
                if (foreground != null)
                        gc.setForeground(foreground);
                gc.drawRectangle(getBounds());
-               String label;
-               if (bitDisplay == null)
-                       label = BitVectorFormatter.formatAsString(null);
-               else
-               {
-                       BitVector toDisplay = bitDisplay.getDisplayedValue();
-                       label = toDisplay != null && toDisplay.isHighImpedance() ? "-"
-                                       : BitVectorFormatter.formatAsString(bitDisplay.getDisplayedValue());
-               }
+               String label = BitVectorFormatter.formatAsString(bitDisplay == null ? null : bitDisplay.getDisplayedValue(), true);
                Font oldFont = gc.getFont();
                Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
                gc.setFont(labelFont);