@@ -79,11 +79,13 @@ public class TaskEditorController implements Initializable {
79
79
private static final Label instructions = new Label (" Choose numerator and denominator" );
80
80
private static final Button addBtn = new Button ("Add ratio" );
81
81
private static final HBox addBtnHBox = new HBox (addBtn );
82
+ private static final Button closeBtn = new Button ("Close" );
83
+ private static final HBox closeBtnHBox = new HBox (closeBtn );
82
84
private static final Label numLabel = new Label ("" );
83
85
private static final Label divLabel = new Label ("/" );
84
86
private static final Label denLabel = new Label ("" );
85
87
private static final HBox infoLabelHBox = new HBox (numLabel , divLabel , denLabel );
86
- private static final VBox addInfo = new VBox (infoLabelHBox , addBtnHBox );
88
+ private static final VBox addInfo = new VBox (infoLabelHBox , addBtnHBox , closeBtnHBox );
87
89
private static final VBox menuVBox = new VBox (instructions , numDemHBox , addInfo );
88
90
private static final Map <String , Tooltip > tooltipsMap = new HashMap <>();
89
91
private static final ToggleGroup numTG = new ToggleGroup ();
@@ -93,6 +95,7 @@ public class TaskEditorController implements Initializable {
93
95
private static Map <String , ExpressionTreeInterface > namedExpressionsMap = new TreeMap <>(String .CASE_INSENSITIVE_ORDER );
94
96
private static boolean amGeochronMode ;
95
97
private final List <StackPane > undoMassesList = new ArrayList <>();
98
+ public Text pinkMassesWarningText ;
96
99
EventHandler <MouseEvent > mouseEnteredExpressionEventHandler = new EventHandler <MouseEvent >() {
97
100
@ Override
98
101
public void handle (MouseEvent event ) {
@@ -317,7 +320,21 @@ public void initialize(URL url, ResourceBundle rb) {
317
320
updateAddButton ();
318
321
});
319
322
320
- // updateAddButton();
323
+ closeBtnHBox .setAlignment (Pos .CENTER );
324
+ closeBtn .setStyle (
325
+ "-fx-padding: 5 22 5 22;\n "
326
+ + " -fx-border-color: #e2e2e2;"
327
+ + " -fx-border-width: 2;"
328
+ + " -fx-background-radius: 0;"
329
+ + " -fx-background-color: #FB6D42;"
330
+ + " -fx-font-family: SansSerif;"
331
+ + " -fx-font-size: 11pt;"
332
+ + " -fx-text-fill: whitesmoke;"
333
+ + " -fx-background-insets: 0 0 0 0, 0, 1, 2;" );
334
+
335
+ closeBtn .setOnMouseClicked ((event ) -> {
336
+ ADD_RATIOS_STAGE .hide ();
337
+ });
321
338
322
339
numLabel .setStyle ("-fx-font-family: SansSerif bold;-fx-font-size: 18" );
323
340
divLabel .setStyle ("-fx-font-family: SansSerif bold;-fx-font-size: 18" );
@@ -378,6 +395,10 @@ public void changed(ObservableValue<? extends Toggle> ob, Toggle o, Toggle n) {
378
395
}
379
396
amGeochronMode = taskEditor .getTaskType ().compareTo (TaskTypeEnum .GEOCHRON ) == 0 ;
380
397
398
+ if (taskEditor .getTaskType ().equals (TaskTypeEnum .GENERAL )) {
399
+ pinkMassesWarningText .setText ("" );
400
+ }
401
+
381
402
updateAddButton ();
382
403
383
404
initTaskDesign ();
@@ -822,6 +843,7 @@ private ContextMenu createChooseMassesContextMenu() {
822
843
823
844
@ FXML
824
845
private void updateCurrentTaskWithThisTaskAction () throws SquidException {
846
+ ADD_RATIOS_STAGE .hide ();
825
847
if (squidProject .getTask ().getTaskType ().equals (taskEditor .getTaskType ())) {
826
848
// check the mass count
827
849
boolean valid = (squidProject .getTask ().getSquidSpeciesModelList ().size ()
@@ -864,6 +886,7 @@ private void updateCurrentTaskWithThisTaskAction() throws SquidException {
864
886
865
887
@ FXML
866
888
private void saveThisTaskAsXMLFileAction () {
889
+ ADD_RATIOS_STAGE .hide ();
867
890
try {
868
891
TaskInterface task = new Task ();
869
892
task .updateTaskFromTaskDesign (taskEditor , true );
@@ -877,6 +900,7 @@ private void saveThisTaskAsXMLFileAction() {
877
900
878
901
@ FXML
879
902
private void viewCurrentTaskAction () {
903
+ ADD_RATIOS_STAGE .hide ();
880
904
MenuItem menuItemTaskManager = ((MenuBar ) SquidUI .primaryStage .getScene ()
881
905
.getRoot ().getChildrenUnmodifiable ().get (0 )).getMenus ().get (2 ).getItems ().get (0 );
882
906
menuItemTaskManager .fire ();
0 commit comments