@@ -20,38 +20,45 @@ public class FontColorsDialog {
2020 private ColorPicker algebraicInputColorPicker , symbolicInputColorPicker ,
2121 algebraicOutputColorPicker , symbolicOutputColorPicker , warningColorPicker , errorColorPicker ;
2222
23- private ObjectProperty <Color > warningColorPickerValueProperty ;
24- private ObjectBinding <Background > warningLabelBackgroundBinding ;
25-
2623 @ FXML
2724 private void initialize () {
2825 algebraicInputLabel .textFillProperty ().bind (algebraicInputColorPicker .valueProperty ());
2926 symbolicInputLabel .textFillProperty ().bind (symbolicInputColorPicker .valueProperty ());
3027 algebraicOutputLabel .textFillProperty ().bind (algebraicOutputColorPicker .valueProperty ());
3128 symbolicOutputLabel .textFillProperty ().bind (symbolicOutputColorPicker .valueProperty ());
32- warningColorPickerValueProperty = warningColorPicker .valueProperty ();
33- warningLabelBackgroundBinding = new ObjectBinding <>() {
29+ warningLabel .backgroundProperty ().bind (new ObjectBinding <>() {
30+ final ObjectProperty <Color > colorObjectProperty = warningColorPicker .valueProperty ();
31+
3432 {
35- super .bind (warningColorPickerValueProperty );
33+ super .bind (colorObjectProperty );
3634 }
3735
3836 @ Override
3937 protected Background computeValue () {
4038 return new Background (
41- new BackgroundFill (warningColorPickerValueProperty .get (), null , null ));
39+ new BackgroundFill (colorObjectProperty .get (), null , null ));
40+ }
41+ });
42+ errorLabel .backgroundProperty ().bind (new ObjectBinding <>() {
43+ final ObjectProperty <Color > colorObjectProperty = errorColorPicker .valueProperty ();
44+
45+ {
46+ super .bind (colorObjectProperty );
4247 }
43- };
44- warningLabel .backgroundProperty ().bind (warningLabelBackgroundBinding );
48+
49+ @ Override
50+ protected Background computeValue () {
51+ return new Background (
52+ new BackgroundFill (colorObjectProperty .get (), null , null ));
53+ }
54+ });
4555
4656 algebraicInputColorPicker .setValue (Color .web (FontColors .algebraicInput ));
4757 symbolicInputColorPicker .setValue (Color .web (FontColors .symbolicInput ));
4858 algebraicOutputColorPicker .setValue (Color .web (FontColors .algebraicOutput ));
4959 symbolicOutputColorPicker .setValue (Color .web (FontColors .symbolicOutput ));
5060 warningColorPicker .setValue (Color .web (FontColors .warning ));
5161 errorColorPicker .setValue (Color .web (FontColors .error ));
52-
53- // warningLabel.setBackground(new Background(new BackgroundFill(color, null, null)));
54- // errorLabel.setBackground(new Background(new BackgroundFill(color, null, null)));
5562 }
5663
5764 /**
0 commit comments