public class BitVectorFormatter
{
- public static String formatValueAsString(ReadEnd end)
+ public static String formatValueAsString(ReadEnd end, boolean useDashInsteadOfZ)
{
- return formatAsString(end == null ? null : end.getValues());
+ return formatAsString(end == null ? null : end.getValues(), useDashInsteadOfZ);
}
public static String toBitstring(BitVector bitVector)
return bitVector.toBitstring();
}
- public static String formatAsString(BitVector bitVector)
+ public static String formatAsString(BitVector bitVector, boolean useDashInsteadOfZ)
{
if (bitVector == null)
return "null";
sb.append(hexdigits);
return sb.toString();
}
- if (bitVector.isHighImpedance())
+ if (useDashInsteadOfZ && bitVector.isHighImpedance())
return "-";
return bitVector.toBitstring();
}
if (foreground != null)
gc.setForeground(foreground);
gc.drawRectangle(getBounds());
- String label = BitVectorFormatter.formatAsString(bitDisplay == null ? null : 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);
if (foreground != null)
gc.setForeground(foreground);
gc.drawRectangle(getBounds());
- String label = BitVectorFormatter.formatAsString(bits);
+ String label = BitVectorFormatter.formatAsString(bits, false);
Font oldFont = gc.getFont();
Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
gc.setFont(labelFont);
if (foreground != null)
gc.setForeground(foreground);
gc.drawRectangle(getBounds());
- String label = BitVectorFormatter.formatAsString(manualSwitch == null ? null : getOutValues());
+ String label = BitVectorFormatter.formatAsString(manualSwitch == null ? null : getOutValues(), false);
Font oldFont = gc.getFont();
Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
gc.setFont(labelFont);
public String getValueString()
{
- return BitVectorFormatter.formatAsString(getMachine().getRegister(machineRegister));
+ return BitVectorFormatter.formatAsString(getMachine().getRegister(machineRegister), false);
}
@Override