Skip to content

Commit 13ffb24

Browse files
authored
Updated audit screen with sliding zoom window and fixed issue #618 (#619)
* Refactored * Refactored * Fixed #618 * Updated audit screen with sliding window to redcue memory usage
1 parent 77d3675 commit 13ffb24

File tree

16 files changed

+728
-317
lines changed

16 files changed

+728
-317
lines changed

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.7.7'
9+
String mavenVersion = '1.7.8'
1010

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

squidApp/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ if (!hasProperty('mainClass')) {
2020
mainClassName = 'org.cirdles.squid.gui.SquidUI'
2121

2222
dependencies {
23+
implementation 'org.jetbrains:annotations:20.1.0'
24+
implementation 'org.jetbrains:annotations:20.1.0'
2325
compile project(":squidCore")
2426

2527
compile group: 'org.apache.xmlgraphics', name: 'batik-svg-dom', version: '1.9.1'
@@ -40,6 +42,4 @@ task fatAppJar(type: Jar) {
4042
baseName = 'Squid3'
4143
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
4244
with jar
43-
}
44-
45-
45+
}

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

+426-145
Large diffs are not rendered by default.

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

+20-32
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@
1515
*/
1616
package org.cirdles.squid.gui;
1717

18-
import java.math.BigDecimal;
19-
import java.math.RoundingMode;
20-
import java.net.URL;
21-
import java.util.ArrayList;
22-
import java.util.Arrays;
23-
import java.util.List;
24-
import java.util.Locale;
25-
import java.util.ResourceBundle;
26-
import java.util.function.Predicate;
2718
import javafx.beans.value.ChangeListener;
2819
import javafx.beans.value.ObservableValue;
2920
import javafx.collections.FXCollections;
@@ -32,44 +23,37 @@
3223
import javafx.event.EventHandler;
3324
import javafx.fxml.FXML;
3425
import javafx.fxml.Initializable;
35-
import javafx.scene.control.Button;
36-
import javafx.scene.control.ComboBox;
37-
import javafx.scene.control.ContextMenu;
38-
import javafx.scene.control.Label;
39-
import javafx.scene.control.ListCell;
40-
import javafx.scene.control.ListView;
41-
import javafx.scene.control.Menu;
42-
import javafx.scene.control.MenuItem;
43-
import javafx.scene.control.SelectionMode;
44-
import javafx.scene.control.SplitPane;
45-
import javafx.scene.control.TextField;
26+
import javafx.scene.control.*;
4627
import javafx.scene.input.KeyEvent;
4728
import javafx.scene.input.MouseButton;
4829
import javafx.scene.input.MouseEvent;
4930
import javafx.scene.layout.HBox;
50-
import static javafx.scene.paint.Color.BLACK;
5131
import javafx.util.Callback;
5232
import javafx.util.StringConverter;
53-
import static org.cirdles.squid.constants.Squid3Constants.REF_238U235U_DEFAULT;
5433
import org.cirdles.squid.dialogs.SquidMessageDialog;
5534
import org.cirdles.squid.exceptions.SquidException;
56-
import static org.cirdles.squid.gui.SquidUI.primaryStageWindow;
57-
import static org.cirdles.squid.gui.SquidUIController.parametersLauncher;
58-
import static org.cirdles.squid.gui.SquidUIController.squidLabData;
59-
import static org.cirdles.squid.gui.SquidUIController.squidProject;
60-
import static org.cirdles.squid.gui.constants.Squid3GuiConstants.STYLE_MANAGER_TITLE;
6135
import org.cirdles.squid.gui.parameters.ParametersLauncher;
6236
import org.cirdles.squid.gui.parameters.ParametersManagerGUIController;
6337
import org.cirdles.squid.parameters.parameterModels.ParametersModel;
6438
import org.cirdles.squid.parameters.parameterModels.referenceMaterialModels.ReferenceMaterialModel;
65-
import static org.cirdles.squid.parameters.util.RadDates.age206_238r;
66-
import static org.cirdles.squid.parameters.util.RadDates.age207_206r;
67-
import static org.cirdles.squid.parameters.util.RadDates.age208_232r;
68-
import static org.cirdles.squid.parameters.util.ReferenceMaterialEnum.r238_235s;
6939
import org.cirdles.squid.prawn.PrawnFile;
7040
import org.cirdles.squid.prawn.PrawnFile.Run;
7141
import org.cirdles.squid.projects.SquidProject;
7242

43+
import java.math.BigDecimal;
44+
import java.math.RoundingMode;
45+
import java.net.URL;
46+
import java.util.*;
47+
import java.util.function.Predicate;
48+
49+
import static javafx.scene.paint.Color.BLACK;
50+
import static org.cirdles.squid.constants.Squid3Constants.REF_238U235U_DEFAULT;
51+
import static org.cirdles.squid.gui.SquidUI.primaryStageWindow;
52+
import static org.cirdles.squid.gui.SquidUIController.*;
53+
import static org.cirdles.squid.gui.constants.Squid3GuiConstants.STYLE_MANAGER_TITLE;
54+
import static org.cirdles.squid.parameters.util.RadDates.*;
55+
import static org.cirdles.squid.parameters.util.ReferenceMaterialEnum.r238_235s;
56+
7357
/**
7458
* FXML Controller class
7559
*
@@ -232,6 +216,10 @@ public void changed(ObservableValue<? extends String> observable, String oldValu
232216

233217
private void setUpDataFile() throws SquidException {
234218

219+
// May 2021 fixes issue #618
220+
squidProject.getTask().setChanged(true);
221+
squidProject.getTask().setupSquidSessionSpecsAndReduceAndReport(true);
222+
235223
shrimpRuns = FXCollections.observableArrayList(squidProject.getPrawnFileRuns());
236224

237225
setUpShrimpFractionList();
@@ -753,4 +741,4 @@ private void refreshRMmodelButton(ActionEvent event) {
753741
// updateViewRM();
754742
// updateViewCM();
755743
}
756-
}
744+
}

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

+26-39
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,14 @@
1919
*/
2020
package org.cirdles.squid.gui.dataViews;
2121

22-
import java.math.BigDecimal;
23-
import java.util.ArrayList;
24-
import java.util.List;
2522
import javafx.scene.canvas.Canvas;
2623
import javafx.scene.canvas.GraphicsContext;
2724
import javafx.scene.paint.Paint;
2825
import javafx.scene.shape.Rectangle;
29-
import org.cirdles.squid.prawn.PrawnFile;
26+
27+
import java.math.BigDecimal;
3028

3129
/**
32-
*
3330
* @author James F. Bowring
3431
*/
3532
public abstract class AbstractDataView extends Canvas {
@@ -38,6 +35,8 @@ public abstract class AbstractDataView extends Canvas {
3835
protected double y;
3936
protected double width;
4037
protected double height;
38+
protected static int indexOfSelectedSpot = -1;
39+
protected static int indexOfSecondSelectedSpotForMultiSelect = -1;
4140

4241
/**
4342
*
@@ -47,9 +46,6 @@ public abstract class AbstractDataView extends Canvas {
4746
*
4847
*/
4948
protected double[] myOnPeakNormalizedAquireTimes;
50-
/**
51-
*
52-
*/
5349
protected int graphWidth;
5450
/**
5551
*
@@ -82,34 +78,32 @@ public abstract class AbstractDataView extends Canvas {
8278
/**
8379
*
8480
*/
85-
private double displayOffsetY = 0;
81+
protected BigDecimal[] ticsX;
8682
/**
8783
*
8884
*/
89-
private double displayOffsetX = 0;
85+
protected BigDecimal[] ticsY;
86+
protected BigDecimal[] ticsYII;
87+
protected boolean showTimeNormalized;
88+
protected boolean showspotLabels;
9089
/**
9190
*
9291
*/
93-
protected BigDecimal[] ticsX;
92+
private double displayOffsetY = 0;
9493
/**
9594
*
9695
*/
97-
protected BigDecimal[] ticsY;
98-
protected BigDecimal[] ticsYII;
96+
private double displayOffsetX = 0;
9997

100-
protected boolean showTimeNormalized;
101-
protected boolean showspotLabels;
102-
10398

10499
/**
105100
*
106101
*/
107-
public AbstractDataView() {
102+
private AbstractDataView() {
108103
super();
109104
}
110105

111106
/**
112-
*
113107
* @param bounds
114108
*/
115109
protected AbstractDataView(Rectangle bounds, int leftMargin, int topMargin) {
@@ -130,24 +124,22 @@ protected AbstractDataView(Rectangle bounds, int leftMargin, int topMargin) {
130124
}
131125

132126
/**
133-
*
134127
* @param g2d
135128
*/
136129
protected void paintInit(GraphicsContext g2d) {
137130
relocate(x, y);
138131
g2d.clearRect(0, 0, width, height);
139132
}
140-
133+
141134
/**
142-
*
143135
* @param g2d
144136
*/
145137
public void paint(GraphicsContext g2d) {
146138
paintInit(g2d);
147139

148140
drawBorder(g2d);
149141
}
150-
142+
151143
public void repaint() {
152144
paint(this.getGraphicsContext2D());
153145
}
@@ -163,9 +155,8 @@ private void drawBorder(GraphicsContext g2d) {
163155
g2d.strokeRect(1, 1, width - 1, height - 1);
164156

165157
}
166-
158+
167159
/**
168-
*
169160
* @param x
170161
* @return mapped x
171162
*/
@@ -174,7 +165,6 @@ public double mapX(double x) {
174165
}
175166

176167
/**
177-
*
178168
* @param y
179169
* @return mapped y
180170
*/
@@ -183,8 +173,7 @@ protected double mapY(double y) {
183173
}
184174

185175
/**
186-
*
187-
* @param doReScale the value of doReScale
176+
* @param doReScale the value of doReScale
188177
* @param inLiveMode the value of inLiveMode
189178
*/
190179
public void refreshPanel(boolean doReScale, boolean inLiveMode) {
@@ -196,9 +185,6 @@ public void refreshPanel(boolean doReScale, boolean inLiveMode) {
196185
}
197186

198187
/**
199-
*
200-
* @param doReScale the value of doReScale
201-
* @param inLiveMode the value of inLiveMode
202188
*/
203189
public abstract void preparePanel();
204190

@@ -231,47 +217,41 @@ public void setDisplayOffsetX(double displayOffsetX) {
231217
}
232218

233219
/**
234-
*
235220
* @return minimum displayed x
236221
*/
237222
public double getMinX_Display() {
238223
return minX + displayOffsetX;
239224
}
240225

241226
/**
242-
*
243227
* @return maximum displayed x
244228
*/
245229
public double getMaxX_Display() {
246230
return maxX + displayOffsetX;
247231
}
248232

249233
/**
250-
*
251234
* @return minimum displayed y
252235
*/
253236
public double getMinY_Display() {
254237
return minY + displayOffsetY;
255238
}
256239

257240
/**
258-
*
259241
* @return maximum displayed y
260242
*/
261243
public double getMaxY_Display() {
262244
return maxY + displayOffsetY;
263245
}
264246

265247
/**
266-
*
267248
* @return
268249
*/
269250
public double getRangeX_Display() {
270251
return (getMaxX_Display() - getMinX_Display());
271252
}
272253

273254
/**
274-
*
275255
* @return
276256
*/
277257
public double getRangeY_Display() {
@@ -293,20 +273,18 @@ public double[] getMyOnPeakNormalizedAquireTimes() {
293273
}
294274

295275
/**
296-
*
297276
* @param x
298277
* @return
299278
*/
300279
protected double convertMouseXToValue(double x) {
301-
double convertedX = (((double) (x - leftMargin + 2)) / (double) graphWidth) //
280+
double convertedX = ((x - leftMargin + 2) / (double) graphWidth) //
302281
* getRangeX_Display()//
303282
+ getMinX_Display();
304283

305284
return convertedX;
306285
}
307286

308287
/**
309-
*
310288
* @param y
311289
* @return
312290
*/
@@ -321,4 +299,13 @@ protected boolean mouseInHouse(javafx.scene.input.MouseEvent evt) {
321299
&& (evt.getY() < graphHeight + topMargin - 2)
322300
&& (evt.getX() < (graphWidth + leftMargin - 2)));
323301
}
302+
303+
public void setGraphWidth(int graphWidth) {
304+
this.graphWidth = graphWidth;
305+
}
306+
307+
public void setMyWidth(double width) {
308+
this.width = width;
309+
setWidth(width);
310+
}
324311
}

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

+8-4
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@
1515
*/
1616
package org.cirdles.squid.gui.dataViews;
1717

18+
import org.cirdles.squid.prawn.PrawnFile;
19+
20+
import java.util.List;
21+
1822
/**
1923
*
2024
* @author James F. Bowring, CIRDLES.org, and Earth-Time.org
2125
*/
2226
public interface MassAuditRefreshInterface {
23-
public void updateGraphsWithSelectedIndex(int index);
27+
public void updateGraphsWithSelectedIndex(int index, int leadingZoomingTrailing);
2428

25-
public void updateGraphsWithSecondSelectedIndex(int index);
29+
public void updateGraphsWithSecondSelectedIndex(int index, int leadingZoomingTrailing);
2630

2731
/**
2832
*
2933
*/
3034
public void updateSpotsInGraphs();
3135

32-
public int[] getCountOfScansCumulative();
33-
}
36+
public int[] getCountOfScansCumulative(List<PrawnFile.Run> prawnFileRuns);
37+
}

0 commit comments

Comments
 (0)