@@ -90,77 +90,8 @@ public class TaskEditorController implements Initializable {
90
90
private static final ToggleGroup denTG = new ToggleGroup ();
91
91
public static TaskInterface existingTaskToEdit = null ;
92
92
public static Squid3Constants .TaskEditTypeEnum editType = Squid3Constants .TaskEditTypeEnum .EDIT_CURRENT ;
93
- private static TaskDesign taskEditor ;
94
- @ FXML
95
- private static TextField uncorrConstPbUExpressionText ;
96
- @ FXML
97
- private static TextField uncorrConstPbThExpressionText ;
98
- @ FXML
99
- private static TextField parentConcExpressionText ;
100
- @ FXML
101
- private static TextField pb208Th232ExpressionText ;
102
- @ FXML
103
- private static TextFlow defaultRatiosListTextFlow ;
104
93
private static Map <String , ExpressionTreeInterface > namedExpressionsMap = new TreeMap <>(String .CASE_INSENSITIVE_ORDER );
105
94
private static boolean amGeochronMode ;
106
-
107
- static {
108
- addBtnHBox .setAlignment (Pos .CENTER );
109
- addBtn .setStyle (
110
- "-fx-padding: 5 22 5 22;\n "
111
- + " -fx-border-color: #e2e2e2;"
112
- + " -fx-border-width: 2;"
113
- + " -fx-background-radius: 0;"
114
- + " -fx-background-color: #FB6D42;"
115
- + " -fx-font-family: SansSerif;"
116
- + " -fx-font-size: 11pt;"
117
- + " -fx-text-fill: whitesmoke;"
118
- + " -fx-background-insets: 0 0 0 0, 0, 1, 2;" );
119
-
120
- addBtn .setOnMouseClicked ((event ) -> {
121
- taskEditor .addRatioName (numLabel .getText () + "/" + denLabel .getText ());
122
- namedExpressionsMap = taskEditor .buildNamedExpressionsMap ();
123
- populateRatios ();
124
- refreshExpressionAudits ();
125
- updateAddButton ();
126
- });
127
-
128
- updateAddButton ();
129
-
130
- numLabel .setStyle ("-fx-font-family: SansSerif bold;-fx-font-size: 18" );
131
- divLabel .setStyle ("-fx-font-family: SansSerif bold;-fx-font-size: 18" );
132
- denLabel .setStyle ("-fx-font-family: SansSerif bold;-fx-font-size: 18" );
133
-
134
- infoLabelHBox .setAlignment (Pos .CENTER );
135
- AnchorPane pane = new AnchorPane (menuVBox );
136
- AnchorPane .setBottomAnchor (menuVBox , 0.0 );
137
- AnchorPane .setTopAnchor (menuVBox , 0.0 );
138
- AnchorPane .setRightAnchor (menuVBox , 0.0 );
139
- AnchorPane .setLeftAnchor (menuVBox , 0.0 );
140
-
141
- numTG .selectedToggleProperty ().addListener (new ChangeListener <Toggle >() {
142
- public void changed (ObservableValue <? extends Toggle > ob , Toggle o , Toggle n ) {
143
- RadioButton rb = (RadioButton ) numTG .getSelectedToggle ();
144
- if (rb != null ) {
145
- numLabel .setText (rb .getText ());
146
- updateAddButton ();
147
- }
148
- }
149
- });
150
- denTG .selectedToggleProperty ().addListener (new ChangeListener <Toggle >() {
151
- public void changed (ObservableValue <? extends Toggle > ob , Toggle o , Toggle n ) {
152
- RadioButton rb = (RadioButton ) denTG .getSelectedToggle ();
153
- if (rb != null ) {
154
- denLabel .setText (rb .getText ());
155
- updateAddButton ();
156
- }
157
- }
158
- });
159
- ADD_RATIOS_STAGE .setScene (new Scene (pane , 250 , 500 ));
160
- ADD_RATIOS_STAGE .setAlwaysOnTop (true );
161
-
162
- }
163
-
164
95
private final List <StackPane > undoMassesList = new ArrayList <>();
165
96
EventHandler <MouseEvent > mouseEnteredExpressionEventHandler = new EventHandler <MouseEvent >() {
166
97
@ Override
@@ -177,6 +108,17 @@ public void handle(MouseEvent event) {
177
108
}
178
109
}
179
110
};
111
+ private TaskDesign taskEditor ;
112
+ @ FXML
113
+ private TextField uncorrConstPbUExpressionText ;
114
+ @ FXML
115
+ private TextField uncorrConstPbThExpressionText ;
116
+ @ FXML
117
+ private TextField parentConcExpressionText ;
118
+ @ FXML
119
+ private TextField pb208Th232ExpressionText ;
120
+ @ FXML
121
+ private TextFlow defaultRatiosListTextFlow ;
180
122
@ FXML
181
123
private GridPane taskManagerGridPane ;
182
124
@ FXML
@@ -262,7 +204,33 @@ public static VBox makeRatioVBox(String ratioName) {
262
204
return ratio ;
263
205
}
264
206
265
- private static void updateAddButton () {
207
+ private static void tooltipMapPut (Expression exp , String expressionText ) {
208
+ Tooltip audit = new Tooltip (exp .produceExpressionTreeAudit ());
209
+ audit .setStyle (EXPRESSION_TOOLTIP_CSS_STYLE_SPECS );
210
+ Tooltip result = tooltipsMap .put (expressionText , audit );
211
+ if (result != null ) {
212
+ result .hide ();
213
+ }
214
+ }
215
+
216
+ /**
217
+ * @param expressionName
218
+ * @param expressionString
219
+ * @return
220
+ */
221
+ private static Expression makeExpression (String expressionName , final String expressionString ) {
222
+ return makeExpressionForAudit (expressionName , expressionString , namedExpressionsMap );
223
+ }
224
+
225
+ private static void updateExpressionHealthFlag (TextField expressionText , boolean healthy ) {
226
+ if (healthy ) {
227
+ expressionText .setStyle (expressionText .getStyle ().replace ("wrongx_icon" , "icon_checkmark" ));
228
+ } else {
229
+ expressionText .setStyle (expressionText .getStyle ().replace ("icon_checkmark" , "wrongx_icon" ));
230
+ }
231
+ }
232
+
233
+ private void updateAddButton () {
266
234
String num = numLabel .getText ();
267
235
String den = denLabel .getText ();
268
236
boolean valid = (num .compareTo (den ) != 0 )
@@ -272,7 +240,7 @@ private static void updateAddButton() {
272
240
addBtn .setDisable (!valid );
273
241
}
274
242
275
- private static void populateRatios () {
243
+ private void populateRatios () {
276
244
defaultRatiosListTextFlow .getChildren ().clear ();
277
245
defaultRatiosListTextFlow .setMaxHeight (30 );
278
246
int count = 1 ;
@@ -305,7 +273,7 @@ private static void populateRatios() {
305
273
}
306
274
}
307
275
308
- private static void refreshExpressionAudits () {
276
+ private void refreshExpressionAudits () {
309
277
Expression exp = makeExpression (UNCOR206PB238U_CALIB_CONST , uncorrConstPbUExpressionText .getText ());
310
278
tooltipMapPut (exp , UNCOR206PB238U_CALIB_CONST );
311
279
updateExpressionHealthFlag (uncorrConstPbUExpressionText , exp .amHealthy ());
@@ -324,37 +292,66 @@ private static void refreshExpressionAudits() {
324
292
325
293
}
326
294
327
- private static void tooltipMapPut (Expression exp , String expressionText ) {
328
- Tooltip audit = new Tooltip (exp .produceExpressionTreeAudit ());
329
- audit .setStyle (EXPRESSION_TOOLTIP_CSS_STYLE_SPECS );
330
- Tooltip result = tooltipsMap .put (expressionText , audit );
331
- if (result != null ) {
332
- result .hide ();
333
- }
334
- }
335
-
336
- /**
337
- * @param expressionName
338
- * @param expressionString
339
- * @return
340
- */
341
- private static Expression makeExpression (String expressionName , final String expressionString ) {
342
- return makeExpressionForAudit (expressionName , expressionString , namedExpressionsMap );
343
- }
344
-
345
- private static void updateExpressionHealthFlag (TextField expressionText , boolean healthy ) {
346
- if (healthy ) {
347
- expressionText .setStyle (expressionText .getStyle ().replace ("wrongx_icon" , "icon_checkmark" ));
348
- } else {
349
- expressionText .setStyle (expressionText .getStyle ().replace ("icon_checkmark" , "wrongx_icon" ));
350
- }
351
- }
352
-
353
295
/**
354
296
* Initializes the controller class.
355
297
*/
356
298
@ Override
357
299
public void initialize (URL url , ResourceBundle rb ) {
300
+ addBtnHBox .setAlignment (Pos .CENTER );
301
+ addBtn .setStyle (
302
+ "-fx-padding: 5 22 5 22;\n "
303
+ + " -fx-border-color: #e2e2e2;"
304
+ + " -fx-border-width: 2;"
305
+ + " -fx-background-radius: 0;"
306
+ + " -fx-background-color: #FB6D42;"
307
+ + " -fx-font-family: SansSerif;"
308
+ + " -fx-font-size: 11pt;"
309
+ + " -fx-text-fill: whitesmoke;"
310
+ + " -fx-background-insets: 0 0 0 0, 0, 1, 2;" );
311
+
312
+ addBtn .setOnMouseClicked ((event ) -> {
313
+ taskEditor .addRatioName (numLabel .getText () + "/" + denLabel .getText ());
314
+ namedExpressionsMap = taskEditor .buildNamedExpressionsMap ();
315
+ populateRatios ();
316
+ refreshExpressionAudits ();
317
+ updateAddButton ();
318
+ });
319
+
320
+ updateAddButton ();
321
+
322
+ numLabel .setStyle ("-fx-font-family: SansSerif bold;-fx-font-size: 18" );
323
+ divLabel .setStyle ("-fx-font-family: SansSerif bold;-fx-font-size: 18" );
324
+ denLabel .setStyle ("-fx-font-family: SansSerif bold;-fx-font-size: 18" );
325
+
326
+ infoLabelHBox .setAlignment (Pos .CENTER );
327
+ AnchorPane pane = new AnchorPane (menuVBox );
328
+ AnchorPane .setBottomAnchor (menuVBox , 0.0 );
329
+ AnchorPane .setTopAnchor (menuVBox , 0.0 );
330
+ AnchorPane .setRightAnchor (menuVBox , 0.0 );
331
+ AnchorPane .setLeftAnchor (menuVBox , 0.0 );
332
+
333
+ numTG .selectedToggleProperty ().addListener (new ChangeListener <Toggle >() {
334
+ public void changed (ObservableValue <? extends Toggle > ob , Toggle o , Toggle n ) {
335
+ RadioButton rb = (RadioButton ) numTG .getSelectedToggle ();
336
+ if (rb != null ) {
337
+ numLabel .setText (rb .getText ());
338
+ updateAddButton ();
339
+ }
340
+ }
341
+ });
342
+ denTG .selectedToggleProperty ().addListener (new ChangeListener <Toggle >() {
343
+ public void changed (ObservableValue <? extends Toggle > ob , Toggle o , Toggle n ) {
344
+ RadioButton rb = (RadioButton ) denTG .getSelectedToggle ();
345
+ if (rb != null ) {
346
+ denLabel .setText (rb .getText ());
347
+ updateAddButton ();
348
+ }
349
+ }
350
+ });
351
+
352
+ ADD_RATIOS_STAGE .setScene (new Scene (pane , 250 , 500 ));
353
+ ADD_RATIOS_STAGE .setAlwaysOnTop (true );
354
+
358
355
titleLabel .setStyle (STYLE_MANAGER_TITLE );
359
356
try {
360
357
taskEditor = SquidPersistentState .getExistingPersistentState ().getTaskDesign ();
0 commit comments