Skip to content

Commit 3abf7aa

Browse files
authored
Misc tweaks. (#532)
* Allowed rename of lab default report * Tuned GUI * Fixed #530 and new version 1.6.5 * Fixed #531 for Tera-Wasserburg plots * Updated README partially * Removed ratios manager because it duplicates task editor * Updated README and tweaked UI
1 parent efd6784 commit 3abf7aa

34 files changed

+160
-287
lines changed

README.md

+26-31
Large diffs are not rendered by default.

common.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'java'
66
apply plugin: 'maven'
77

88
String mavenGroupId = 'org.cirdles'
9-
String mavenVersion = '1.6.4'
9+
String mavenVersion = '1.6.5'
1010

1111
sourceCompatibility = '1.8'
1212
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

squidApp/src/main/java/org/cirdles/squid/gui/IsotopesManagerController.java

+1-108
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import java.net.URL;
1919
import java.util.ResourceBundle;
2020
import javafx.beans.binding.Bindings;
21-
import javafx.beans.property.BooleanProperty;
22-
import javafx.beans.property.SimpleBooleanProperty;
2321
import javafx.beans.property.SimpleObjectProperty;
2422
import javafx.beans.value.ChangeListener;
2523
import javafx.beans.value.ObservableValue;
@@ -29,7 +27,6 @@
2927
import javafx.event.EventHandler;
3028
import javafx.fxml.FXML;
3129
import javafx.fxml.Initializable;
32-
import javafx.scene.control.CheckBox;
3330
import javafx.scene.control.ContextMenu;
3431
import javafx.scene.control.Label;
3532
import javafx.scene.control.MenuItem;
@@ -40,7 +37,6 @@
4037
import javafx.scene.control.TableRow;
4138
import javafx.scene.control.TableView;
4239
import javafx.scene.control.TextField;
43-
import javafx.scene.control.cell.CheckBoxTableCell;
4440
import javafx.scene.control.cell.ComboBoxTableCell;
4541
import javafx.scene.input.KeyCode;
4642
import javafx.scene.input.KeyEvent;
@@ -77,18 +73,8 @@ public class IsotopesManagerController implements Initializable {
7773
@FXML
7874
private TableColumn<MassStationDetail, UThBearingEnum> uOrThBearingColumn;
7975
@FXML
80-
private TableColumn<MassStationDetail, Boolean> numeratorColumn;
81-
@FXML
82-
private TableColumn<MassStationDetail, Boolean> denominatorColumn;
83-
@FXML
84-
private CheckBox selectAllNumeratorCheckBox;
85-
@FXML
86-
private CheckBox selectAllDenominatorCheckBox;
87-
@FXML
8876
private Label backgroundStatusLabel;
8977
@FXML
90-
private Label backgroundExcludedLabel;
91-
@FXML
9278
private TableColumn<MassStationDetail, String> amuColumn;
9379

9480
/**
@@ -143,7 +129,7 @@ public TableCell<MassStationDetail, String> call(TableColumn param) {
143129
return new EditingCell();
144130
}
145131
});
146-
132+
147133
elementLabelColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<MassStationDetail, String>>() {
148134
@Override
149135
public void handle(TableColumn.CellEditEvent<MassStationDetail, String> editEvent) {
@@ -239,60 +225,6 @@ public ObservableValue<String> call(TableColumn.CellDataFeatures<MassStationDeta
239225
}
240226
});
241227

242-
// ==== numeratorColumn ==
243-
numeratorColumn.setCellFactory(column -> new CheckBoxTableCell<>());
244-
numeratorColumn.setCellValueFactory(cellData -> {
245-
MassStationDetail cellValue = cellData.getValue();
246-
BooleanProperty property = new SimpleBooleanProperty(cellValue.isNumeratorRole());
247-
if (cellValue.getIsBackground()) {
248-
property = new SimpleBooleanProperty(false);
249-
}
250-
251-
// Add listener to handler change
252-
property.addListener((observable, oldValue, newValue) -> {
253-
if (cellValue.getIsBackground()) {
254-
cellValue.setNumeratorRole(false);
255-
((Task) task).applyTaskIsotopeRatioRolesToSquidSpeciesModels(cellValue);
256-
isotopesTableView.refresh();
257-
} else {
258-
cellValue.setNumeratorRole(newValue);
259-
((Task) task).applyTaskIsotopeRatioRolesToSquidSpeciesModels(cellValue);
260-
}
261-
updateSelectAllNumeratorCheckbox();
262-
});
263-
264-
return property;
265-
});
266-
267-
updateSelectAllNumeratorCheckbox();
268-
269-
// ==== denominatorColumn ==
270-
denominatorColumn.setCellFactory(column -> new CheckBoxTableCell<>());
271-
denominatorColumn.setCellValueFactory(cellData -> {
272-
MassStationDetail cellValue = cellData.getValue();
273-
BooleanProperty property = new SimpleBooleanProperty(cellValue.isDenominatorRole());
274-
if (cellValue.getIsBackground()) {
275-
property = new SimpleBooleanProperty(false);
276-
}
277-
278-
// Add listener to handler change
279-
property.addListener((observable, oldValue, newValue) -> {
280-
if (cellValue.getIsBackground()) {
281-
cellValue.setDenominatorRole(false);
282-
((Task) task).applyTaskIsotopeRatioRolesToSquidSpeciesModels(cellValue);
283-
isotopesTableView.refresh();
284-
} else {
285-
cellValue.setDenominatorRole(newValue);
286-
((Task) task).applyTaskIsotopeRatioRolesToSquidSpeciesModels(cellValue);
287-
}
288-
updateSelectAllDenominatorCheckbox();
289-
});
290-
291-
return property;
292-
});
293-
294-
updateSelectAllDenominatorCheckbox();
295-
296228
isotopesTableView.setRowFactory(new Callback<TableView<MassStationDetail>, TableRow<MassStationDetail>>() {
297229
@Override
298230
public TableRow<MassStationDetail> call(TableView<MassStationDetail> tableView) {
@@ -331,8 +263,6 @@ public void handle(ActionEvent event) {
331263
}
332264
task.setChanged(true);
333265
isotopesTableView.refresh();
334-
updateSelectAllNumeratorCheckbox();
335-
updateSelectAllDenominatorCheckbox();
336266
updateBackgroundStatusLabel();
337267
}
338268
}
@@ -356,8 +286,6 @@ public void handle(ActionEvent event) {
356286
row.getItem().setTaskIsotopeLabel(task.getNominalMasses().get(row.getItem().getMassStationIndex()));
357287

358288
isotopesTableView.refresh();
359-
updateSelectAllNumeratorCheckbox();
360-
updateSelectAllDenominatorCheckbox();
361289
updateBackgroundStatusLabel();
362290
}
363291
}
@@ -380,28 +308,6 @@ public void handle(ActionEvent event) {
380308

381309
}
382310

383-
private void updateSelectAllNumeratorCheckbox() {
384-
// detect if all are selected or deselected as numerators
385-
boolean allIncluded = true;
386-
for (SquidSpeciesModel ssm : task.getSquidSpeciesModelList()) {
387-
if (!ssm.getIsBackground()) {
388-
allIncluded = allIncluded && ssm.isNumeratorRole();
389-
}
390-
}
391-
selectAllNumeratorCheckBox.setSelected(allIncluded);
392-
}
393-
394-
private void updateSelectAllDenominatorCheckbox() {
395-
// detect if all are selected or deselected as denominators
396-
boolean allIncluded = true;
397-
for (SquidSpeciesModel ssm : task.getSquidSpeciesModelList()) {
398-
if (!ssm.getIsBackground()) {
399-
allIncluded = allIncluded && ssm.isDenominatorRole();
400-
}
401-
}
402-
selectAllDenominatorCheckBox.setSelected(allIncluded);
403-
}
404-
405311
@FXML
406312
private void applyTaskIsotopeLabelsAction(ActionEvent event) {
407313
task.applyTaskIsotopeLabelsToMassStationsAndUpdateTask();
@@ -421,19 +327,6 @@ private void postApplicationOfLabelsUpdate() {
421327
setupIsotopeTable();
422328
}
423329

424-
@FXML
425-
private void selectAllNumeratorAction(ActionEvent event) {
426-
((Task) task).initializeSquidSpeciesModelsRatioMode(true, selectAllNumeratorCheckBox.isSelected(), false, false);
427-
isotopesTableView.refresh();
428-
}
429-
430-
@FXML
431-
private void selectAllDenominatorAction(ActionEvent event) {
432-
((Task) task).initializeSquidSpeciesModelsRatioMode(false, false, true, selectAllDenominatorCheckBox.isSelected());
433-
isotopesTableView.refresh();
434-
435-
}
436-
437330
class EditingCell extends TableCell<MassStationDetail, String> {
438331

439332
private TextField textField;

squidApp/src/main/java/org/cirdles/squid/gui/SpotManagerController.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ private ContextMenu createAllSpotsViewContextMenu()
345345
"Two Prawn XML files have been written:\n\n"
346346
+ "\t" + splitNames[0] + "\n"
347347
+ "\t" + splitNames[1] + "\n\n"
348-
+ "Create a new Squid Project with each of these Prawn XML files.",
348+
+ "Create a new Squid3 Project with each of these Prawn XML files.",
349349
primaryStageWindow
350350
);
351351
} catch (SquidException squidException) {
@@ -373,7 +373,7 @@ private ContextMenu createAllSpotsViewContextMenu()
373373
"Two Prawn XML files have been written:\n\n"
374374
+ "\t" + splitNames[0] + "\n"
375375
+ "\t" + splitNames[1] + "\n\n"
376-
+ "Create a new Squid Project with each of these Prawn XML files.",
376+
+ "Create a new Squid3 Project with each of these Prawn XML files.",
377377
primaryStageWindow
378378
);
379379
} catch (SquidException squidException) {
@@ -522,7 +522,7 @@ public ParametersModel fromString(String userId) {
522522
} else {
523523
if (audit[0].contains("1")) {
524524
SquidMessageDialog.showInfoDialog(
525-
"This reference material model is missing key age(s), so Squid is \n"
525+
"This reference material model is missing key age(s), so Squid3 is \n"
526526
+ "temporarily substituting values (shown in red) and refreshing as follows:\n\n"
527527
+ audit[1],
528528
primaryStageWindow);

squidApp/src/main/java/org/cirdles/squid/gui/SquidUI.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void start(Stage primaryStage) throws Exception {
115115
public static void updateStageTitle(String fileName) {
116116
String fileSpec = "[Project File: NONE]";
117117
fileSpec = fileName.length() > 0 ? fileSpec.replace("NONE", fileName) : fileSpec;
118-
primaryStage.setTitle("Squid 3 " + fileSpec);
118+
primaryStage.setTitle("Squid3 " + fileSpec);
119119
SquidUIController.projectFileName = fileName;
120120
}
121121

@@ -151,7 +151,7 @@ public static void main(String[] args) {
151151
// detect if running from jar file
152152
if (!verbose && (ClassLoader.getSystemResource("org/cirdles/squid/gui/SquidUI.class").toExternalForm().startsWith("jar"))) {
153153
System.out.println(
154-
"Running Squid from Jar file ... suppressing terminal output.\n"
154+
"Running Squid3 from Jar file ... suppressing terminal output.\n"
155155
+ "\t use '-verbose' argument after jar file name to enable terminal output.");
156156
System.setOut(new PrintStream(new OutputStream() {
157157
public void write(int b) {

squidApp/src/main/java/org/cirdles/squid/gui/SquidUIController.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ private void newSquidProjectFromOPFileAction(ActionEvent actionEvent) {
500500
}
501501

502502
SquidMessageDialog.showWarningDialog(
503-
"Squid encountered an error while trying to open the selected file:\n\n"
503+
"Squid3 encountered an error while trying to open the selected file:\n\n"
504504
+ message,
505505
primaryStageWindow);
506506
}
@@ -559,7 +559,7 @@ private void newSquidProjectFromZippedPrawnAction(ActionEvent event) {
559559
}
560560

561561
SquidMessageDialog.showWarningDialog(
562-
"Squid encountered an error while trying to open the selected file:\n\n"
562+
"Squid3 encountered an error while trying to open the selected file:\n\n"
563563
+ message,
564564
primaryStageWindow);
565565
}
@@ -591,7 +591,7 @@ private void newSquidProjectAction(ActionEvent event) {
591591
}
592592

593593
SquidMessageDialog.showWarningDialog(
594-
"Squid encountered an error while trying to open the selected file:\n\n"
594+
"Squid3 encountered an error while trying to open the selected file:\n\n"
595595
+ message,
596596
primaryStageWindow);
597597
}
@@ -626,7 +626,7 @@ private void newSquidRatioProjectAction(ActionEvent event) {
626626
}
627627

628628
SquidMessageDialog.showWarningDialog(
629-
"Squid encountered an error while trying to open the selected file:\n\n"
629+
"Squid3 encountered an error while trying to open the selected file:\n\n"
630630
+ message,
631631
primaryStageWindow);
632632
}
@@ -661,7 +661,7 @@ private void newSquidProjectByJoinAction(ActionEvent event) {
661661
}
662662

663663
SquidMessageDialog.showWarningDialog(
664-
"Squid encountered an error while trying to open and join the selected files:\n\n"
664+
"Squid3 encountered an error while trying to open and join the selected files:\n\n"
665665
+ message,
666666
primaryStageWindow);
667667
}
@@ -765,7 +765,7 @@ private void confirmSaveOnProjectClose() {
765765
if (SquidProject.isProjectChanged()) {
766766

767767
Alert alert = new Alert(Alert.AlertType.WARNING,
768-
"Do you want to save Squid Project changes?",
768+
"Do you want to save Squid3 Project changes?",
769769
ButtonType.YES,
770770
ButtonType.NO
771771
);
@@ -800,7 +800,7 @@ private void quitAction(ActionEvent event) {
800800

801801
@FXML
802802
private void onlineHelpAction(ActionEvent event) {
803-
BrowserControl.showURI("http://cirdles.org/projects/squid/#Development");
803+
BrowserControl.showURI("https://github.com/CIRDLES/Squid#readme"); //"http://cirdles.org/projects/squid/#Development");
804804
}
805805

806806
@FXML
@@ -1422,7 +1422,7 @@ public void generateAllReportsAction(ActionEvent actionEvent) throws IOException
14221422
}
14231423

14241424
private void showReportsWarning() {
1425-
SquidMessageDialog.showWarningDialog("The Squid Project must be saved before reports can be written out.", primaryStageWindow);
1425+
SquidMessageDialog.showWarningDialog("The Squid3 Project must be saved before reports can be written out.", primaryStageWindow);
14261426
}
14271427

14281428
private void showManageIsotopesWarning() {
@@ -1511,7 +1511,7 @@ private void launchConcordiaAndWeightedMeanPlots() {
15111511
if (confirmReduction()) {
15121512
PlotsController.currentlyPlottedSampleTreeNode = null;
15131513
launchInterpretations();
1514-
1514+
15151515
showUI(plotUI);
15161516
menuHighlighter.highlight(manageInterpretationsMenu);
15171517
}
@@ -1726,7 +1726,7 @@ private void choosePrawnFileMenuItemAction(ActionEvent event) {
17261726
}
17271727

17281728
SquidMessageDialog.showWarningDialog(
1729-
"Squid encountered an error while trying to open the selected Prawn File:\n\n"
1729+
"Squid3 encountered an error while trying to open the selected Prawn File:\n\n"
17301730
+ message,
17311731
primaryStageWindow);
17321732
}
@@ -1757,7 +1757,7 @@ private void synchronizeTaskLabDataAndSquidVersion() {
17571757
// next two lines make sure 15-digit rounding is used by reprocessing data
17581758
task.setChanged(true);
17591759
task.setupSquidSessionSpecsAndReduceAndReport(true);
1760-
1760+
17611761
((Task) task).initTaskDefaultSquidReportTables(true);
17621762

17631763
SquidMessageDialog.showInfoDialog(

squidApp/src/main/java/org/cirdles/squid/gui/dataViews/MassStationAuditViewForShrimp.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private void setupSpotContextMenu() {
171171
"Two Prawn XML files have been written:\n\n"
172172
+ "\t" + splitNames[0] + "\n"
173173
+ "\t" + splitNames[1] + "\n\n"
174-
+ "Create a new Squid Project with each of these Prawn XML files.",
174+
+ "Create a new Squid3 Project with each of these Prawn XML files.",
175175
primaryStageWindow
176176
);
177177
} catch (SquidException squidException) {
@@ -198,7 +198,7 @@ private void setupSpotContextMenu() {
198198
"Two Prawn XML files have been written:\n\n"
199199
+ "\t" + splitNames[0] + "\n"
200200
+ "\t" + splitNames[1] + "\n\n"
201-
+ "Create a new Squid Project with each of these Prawn XML files.",
201+
+ "Create a new Squid3 Project with each of these Prawn XML files.",
202202
primaryStageWindow
203203
);
204204
} catch (SquidException squidException) {

0 commit comments

Comments
 (0)