Skip to content

Commit

Permalink
Updates Useries visualizations and addresses issues 182, 181, 171, 16…
Browse files Browse the repository at this point in the history
…4. (#183)

* fixes alwaysinfront

* fixes bug found by Noah

* tests open-system date calculator and fixes bug in seawater models population.

* working towards open-system dates

* improves graph zooming

* adds joption pane message for exception

* provides opensystem dates and unct for default seawater model

* advances seawater assignment, fixes uri timeout bug

* completes assignment of seawater models for open-system dates

* adds seawater uncertainties to evolution plots

* refactors and addresses issue 182

* fixes misc gui bugs

* fixes issue #164 by changing the fraction mass display and entry units to micrograms and sorting the fraction names in the sample manager.
  • Loading branch information
bowring authored Jul 21, 2019
1 parent 629edfe commit e555825
Show file tree
Hide file tree
Showing 47 changed files with 1,840 additions and 720 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>org.cirdles</groupId>
<artifactId>ET_Redux</artifactId>
<name>ET_Redux</name>
<version>3.6.84</version>
<version>3.6.85</version>
<description>Successor to U-Pb_Redux</description>
<url>https://cirdles.org</url>
<inceptionYear>2006</inceptionYear>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/earthtime/UPb_Redux/ReduxConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ final public class ReduxConstants {
/**
*
*/
static public int DEFAULT_MASS_DISPLAY_SCALE = 5;
static public int DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE = 5;
static public int DEFAULT_MASS_IN_MICRO_GRAMS_DISPLAY_SCALE = 3;
/**
*
*/
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/earthtime/UPb_Redux/aliquots/UPbReduxAliquot.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public UPbReduxAliquot(

setDefaultUBlankMassText(getMyReduxLabData().getDefaultAssumedUBlankMassInGrams().
getValue().multiply(ReduxConstants.PicoGramsPerGram).
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

setDefaultR238_235sText(getMyReduxLabData().getDefaultR238_235s()//
Expand All @@ -227,7 +227,7 @@ public UPbReduxAliquot(
RoundingMode.HALF_UP).toPlainString());

setDefaultR18O_16OText(getMyReduxLabData().getDefaultR18O_16O()//
.getValue().setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
.getValue().setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

try {
Expand All @@ -244,7 +244,7 @@ public UPbReduxAliquot(

setDefaultPbBlankMassText(getMyReduxLabData().getDefaultPbBlankMassInGrams().
getValue().multiply(ReduxConstants.PicoGramsPerGram).
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

setDefaultRTh_UmagmaText(getMyReduxLabData().getDefaultRTh_Umagma().
Expand All @@ -267,38 +267,38 @@ public UPbReduxAliquot(

// uncertainties
setDefaultTracerMassOneSigmaText(getMyReduxLabData().getDefaultTracerMass()//
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

setDefaultUBlankMassOneSigmaText(getMyReduxLabData().getDefaultAssumedUBlankMassInGrams()//
.getOneSigmaAbs().multiply(ReduxConstants.PicoGramsPerGram)//
.setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
.setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

setDefaultR238_235sOneSigmaText(getMyReduxLabData().getDefaultR238_235s()//
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

this.defaultR238_235bOneSigmaText = getMyReduxLabData().getDefaultR238_235b()//
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString();

this.defaultPbBlankMassOneSigmaText = getMyReduxLabData().getDefaultPbBlankMassInGrams()//
.getOneSigmaAbs().multiply(ReduxConstants.PicoGramsPerGram).//
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString();

// TODO there is some odd duplication with this getters setters
setDefaultR18O_16OOneSigmaText(getMyReduxLabData().getDefaultR18O_16O()//
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

this.defaultRTh_UmagmaOneSigmaText = getMyReduxLabData().getDefaultRTh_Umagma()//
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString();

this.defaultAr231_235sampleOneSigmaText = getMyReduxLabData().getDefaultAr231_235sample()//
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
.getOneSigmaAbs().setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString();

this.automaticDataUpdateMode = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4079,7 +4079,7 @@ private void updateInitialPbModelChooserForRow(ETFractionInterface tempFrac, boo
toPlainString());
fractionStaceyKramersCorrelationCoeffsText.get(row).setEnabled(hasStaceyKramersModel);

((JTextComponent) fractionPbBlankMassText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.pbBlankMassInGrams.getName()).getValue().multiply(ReduxConstants.PicoGramsPerGram).setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
((JTextComponent) fractionPbBlankMassText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.pbBlankMassInGrams.getName()).getValue().multiply(ReduxConstants.PicoGramsPerGram).setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());
((UnDoAbleDocument) ((JTextComponent) fractionPbBlankMassText.get(row)).getDocument()).undo.discardAllEdits();
fractionPbBlankMassText.get(row).setEnabled(!isZircon);
Expand Down Expand Up @@ -4107,12 +4107,12 @@ private void updateFractionRow(ETFractionInterface tempFrac, int row) {
fractionTracerChoice.get(row).setEnabled(!(fraCorrU || fraCorrPb));

((JTextComponent) fractionTracerMassText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.tracerMassInGrams.getName()).getValue().
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());
fractionTracerMassText.get(row).setEnabled(!(fraCorrU));

((JTextComponent) fractionMassText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.fractionMass.getName()).getValue().
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE, RoundingMode.HALF_UP).//
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE, RoundingMode.HALF_UP).//
toPlainString());

updateAlphaPbModelChooserForRow(tempFrac, ((UPbFraction) tempFrac).needsAlphaPbModel(), row);
Expand All @@ -4123,11 +4123,11 @@ private void updateFractionRow(ETFractionInterface tempFrac, int row) {

updateInitialPbModelChooserForRow(tempFrac, isZircon, row);

((JTextField) fractionPbBlankMassText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.pbBlankMassInGrams.getName()).getValue().multiply(ReduxConstants.PicoGramsPerGram).setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
((JTextField) fractionPbBlankMassText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.pbBlankMassInGrams.getName()).getValue().multiply(ReduxConstants.PicoGramsPerGram).setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());
fractionPbBlankMassText.get(row).setEnabled(!isZircon);

((JTextField) fractionUBlankMassText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.uBlankMassInGrams.getName()).getValue().multiply(ReduxConstants.PicoGramsPerGram).setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
((JTextField) fractionUBlankMassText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.uBlankMassInGrams.getName()).getValue().multiply(ReduxConstants.PicoGramsPerGram).setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());
fractionUBlankMassText.get(row).setEnabled(!(fraCorrU));

Expand All @@ -4147,36 +4147,36 @@ private void updateFractionRow(ETFractionInterface tempFrac, int row) {
fractionR18O_16OText.get(row).setEnabled(((UPbFraction) tempFrac).isAnOxide());

((JTextField) fractionRTh_UmagmaText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.rTh_Umagma.getName()).getValue().
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE, RoundingMode.HALF_UP).//
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE, RoundingMode.HALF_UP).//
toPlainString());
fractionRTh_UmagmaText.get(row).setEnabled(true);

((JTextField) fractionAR231_235sampleText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.ar231_235sample.getName()).getValue().
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE, RoundingMode.HALF_UP).//
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE, RoundingMode.HALF_UP).//
toPlainString());
fractionAR231_235sampleText.get(row).setEnabled(true);

// uncertainties
((JTextField) fractionTracerMassOneSigmaText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.tracerMassInGrams.getName()).getOneSigmaAbs().
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

((JTextField) fractionUBlankMassOneSigmaText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.uBlankMassInGrams.getName()).getOneSigmaAbs().//
multiply(ReduxConstants.PicoGramsPerGram).
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE, RoundingMode.HALF_UP).//
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE, RoundingMode.HALF_UP).//
toPlainString());

((JTextField) fractionR238_235sOneSigmaText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.r238_235s.getName()).getOneSigmaAbs().
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

((JTextField) fractionR238_235bOneSigmaText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.r238_235b.getName()).getOneSigmaAbs().
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

((JTextField) fractionPbBlankMassOneSigmaText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.pbBlankMassInGrams.getName()).getOneSigmaAbs().
multiply(ReduxConstants.PicoGramsPerGram).
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());
fractionPbBlankMassOneSigmaText.get(row).setEnabled(!isZircon);

Expand All @@ -4186,11 +4186,11 @@ private void updateFractionRow(ETFractionInterface tempFrac, int row) {
fractionR18O_16OOneSigmaText.get(row).setEnabled(((UPbFraction) tempFrac).isAnOxide());

((JTextField) fractionRTh_UmagmaOneSigmaText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.rTh_Umagma.getName()).getOneSigmaAbs().
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

((JTextField) fractionAr231_235sampleOneSigmaText.get(row)).setText(tempFrac.getAnalysisMeasure(AnalysisMeasures.ar231_235sample.getName()).getOneSigmaAbs().
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE,
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE,
RoundingMode.HALF_UP).toPlainString());

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3500,8 +3500,10 @@
<Font name="Tahoma" size="12" style="1"/>
</Property>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="fraction mass in g:"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="fractionMassInGrams_label.setText(&quot;fraction mass in \u03BCg:&quot;);&#xa;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JCheckBox" name="fractionIsZircon_CheckBox">
<Properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1440,8 +1440,9 @@ private void showSavedData(ETFractionInterface myFraction) {

fractionIsZircon_CheckBox.setSelected(((FractionI)myFraction).isZircon());

// july 2019 issue 164 - switching to micrograms
fractionMass_text.setText(myFraction.getAnalysisMeasure(AnalysisMeasures.fractionMass.getName()).//
getValue().setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, RoundingMode.HALF_UP).toPlainString());
getValue().movePointRight(6).setScale(ReduxConstants.DEFAULT_MASS_IN_MICRO_GRAMS_DISPLAY_SCALE, RoundingMode.HALF_UP).toPlainString());

// Pb tab **************************************************************
r206_204_text.setText(myFraction.getMeasuredRatioByName(MeasuredRatios.r206_204m.getName()).//
Expand Down Expand Up @@ -1554,14 +1555,14 @@ private void showSavedData(ETFractionInterface myFraction) {

inputAlphaUOneSigmaAbs_text.setText(((UPbFraction) myFraction).getInputAlphaU().getOneSigmaAbs().//
movePointRight(2).//
setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE, RoundingMode.HALF_UP).toPlainString());
setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE, RoundingMode.HALF_UP).toPlainString());

// tracer tab **********************************************************
tracerMassOneSigmaAbs_label.setText("<html><u>1\u03C3 ABS:</u></html>");
tracerMass_text.setText(myFraction.getAnalysisMeasure(AnalysisMeasures.tracerMassInGrams.getName()).//
getValue().setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, RoundingMode.HALF_UP).toPlainString());
tracerMassOneSigmaAbs_text.setText(myFraction.getAnalysisMeasure(AnalysisMeasures.tracerMassInGrams.getName()).//
getOneSigma().setScale(ReduxConstants.DEFAULT_MASS_DISPLAY_SCALE, RoundingMode.HALF_UP).toPlainString());
getOneSigma().setScale(ReduxConstants.DEFAULT_MASS_IN_GRAMS_DISPLAY_SCALE, RoundingMode.HALF_UP).toPlainString());

// set up Tracer chooser modified June 2012
ItemListener[] tracerActionListeners = tracerChooser.getItemListeners();
Expand Down Expand Up @@ -2004,8 +2005,9 @@ private void save(ETFractionInterface myFraction)
}

try {
// july 2019 issue 164 switch to micrograms display
myFraction.getAnalysisMeasure(AnalysisMeasures.fractionMass.getName()).
setValue(new BigDecimal(fractionMass_text.getText()));
setValue(new BigDecimal(fractionMass_text.getText()).movePointLeft(6));

// Pb tab
myFraction.getMeasuredRatioByName(MeasuredRatios.r206_204m.getName()).setValue(new BigDecimal(r206_204_text.getText()));
Expand Down Expand Up @@ -2475,6 +2477,7 @@ private void initComponents() {
fractionMass_text = new javax.swing.JTextField();
fractionID_text = new javax.swing.JTextField();
fractionMassInGrams_label = new javax.swing.JLabel();
fractionMassInGrams_label.setText("fraction mass in \u03BCg:");
fractionIsZircon_CheckBox = new javax.swing.JCheckBox();
fraction_Chooser = new javax.swing.JComboBox<>();
fractionID_label1 = new javax.swing.JLabel();
Expand Down Expand Up @@ -4142,7 +4145,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

fractionMassInGrams_label.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
fractionMassInGrams_label.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
fractionMassInGrams_label.setText("fraction mass in g:");

fractionIsZircon_CheckBox.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
fractionIsZircon_CheckBox.setText("No InitialPb");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,6 @@
</Property>
<Property name="text" type="java.lang.String" value="Set Physical Constants:"/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Set Physical Constants:"/>
</AccessibilityProperties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="670" y="30" width="140" height="30"/>
Expand Down
Loading

0 comments on commit e555825

Please sign in to comment.