Skip to content

Commit 3478f87

Browse files
authored
Fixes issue #664 and refactoring (#665)
* updates antlr * updates * fixed issue #664 and refactoring
1 parent 0850734 commit 3478f87

File tree

25 files changed

+1292
-2106
lines changed

25 files changed

+1292
-2106
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Squid3 "jar" file can then be built:
4747
gradle fatappjar
4848
```
4949

50+
***Addendum***
51+
52+
Azul also provides JDKs and JREs for Java 8, 11, and 17 pre-packaged with JavaFX <a href="https://www.azul.com/downloads/?package=jdk-fx" target="_blank">here</a>.
53+
5054
***Note to Users***
5155

5256
Thank you for using Squid3. We depend on your feedback to keep Squid3 up-to-date and useful to you. To contribute issues and feedback, please join GitHub <a href="https://github.com/" target="_blank">here</a>. While

common.gradle

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

88

99
String mavenGroupId = 'org.cirdles'
10-
String mavenVersion = '1.9.0'
10+
String mavenVersion = '1.9.1'
1111

1212
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
1313

squidApp/src/main/java/org/cirdles/squid/gui/expressions/ExpressionBuilderController.java

+23-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
import org.cirdles.squid.tasks.expressions.spots.SpotFieldNode;
7676
import org.cirdles.squid.tasks.expressions.spots.SpotSummaryDetails;
7777
import org.cirdles.squid.tasks.expressions.variables.VariableNodeForIsotopicRatios;
78+
import org.cirdles.squid.tasks.expressions.variables.VariableNodeForPerSpotTaskExpressions;
7879
import org.cirdles.squid.tasks.expressions.variables.VariableNodeForSummary;
7980
import org.cirdles.squid.utilities.IntuitiveStringComparator;
8081

@@ -2185,6 +2186,17 @@ private String peekDetailsPerSpot(List<ShrimpFractionExpressionInterface> spots,
21852186
}
21862187
sb.append(String.format("%1$-18s", "SpotName"));
21872188
String[][] resultLabels;
2189+
2190+
// nov 2021 handle aliased expressions
2191+
if (!((ExpressionTree) expTree).getChildrenET().isEmpty()
2192+
&&
2193+
((ExpressionTree) expTree).getChildrenET().get(0) instanceof VariableNodeForPerSpotTaskExpressions) {
2194+
if ( expTree.getName().toUpperCase(Locale.ROOT).startsWith("TOTAL_")) {
2195+
ExpressionTreeInterface lookupExpTree = ((ExpressionTree) expTree).getChildrenET().get(0);
2196+
expTree = task.getExpressionByName(lookupExpTree.getName()).getExpressionTree();
2197+
}
2198+
}
2199+
21882200
if (((ExpressionTree) expTree).getOperation() != null) {
21892201
if ((((ExpressionTree) expTree).getOperation().getName().compareToIgnoreCase("Value") == 0)) {
21902202
if (((ExpressionTree) expTree).getChildrenET().get(0) instanceof VariableNodeForSummary) {
@@ -2225,6 +2237,9 @@ private String peekDetailsPerSpot(List<ShrimpFractionExpressionInterface> spots,
22252237
} else {
22262238
resultLabels = new String[][]{{contextAgeFieldName, "1\u03C3Abs", "1\u03C3%"}, {}};
22272239
}
2240+
} else if ((((ExpressionTree) expTree).getOperation().getName().compareToIgnoreCase("ValueModel") == 0)) {
2241+
// nov 2021 handle aliased expressions
2242+
resultLabels = new String[][]{{expTree.getName(), "1\u03C3Abs", "1\u03C3%"}, {}};
22282243
} else {
22292244
// some smarts
22302245
// if only one label, keep it; if two, assume 1sigma abs
@@ -2250,7 +2265,7 @@ private String peekDetailsPerSpot(List<ShrimpFractionExpressionInterface> spots,
22502265

22512266
sb.append("\n");
22522267

2253-
// produce values
2268+
// produce values ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22542269
if (((ExpressionTree) expTree).getLeftET() instanceof ShrimpSpeciesNode) {
22552270
// Check for functions of species
22562271
if (((ExpressionTree) expTree).getOperation() instanceof ShrimpSpeciesNodeFunction) {
@@ -2312,6 +2327,13 @@ private String peekDetailsPerSpot(List<ShrimpFractionExpressionInterface> spots,
23122327
}
23132328
}
23142329
} else {
2330+
// // nov 2021
2331+
// if (((ExpressionTree) expTree).getChildrenET().get(0) instanceof VariableNodeForPerSpotTaskExpressions) {
2332+
// if (((ExpressionTree) expTree).getName().toUpperCase(Locale.ROOT).startsWith("TOTAL_")) {
2333+
// ExpressionTreeInterface lookupExpTree = ((ExpressionTree) expTree).getChildrenET().get(0);
2334+
// expTree = task.getExpressionByName(lookupExpTree.getName()).getExpressionTree();
2335+
// }
2336+
// }
23152337
for (ShrimpFractionExpressionInterface spot : spots) {
23162338
if (spot.getTaskExpressionsEvaluationsPerSpot().get(expTree) != null) {
23172339
sb.append(String.format("%1$-18s", spot.getFractionID()));

squidApp/src/main/java/org/cirdles/squid/gui/squidReportTable/SquidReportSettingsController.java

+15
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.cirdles.squid.tasks.expressions.isotopes.ShrimpSpeciesNode;
4646
import org.cirdles.squid.tasks.expressions.operations.Value;
4747
import org.cirdles.squid.tasks.expressions.spots.SpotFieldNode;
48+
import org.cirdles.squid.tasks.expressions.variables.VariableNodeForPerSpotTaskExpressions;
4849
import org.cirdles.squid.tasks.expressions.variables.VariableNodeForSummary;
4950
import org.cirdles.squid.utilities.IntuitiveStringComparator;
5051
import org.cirdles.squid.utilities.fileUtilities.ProjectFileUtilities;
@@ -665,6 +666,17 @@ private String peekDetailsPerSpot(List<ShrimpFractionExpressionInterface> spots,
665666
}
666667
sb.append(String.format("%1$-" + 18 + "s", "SpotName"));
667668
String[][] resultLabels;
669+
670+
// nov 2021 handle aliased expressions
671+
if (!((ExpressionTree) expTree).getChildrenET().isEmpty()
672+
&&
673+
((ExpressionTree) expTree).getChildrenET().get(0) instanceof VariableNodeForPerSpotTaskExpressions) {
674+
if (expTree.getName().toUpperCase(Locale.ROOT).startsWith("TOTAL_")) {
675+
ExpressionTreeInterface lookupExpTree = ((ExpressionTree) expTree).getChildrenET().get(0);
676+
expTree = task.getExpressionByName(lookupExpTree.getName()).getExpressionTree();
677+
}
678+
}
679+
668680
if (((ExpressionTree) expTree).getOperation() != null) {
669681
if ((((ExpressionTree) expTree).getOperation().getName().compareToIgnoreCase("Value") == 0)) {
670682
if (((ExpressionTree) expTree).getChildrenET().get(0) instanceof VariableNodeForSummary) {
@@ -705,6 +717,9 @@ private String peekDetailsPerSpot(List<ShrimpFractionExpressionInterface> spots,
705717
} else {
706718
resultLabels = new String[][]{{contextAgeFieldName, "1\u03C3Abs", "1\u03C3%"}, {}};
707719
}
720+
} else if ((((ExpressionTree) expTree).getOperation().getName().compareToIgnoreCase("ValueModel") == 0)) {
721+
// nov 2021 handle aliased expressions
722+
resultLabels = new String[][]{{expTree.getName(), "1\u03C3Abs", "1\u03C3%"}, {}};
708723
} else {
709724
// some smarts
710725
// String[][] resultLabelsFirst = clone2dArray(((ExpressionTree) expTree).getOperation().getLabelsForOutputValues());
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
23
<!--
34
Copyright 2018 James F. Bowring and CIRDLES.org.
45
@@ -15,53 +16,41 @@
1516
limitations under the License.
1617
-->
1718

18-
<?import javafx.scene.control.*?>
19-
<?import javafx.scene.image.*?>
20-
<?import javafx.scene.layout.Pane?>
2119
<?import java.lang.String?>
22-
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0"
23-
prefWidth="550.0" styleClass="main-Pain" stylesheets="@css/about.css" xmlns="http://javafx.com/javafx/10.0.1"
24-
xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.cirdles.squid.gui.AboutSquidController">
20+
<?import javafx.scene.control.Hyperlink?>
21+
<?import javafx.scene.control.Label?>
22+
<?import javafx.scene.image.Image?>
23+
<?import javafx.scene.image.ImageView?>
24+
<?import javafx.scene.layout.Pane?>
25+
26+
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0" prefWidth="550.0" styleClass="main-Pain" stylesheets="@css/about.css" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.cirdles.squid.gui.AboutSquidController">
2527
<children>
26-
<Label fx:id="versionText" alignment="CENTER" contentDisplay="CENTER" graphicTextGap="0.0" layoutX="94.0"
27-
layoutY="206.0" prefHeight="45.0" prefWidth="360.0" text="Squid V 0.0.1" textAlignment="CENTER">
28+
<Label fx:id="versionText" alignment="CENTER" contentDisplay="CENTER" graphicTextGap="0.0" layoutX="94.0" layoutY="206.0" prefHeight="45.0" prefWidth="360.0" text="Squid V 0.0.1" textAlignment="CENTER">
2829
<styleClass>
29-
<String fx:value="project-Title"/>
30-
<String fx:value="main-Text-Color"/>
30+
<String fx:value="project-Title" />
31+
<String fx:value="main-Text-Color" />
3132
</styleClass>
3233
</Label>
33-
<ImageView fitHeight="75.0" fitWidth="156.0" layoutX="304.0" layoutY="603.0" pickOnBounds="true"
34-
preserveRatio="true" scaleX="0.75" scaleY="0.75">
34+
<ImageView fitHeight="75.0" fitWidth="156.0" layoutX="304.0" layoutY="603.0" pickOnBounds="true" preserveRatio="true" scaleX="0.75" scaleY="0.75">
3535
<image>
36-
<Image url="@images/cirdles-logov2.png"/>
36+
<Image url="@images/cirdles-logov2.png" />
3737
</image>
3838
</ImageView>
39-
<Hyperlink layoutX="326.0" layoutY="669.0" onAction="#visitSquidOnCirdlesAction" styleClass="links"
40-
text="A CIRDLES Project" textAlignment="CENTER"/>
41-
<Hyperlink layoutX="102.0" layoutY="669.0" onAction="#visitUsOnGithubAction" styleClass="links"
42-
text="Visit Us on GitHub!" textAlignment="CENTER"/>
43-
<ImageView fitHeight="91.0" fitWidth="62.0" layoutX="127.0" layoutY="606.0" pickOnBounds="true"
44-
preserveRatio="true">
39+
<Hyperlink layoutX="326.0" layoutY="669.0" onAction="#visitSquidOnCirdlesAction" styleClass="links" text="A CIRDLES Project" textAlignment="CENTER" />
40+
<Hyperlink layoutX="102.0" layoutY="669.0" onAction="#visitUsOnGithubAction" styleClass="links" text="Visit Us on GitHub!" textAlignment="CENTER" />
41+
<ImageView fitHeight="91.0" fitWidth="62.0" layoutX="127.0" layoutY="606.0" pickOnBounds="true" preserveRatio="true">
4542
<image>
46-
<Image url="@images/githubBluesqueLogo.png"/>
43+
<Image url="@images/githubBluesqueLogo.png" />
4744
</image>
4845
</ImageView>
49-
<Label fx:id="aboutDetailsLabel" alignment="TOP_CENTER" contentDisplay="TOP" layoutX="25.0" layoutY="270.0"
50-
prefHeight="80.0" prefWidth="500.0" styleClass="description-Text"
51-
text="Developed by the CIRDLES team at the College of Charleston." textAlignment="JUSTIFY"
52-
wrapText="true"/>
53-
<Label fx:id="buildDate" alignment="CENTER" contentDisplay="CENTER" graphicTextGap="0.0" layoutX="94.0"
54-
layoutY="251.0" prefHeight="17.0" prefWidth="360.0" styleClass="main-Text-Color"
55-
stylesheets="@css/about.css" text="Build Date: mm/dd/yyyy" textAlignment="CENTER"/>
56-
<ImageView fitHeight="300.0" fitWidth="400.0" layoutX="124.0" layoutY="-41.0" pickOnBounds="true"
57-
preserveRatio="true" styleClass="logo">
46+
<Label fx:id="aboutDetailsLabel" alignment="TOP_CENTER" contentDisplay="TOP" layoutX="25.0" layoutY="270.0" prefHeight="80.0" prefWidth="500.0" styleClass="description-Text" text="Developed by the CIRDLES team at the College of Charleston." textAlignment="JUSTIFY" wrapText="true" />
47+
<Label fx:id="buildDate" alignment="CENTER" contentDisplay="CENTER" graphicTextGap="0.0" layoutX="94.0" layoutY="251.0" prefHeight="17.0" prefWidth="360.0" styleClass="main-Text-Color" stylesheets="@css/about.css" text="Build Date: mm/dd/yyyy" textAlignment="CENTER" />
48+
<ImageView fitHeight="300.0" fitWidth="400.0" layoutX="124.0" layoutY="-41.0" pickOnBounds="true" preserveRatio="true" styleClass="logo">
5849
<image>
59-
<Image url="@images/SquidLogoSansBg.png"/>
50+
<Image url="@images/SquidLogoSansBg.png" />
6051
</image>
6152
</ImageView>
62-
<Label fx:id="contributorsLabel" layoutX="25.0" layoutY="350.0" prefHeight="100.0" prefWidth="500.0"
63-
styleClass="description-Text" text="Contributors" textAlignment="JUSTIFY" wrapText="true"/>
64-
<Label fx:id="supportersLabel" layoutX="25.0" layoutY="451.0" prefHeight="150.0" prefWidth="500.0"
65-
styleClass="description-Text" text="Supporters" textAlignment="JUSTIFY" wrapText="true"/>
53+
<Label fx:id="contributorsLabel" layoutX="25.0" layoutY="350.0" prefHeight="100.0" prefWidth="500.0" styleClass="description-Text" text="Contributors" textAlignment="JUSTIFY" wrapText="true" />
54+
<Label fx:id="supportersLabel" layoutX="25.0" layoutY="451.0" prefHeight="150.0" prefWidth="500.0" styleClass="description-Text" text="Supporters" textAlignment="JUSTIFY" wrapText="true" />
6655
</children>
67-
</Pane>
56+
</Pane>

0 commit comments

Comments
 (0)