Skip to content

Commit 3623288

Browse files
committed
CSSTUDIO-3346 Add WidgetPropertyListenser for the "Show Warnings"-property.
1 parent ae04b41 commit 3623288

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

app/display/linearmeter/src/main/java/org/csstudio/display/extra/widgets/linearmeter/LinearMeterRepresentation.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ protected void registerListeners()
115115
addUntypedWidgetPropertyListener(model_widget.propFont(), layoutChangedListener);
116116
addUntypedWidgetPropertyListener(model_widget.propNeedleColor(), layoutChangedListener);
117117

118+
addWidgetPropertyListener(model_widget.propShowWarnings(), (property, oldValue, newValue) -> {
119+
meter.setShowWarnings(newValue);
120+
layoutChanged(null, null, null);
121+
});
122+
118123
addWidgetPropertyListener(model_widget.propShowUnits(), (property, old_value, new_value) -> {
119124
meter.setShowUnits(new_value);
120125
layoutChanged(null, null, null);

app/display/linearmeter/src/main/java/org/csstudio/display/extra/widgets/linearmeter/RTLinearMeter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,11 @@ public void setFont(javafx.scene.text.Font font)
577577
}
578578

579579
private boolean showWarnings = true;
580+
581+
public void setShowWarnings(boolean showWarnings) {
582+
runOnJavaFXThread(() -> { this.showWarnings = showWarnings; });
583+
}
584+
580585
private boolean lag = false;
581586
private Boolean isValueWaitingToBeDrawn = false;
582587
private double valueWaitingToBeDrawn;

0 commit comments

Comments
 (0)