fixes color handling

This commit is contained in:
Eyck Jentzsch 2023-02-28 12:12:47 +01:00
parent 463dad60b9
commit 5670977d52
5 changed files with 9 additions and 3 deletions

View File

@ -14,7 +14,7 @@ public enum WaveformColors {
LINE, LINE_HIGHLITE,
TRACK_BG_EVEN, TRACK_BG_ODD, TRACK_BG_HIGHLITE,
TX_BG, TX_BG_HIGHLITE, TX_BORDER,
SIGNAL0, SIGNAL1, SIGNALZ, SIGNALX, SIGNALU, SIGNAL_TEXT, SIGNAL_REAL, SIGNAL_NAN,
SIGNAL0, SIGNAL1, SIGNALZ, SIGNALX, SIGNAL_CHANGE, SIGNALU, SIGNAL_TEXT, SIGNAL_REAL, SIGNAL_NAN,
CURSOR, CURSOR_DRAG, CURSOR_TEXT,
MARKER, MARKER_TEXT, REL_ARROW, REL_ARROW_HIGHLITE, BLANK
}

View File

@ -39,6 +39,7 @@ public class DefaultWaveformStyleProvider implements IWaveformStyleProvider {
colors[WaveformColors.SIGNALZ.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_DARK_YELLOW);
colors[WaveformColors.SIGNALX.ordinal()] = SWTResourceManager.getColor(255, 51, 51);
colors[WaveformColors.SIGNALU.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_YELLOW);
colors[WaveformColors.SIGNAL_CHANGE.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_GREEN);
colors[WaveformColors.SIGNAL_TEXT.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_WHITE);
colors[WaveformColors.SIGNAL_REAL.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_YELLOW);
colors[WaveformColors.SIGNAL_NAN.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_RED);

View File

@ -191,7 +191,7 @@ public class SignalPainter extends TrackPainter {
}
public void draw(Projection proj, Rectangle area, IEvent left, IEvent right, int xBegin, int xEnd, boolean multiple) {
Color colorBorder = waveCanvas.styleProvider.getColor(WaveformColors.SIGNAL0);
Color colorBorder = waveCanvas.styleProvider.getColor(WaveformColors.SIGNAL_CHANGE);
BitVector last = (BitVector) left;
if (Arrays.toString(last.getValue()).contains("X")) {
colorBorder = waveCanvas.styleProvider.getColor(WaveformColors.SIGNALX);
@ -340,8 +340,11 @@ public class SignalPainter extends TrackPainter {
break;
default:
}
if (yOffset != yNext)
if (yOffset != yNext) {
Color transition_color = waveCanvas.styleProvider.getColor(WaveformColors.SIGNAL_CHANGE);
proj.setForeground(transition_color);
proj.drawLine(xEnd, yOffset, xEnd, yNext);
}
}
}
}

View File

@ -78,6 +78,7 @@ public class Messages extends NLS {
public static String signalz;
public static String signalx;
public static String signalu;
public static String signal_change;
public static String signal_text;
public static String signal_real;
public static String signal_nan;

View File

@ -72,6 +72,7 @@ signal1=Signal Value '1'
signalz=Signal Value 'Z'
signalx=Signal Value 'X'
signalu=Signal Value 'U'
signal_change=Signal change
signal_text=Signal text
signal_real=Signal real Value
signal_nan=Signal NaN Value