diff --git a/pom.xml b/pom.xml index b2a33919..ad52a8d7 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ org.cirdles ET_Redux ET_Redux - 3.6.6 + 3.6.7 Successor to U-Pb_Redux https://cirdles.org 2006 diff --git a/src/main/java/org/earthtime/ETReduxFrame.form b/src/main/java/org/earthtime/ETReduxFrame.form index 09c9486f..7029fa28 100644 --- a/src/main/java/org/earthtime/ETReduxFrame.form +++ b/src/main/java/org/earthtime/ETReduxFrame.form @@ -398,7 +398,6 @@ - @@ -409,7 +408,6 @@ - @@ -418,7 +416,6 @@ - @@ -840,6 +837,9 @@ + + + diff --git a/src/main/java/org/earthtime/ETReduxFrame.java b/src/main/java/org/earthtime/ETReduxFrame.java index ffba1b9a..57ec8141 100644 --- a/src/main/java/org/earthtime/ETReduxFrame.java +++ b/src/main/java/org/earthtime/ETReduxFrame.java @@ -1012,8 +1012,7 @@ private void setUpNewSample(String sampleType, String sampleAnalysisType, String // set up a new empty sample based on sampleType theSample - = // - new Sample("NONE", sampleType, sampleAnalysisType, myState.getReduxPreferences().getDefaultSampleAnalysisPurpose(), isotopeStyle); + = new Sample("NONE", sampleType, sampleAnalysisType, myState.getReduxPreferences().getDefaultSampleAnalysisPurpose(), isotopeStyle); SampleInterface.specializeNewSample(theSample); // manageTheSample sets up the correct form and returns whether it was successful @@ -1398,33 +1397,22 @@ public synchronized void setUpTheSample(boolean performReduction) { private void buildAliquotsMenu() { // aug 2010 provide aliquot management menu + boolean doActivate = (theSample.getActiveAliquots().size() > 0); aliquotsMenu.removeAll(); - aliquotsMenu.setEnabled(false); - fractionsMenu.setEnabled(false); - selectAllFractions_menuItem.setEnabled(false); - deSelectAllFractions_menuItem.setEnabled(false); + aliquotsMenu.setEnabled(doActivate); + fractionsMenu.setEnabled(doActivate); + selectAllFractions_menuItem.setEnabled(doActivate); + deSelectAllFractions_menuItem.setEnabled(doActivate); - theSample.getActiveAliquots().stream().map((a) -> { + theSample.getActiveAliquots().stream().forEach((a) -> { JMenuItem menuItem = aliquotsMenu.add(new JMenuItem(a.getAliquotName())); - menuItem.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(java.awt.event.ActionEvent evt) { - editAliquotByNumber(((ReduxAliquotInterface) a).getAliquotNumber()); - } + menuItem.addActionListener((java.awt.event.ActionEvent evt) -> { + editAliquotByNumber(((ReduxAliquotInterface) a).getAliquotNumber()); }); - return a; - }).map((_item) -> { - aliquotsMenu.setEnabled(true); - return _item; - }).map((_item) -> { - fractionsMenu.setEnabled(true); - return _item; - }).map((_item) -> { - selectAllFractions_menuItem.setEnabled(true); - return _item; - }).forEach((_item) -> { - deSelectAllFractions_menuItem.setEnabled(true); }); + + //forces menu update + pack(); } private void customizeReduxSkin() { @@ -1493,7 +1481,6 @@ public void updateReportTable(boolean performReduction, boolean inLiveMode, Stri ((SampleDateInterpretationsManager) sampleDateInterpDialog).setSample(theSample); } -// updated with rescaling april 2016 try { ((SampleDateInterpretationsManager) sampleDateInterpDialog).refreshSampleDateInterpretations(false, inLiveMode); } catch (Exception e) { @@ -2023,6 +2010,7 @@ private void initComponents() { setTitle("EARTHTIME Redux"); setBackground(new java.awt.Color(237, 242, 250)); setLocationByPlatform(true); + setPreferredSize(new java.awt.Dimension(1160, 750)); addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { formComponentResized(evt); @@ -2589,13 +2577,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { mainMenuBar.add(sampleFileMenu); aliquotsMenu.setText("Aliquots"); - aliquotsMenu.setEnabled(false); mainMenuBar.add(aliquotsMenu); fractionsMenu.setText("Fractions"); selectAllFractions_menuItem.setText("Select All Fractions"); - selectAllFractions_menuItem.setEnabled(false); selectAllFractions_menuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectAllFractions_menuItemActionPerformed(evt); @@ -2604,7 +2590,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { fractionsMenu.add(selectAllFractions_menuItem); deSelectAllFractions_menuItem.setText("De-select All Fractions"); - deSelectAllFractions_menuItem.setEnabled(false); deSelectAllFractions_menuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deSelectAllFractions_menuItemActionPerformed(evt); @@ -3823,7 +3808,8 @@ private void editAliquot(SampleInterface sample, AliquotInterface aliquot) { * @param aliquot */ public void editAliquotByProjectType(AliquotInterface aliquot) { - if (theSample.isSampleTypeProject() && !theSample.getSampleAnalysisType().equalsIgnoreCase("TRIPOLIZED")) { + if (theSample.isSampleTypeProject() // + && !theSample.getSampleAnalysisType().equalsIgnoreCase("TRIPOLIZED")) { // Project has a compiledSuperSample made up of actual projectSamples // we need the actual sample associated with this aliquot // this aliquot is a copy for compiled super sample and we need diff --git a/src/main/java/org/earthtime/Tripoli/dataModels/RawRatioDataModel.java b/src/main/java/org/earthtime/Tripoli/dataModels/RawRatioDataModel.java index e6ec7f77..063844af 100644 --- a/src/main/java/org/earthtime/Tripoli/dataModels/RawRatioDataModel.java +++ b/src/main/java/org/earthtime/Tripoli/dataModels/RawRatioDataModel.java @@ -1151,6 +1151,7 @@ public long getCollectorDataFrequencyMillisecs() { /** * @return the dataActiveMap */ + @Override public boolean[] getDataActiveMap() { return dataActiveMap; } diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java b/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java index c69f66e5..b7d8a981 100644 --- a/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java +++ b/src/main/java/org/earthtime/Tripoli/dataViews/overlayViews/TripoliSessionRawDataView.java @@ -708,10 +708,23 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) { double overallMaxY = -Double.MAX_VALUE; boolean atLeastOneStandard = true; - for (int f = 0; f < (fractionCountForHorizontalLayout); f++) { - if (Double.isFinite(rawDataModelViews[i][f].getMinY()) && Double.isFinite(rawDataModelViews[i][f].getMaxY())) { - overallMinY = Math.min(overallMinY, rawDataModelViews[i][f].getMinY()); - overallMaxY = Math.max(overallMaxY, rawDataModelViews[i][f].getMaxY()); + if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.SESSION)) { + for (int f = 0; f < (fractionCountForHorizontalLayout); f++) { + if (Double.isFinite(rawDataModelViews[i][f].getMinY()) && Double.isFinite(rawDataModelViews[i][f].getMaxY())) { + overallMinY = Math.min(overallMinY, rawDataModelViews[i][f].getMinY()); + overallMaxY = Math.max(overallMaxY, rawDataModelViews[i][f].getMaxY()); + } + } + } else { + for (int f = 0; f < (fractionCountForHorizontalLayout); f++) { + if (Double.isFinite(rawDataModelViews[i][f].getMinY()) // + && Double.isFinite(rawDataModelViews[i][f].getMaxY())// + && !rawDataModelViews[i][f].isNotShownDueToBelowDetectionFlag()// + && !((SAVED_DATA_USED_FOR_SCALING.equals(IncludedTypeEnum.INCLUDED)// + && !rawDataModelViews[i][f].getTripoliFraction().isIncluded()))) { + overallMinY = Math.min(overallMinY, rawDataModelViews[i][f].getMinY()); + overallMaxY = Math.max(overallMaxY, rawDataModelViews[i][f].getMaxY()); + } } } @@ -933,8 +946,7 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) { // TODO: dec 2012 check for missing ratio due to all belowDetection if (rawDataModelViews[i][0] instanceof FitFunctionsOnRatioDataView) { RawRatioNames rrName - = // - rawDataModelViews[i][0].getDataModel().getRawRatioModelName(); + = rawDataModelViews[i][0].getDataModel().getRawRatioModelName(); ((DataViewsOverlay) rawDataModelViewsOverlay).setFractionationDataModel(downholeFractionationDataModels.get(rrName)); @@ -972,7 +984,6 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) { AbstractRawDataView residualsYAxisLabel = new ResidualsYAxisLabel(// rawDataModelViews[0][0], // new Rectangle(// - // 1,// i * (dataModelHeight + HEIGHT_OF_OVERLAY_XAXIS_PANES + residualsHeight + verticalGraphSeparation) + topMargin + dataModelHeight + HEIGHT_OF_OVERLAY_XAXIS_PANES, // tripoliSessionRawDataViewYAxis.getWidth() - 1, // @@ -1008,30 +1019,32 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) { } } - // establish graphWidth - if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.GRAPH)) { - minX = tripoliFractions.first().getPeakTimeStamp(); - maxX = tripoliFractions.last().getPeakTimeStamp() // - + (rawDataModelViews[0][0].getRangeX_Display() * rawDataModelViews[0][0].getDataModel().getCollectorDataFrequencyMillisecs()); - graphWidth = (int) ((maxX - minX) * dataModelWidth // - / rawDataModelViews[0][0].getRangeX_Display() / rawDataModelViews[0][0].getDataModel().getCollectorDataFrequencyMillisecs()); - - } else if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.OVERLAY)) { - minX = 0; - maxX = dataModelWidth + horizontalGraphSeparation + WIDTH_OF_FIT_FUNCTION_PANES; - graphWidth = (int) (maxX - minX); - - } else if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.SESSION)) { - minX = 0; - maxX = fractionCountForHorizontalLayout * (sessionModelWidth + horizontalGraphSeparation); - graphWidth = (int) (maxX - minX); - graphWidth += countOfLocalYAxisPanes * WIDTH_OF_LOCAL_YAXIS_PANES + countOfInterceptFitFunctionsPresentationPanes * WIDTH_OF_FIT_FUNCTION_PANES; - - } else { - minX = 0; - maxX = fractionCountForHorizontalLayout * (dataModelWidth + horizontalGraphSeparation); - graphWidth = (int) (maxX - minX); - graphWidth += countOfLocalYAxisPanes * WIDTH_OF_LOCAL_YAXIS_PANES + countOfInterceptFitFunctionsPresentationPanes * WIDTH_OF_FIT_FUNCTION_PANES; + // establish graphWidth + switch (FRACTION_LAYOUT_VIEW_STYLE) { + case GRAPH: + minX = tripoliFractions.first().getPeakTimeStamp(); + maxX = tripoliFractions.last().getPeakTimeStamp() // + + (rawDataModelViews[0][0].getRangeX_Display() * rawDataModelViews[0][0].getDataModel().getCollectorDataFrequencyMillisecs()); + graphWidth = (int) ((maxX - minX) * dataModelWidth // + / rawDataModelViews[0][0].getRangeX_Display() / rawDataModelViews[0][0].getDataModel().getCollectorDataFrequencyMillisecs()); + break; + case OVERLAY: + minX = 0; + maxX = dataModelWidth + horizontalGraphSeparation + WIDTH_OF_FIT_FUNCTION_PANES; + graphWidth = (int) (maxX - minX); + break; + case SESSION: + minX = 0; + maxX = fractionCountForHorizontalLayout * (sessionModelWidth + horizontalGraphSeparation); + graphWidth = (int) (maxX - minX); + graphWidth += countOfLocalYAxisPanes * WIDTH_OF_LOCAL_YAXIS_PANES + countOfInterceptFitFunctionsPresentationPanes * WIDTH_OF_FIT_FUNCTION_PANES; + break; + default: + minX = 0; + maxX = fractionCountForHorizontalLayout * (dataModelWidth + horizontalGraphSeparation); + graphWidth = (int) (maxX - minX); + graphWidth += countOfLocalYAxisPanes * WIDTH_OF_LOCAL_YAXIS_PANES + countOfInterceptFitFunctionsPresentationPanes * WIDTH_OF_FIT_FUNCTION_PANES; + break; } // create vertical fraction panes for layout on x = time axis ******************************************************** diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/simpleViews/usedByReflection/RawRatioDataView.java b/src/main/java/org/earthtime/Tripoli/dataViews/simpleViews/usedByReflection/RawRatioDataView.java index 446c498e..38875648 100644 --- a/src/main/java/org/earthtime/Tripoli/dataViews/simpleViews/usedByReflection/RawRatioDataView.java +++ b/src/main/java/org/earthtime/Tripoli/dataViews/simpleViews/usedByReflection/RawRatioDataView.java @@ -133,7 +133,8 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) { boolean showAll = showIncludedDataPoints.equals(IncludedTypeEnum.ALL); // rework logic April 2016 for (int i = 0; i < myOnPeakData.length; i++) { - if ((Double.isFinite(myOnPeakData[i])) && (showAll || myDataActiveMap[i])) { + if ((Double.isFinite(myOnPeakData[i])) // + && (showAll || myDataActiveMap[i])) { minY = Math.min(minY, myOnPeakData[i]); maxY = Math.max(maxY, myOnPeakData[i]); } diff --git a/src/main/java/org/earthtime/Tripoli/fractions/TripoliFraction.java b/src/main/java/org/earthtime/Tripoli/fractions/TripoliFraction.java index 59f18f71..ed23bba6 100644 --- a/src/main/java/org/earthtime/Tripoli/fractions/TripoliFraction.java +++ b/src/main/java/org/earthtime/Tripoli/fractions/TripoliFraction.java @@ -509,7 +509,7 @@ public Matrix calculateUncertaintyPbcCorrections(FractionationTechniquesEnum fra if (matrixIndicesToRemove.size() > 0) { - System.out.println("Matrix row col delete for fraction " + fractionID); +// System.out.println("Matrix row col delete for fraction " + fractionID + " count = " + matrixIndicesToRemove.size()); // reverse list of indices to remove to avoid counting errors Collections.sort(matrixIndicesToRemove, (Integer i1, Integer i2) -> Integer.compare(i2, i1)); @@ -522,15 +522,16 @@ public Matrix calculateUncertaintyPbcCorrections(FractionationTechniquesEnum fra Sopbclr_207CorrectedCols = MatrixRemover.removeCol(Sopbclr_207CorrectedCols, indexToRemove); } } - SlogRatioAll.setMatrix(0 + 3 * columnsCount, matrixIndex + 3 * columnsCount - 1, 0, columnsCount - 1, Sopbclr_206CorrectedRows); - SlogRatioAll.setMatrix(0 + 3 * columnsCount, matrixIndex + 3 * columnsCount - 1, columnsCount, 2 * columnsCount - 1, Sopbclr_206CorrectedRows); + int rowCount = matrixIndex - matrixIndicesToRemove.size() + 1; + SlogRatioAll.setMatrix(0 + 3 * columnsCount, rowCount + 3 * columnsCount - 1, 0, columnsCount - 1, Sopbclr_206CorrectedRows); + SlogRatioAll.setMatrix(0 + 3 * columnsCount, rowCount + 3 * columnsCount - 1, columnsCount, 2 * columnsCount - 1, Sopbclr_206CorrectedRows); + + SlogRatioAll.setMatrix(rowCount + 3 * columnsCount, 2 * rowCount + 3 * columnsCount - 1, 0, columnsCount - 1, Sopbclr_207CorrectedRows); - SlogRatioAll.setMatrix(matrixIndex + 3 * columnsCount, 2 * matrixIndex + 3 * columnsCount - 1, 0, columnsCount - 1, Sopbclr_207CorrectedRows); + SlogRatioAll.setMatrix(0, 0, 0 + 3 * columnsCount, +3 * columnsCount + rowCount - 1, Sopbclr_206CorrectedCols); + SlogRatioAll.setMatrix(columnsCount, columnsCount, 0 + 3 * columnsCount, +3 * columnsCount + rowCount - 1, Sopbclr_206CorrectedCols); - SlogRatioAll.setMatrix(0, 0, 0 + 3 * columnsCount, +3 * columnsCount + matrixIndex - 1, Sopbclr_206CorrectedCols); - SlogRatioAll.setMatrix(columnsCount, columnsCount, 0 + 3 * columnsCount, +3 * columnsCount + matrixIndex - 1, Sopbclr_206CorrectedCols); - - SlogRatioAll.setMatrix(0, 0, matrixIndex + 3 * columnsCount, 2 * matrixIndex + 3 * columnsCount - 1, Sopbclr_207CorrectedCols); + SlogRatioAll.setMatrix(0, 0, rowCount + 3 * columnsCount, 2 * rowCount + 3 * columnsCount - 1, Sopbclr_207CorrectedCols); } if (rr.getRawRatioModelName().compareTo(RawRatioNames.r208_232w) == 0) { @@ -560,10 +561,13 @@ public Matrix calculateUncertaintyPbcCorrections(FractionationTechniquesEnum fra Sopbclr_208CorrectedCols = MatrixRemover.removeCol(Sopbclr_208CorrectedCols, indexToRemove); } } - SlogRatioAll.setMatrix(3 * columnsCount + 2 * matrixIndex, 3 * columnsCount + 3 * matrixIndex - 1, 2 * columnsCount, 3 * columnsCount - 1, Sopbclr_208CorrectedRows); - - SlogRatioAll.setMatrix(2 * columnsCount, 3 * columnsCount - 1, 3 * columnsCount + 2 * matrixIndex, 3 * columnsCount + 3 * matrixIndex - 1, Sopbclr_208CorrectedCols); - + + int rowCount = matrixIndex - matrixIndicesToRemove.size() + 1; + + SlogRatioAll.setMatrix(3 * columnsCount + 2 * rowCount, 3 * columnsCount + 3 * rowCount - 1, 2 * columnsCount, 3 * columnsCount - 1, Sopbclr_208CorrectedRows); + + SlogRatioAll.setMatrix(2 * columnsCount, 3 * columnsCount - 1, 3 * columnsCount + 2 * rowCount, 3 * columnsCount + 3 * rowCount - 1, Sopbclr_208CorrectedCols); + } } } @@ -1551,9 +1555,17 @@ public void reProcessToRejectNegativeRatios() { // may 2015 per Noah, turn off all negative values - neg in a ratio turns off all in that position for fraction for (DataModelInterface rr : rawRatios) { double[] ratios = ((RawRatioDataModel) rr).getRatios(); +// for (int i = 0; i < ratios.length; i++) { +// if (ratios[i] < 0.0) { +// toggleOneDataAquisition(i, false); +// } +// } + // sept 2016 change in plans + // we want all */204 ratios to keep rejected bad (negative) values but those do NOT change non */204 ratios for (int i = 0; i < ratios.length; i++) { - if (ratios[i] < 0.0) { - toggleOneDataAquisition(i, false); + // sept 2016 new condition + if (rr.isUsedForCommonLeadCorrections() && (ratios[i] < 0.0)) { + toggleOneDataAquisitionForPbcOnly(i, false); } } } @@ -1625,17 +1637,17 @@ public boolean isCurrentlyFitted() { public void setCurrentlyFitted(boolean currentlyFitted) { this.currentlyFitted = currentlyFitted; } - - public String dateSummary(){ - return fractionID + + public String dateSummary() { + return fractionID + "> 206/238: " + uPbFraction.getRadiogenicIsotopeDateByName(RadDates.age206_238r) - .formatValueAndTwoSigmaForPublicationSigDigMode("ABS", -6, 2) + .formatValueAndTwoSigmaForPublicationSigDigMode("ABS", -6, 2) + "> 207/235: " + uPbFraction.getRadiogenicIsotopeDateByName(RadDates.age207_235r) - .formatValueAndTwoSigmaForPublicationSigDigMode("ABS", -6, 2) + .formatValueAndTwoSigmaForPublicationSigDigMode("ABS", -6, 2) + "> 207/206: " + uPbFraction.getRadiogenicIsotopeDateByName(RadDates.age207_206r) - .formatValueAndTwoSigmaForPublicationSigDigMode("ABS", -6, 2); + .formatValueAndTwoSigmaForPublicationSigDigMode("ABS", -6, 2); } } diff --git a/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/DateProbabilityDensityPanel.java b/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/DateProbabilityDensityPanel.java index 05e032cd..c18cb50c 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/DateProbabilityDensityPanel.java +++ b/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/DateProbabilityDensityPanel.java @@ -500,7 +500,7 @@ private void drawHistograms(Graphics2D g2d, List visibleSample) { double dataRange = 0; try { dataRange = ((visibleSample.get(visibleSample.size() - 1)) - visibleSample.get(0)); - dataRange *= 1.05; + dataRange +=100; // oct 2016 changed due to bug found by Matt Rioux *= 1.05; } catch (Exception e) { } diff --git a/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeAnalysisMode.java b/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeAnalysisMode.java index d138dea6..195b30d7 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeAnalysisMode.java +++ b/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeAnalysisMode.java @@ -58,7 +58,10 @@ public class SampleTreeAnalysisMode extends JTree implements SampleTreeI { private SampleInterface sample; private SampleTreeChangeI sampleTreeChange; private Object lastNodeSelected; - private static transient boolean suppressSelectionEvent = false; + private static boolean sortByDateAsc = false; + private int selRow; + private int selRowX; + private int selRowY; /** * Creates a new instance of SampleTreeAnalysisMode @@ -97,25 +100,23 @@ public void buildTree() { this.removeAll(); // populate tree - // todo: just walk aliquots now that ths mapping is fixed (may 2015) -// int saveAliquotNum = -1; -// for (int i = 0; i < sample.getFractions().size(); i++) { for (int i = 0; i < sample.getActiveAliquots().size(); i++) { -// ETFractionInterface tempFraction = sample.getFractions().get(i); AliquotInterface tempAliquot = sample.getActiveAliquots().get(i); - -// if (!tempFraction.isRejected()) { -// if (saveAliquotNum != tempFraction.getAliquotNumber()) { -// saveAliquotNum = tempFraction.getAliquotNumber(); - //tempAliquot = sample.getAliquotByNumber(saveAliquotNum); aliquotNode = new DefaultMutableTreeNode(tempAliquot); ((DefaultMutableTreeNode) getModel().getRoot()).add(aliquotNode); // get a master vector of active fraction names - Vector activeFractionIDs - = ((ReduxAliquotInterface) tempAliquot).// - getAliquotFractionIDs(); + Vector activeFractionIDs = new Vector<>(); + if (sortByDateAsc) { + activeFractionIDs + = ((ReduxAliquotInterface) tempAliquot).// + getAliquotFractionIDsSortedByDateAsc(); + } else { + activeFractionIDs + = ((ReduxAliquotInterface) tempAliquot).// + getAliquotFractionIDs(); + } // now load the sample date interpretations for (int index = 0; index < tempAliquot.getSampleDateModels().size(); index++) { @@ -155,9 +156,6 @@ public void buildTree() { tempAliquot.getSampleDateModels().get(index), sampleDateModelNode); } - -// } -// } } } @@ -265,10 +263,8 @@ private void populateSampleDateModel( public void valueChanged(TreeSelectionEvent e) { //Returns the last path element of the selection. //This method is useful only when the selection model allows a single selection. -// if (!suppressSelectionEvent) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent(); - // april 2016 - TreePath lastSelected = getSelectionPath();//e.getOldLeadSelectionPath();// + // april 2016 if (node == null) //Nothing is selected. { @@ -277,10 +273,7 @@ public void valueChanged(TreeSelectionEvent e) { setLastNodeSelected(node); - //System.out.println(e.getSource()); Object nodeInfo = node.getUserObject(); - //sampleTreeChange.sampleTreeChangeAnalysisMode(node); - // see below setSelectionRow(-1); if (nodeInfo instanceof SampleInterface) { // System.out.println(((SampleInterface) nodeInfo).getSampleName()); @@ -298,12 +291,6 @@ public void valueChanged(TreeSelectionEvent e) { } getSampleTreeChange().sampleTreeChangeAnalysisMode(node); - -// // april 2016 -// suppressSelectionEvent = true; -// setSelectionPath((nodeInfo instanceof CheckBoxNode) ? lastSelected.getParentPath() : e.getNewLeadSelectionPath()); -// suppressSelectionEvent = false; -// } } /** @@ -392,13 +379,16 @@ public void performLastUserSelectionOfSampleDate() { */ @Override public void mousePressed(MouseEvent e) { - int selRow = getRowForLocation(e.getX(), e.getY()); + selRowX = e.getX(); + selRowY = e.getY(); + selRow = getRowForLocation(e.getX(), e.getY()); TreePath selPath = getPathForLocation(e.getX(), e.getY()); if (selRow != -1) { final DefaultMutableTreeNode node = (DefaultMutableTreeNode) selPath.getLastPathComponent(); final Object nodeInfo = node.getUserObject(); if (!e.isPopupTrigger() && (e.getButton() == MouseEvent.BUTTON1)) { + } else if ((e.isPopupTrigger()) || (e.getButton() == MouseEvent.BUTTON3)) { setSelectionPath(selPath); if (nodeInfo instanceof AliquotInterface) { @@ -415,8 +405,16 @@ public void mousePressed(MouseEvent e) { myEditor.setVisible(true); // get a master vector of active fraction names - Vector activeFractionIDs = ((ReduxAliquotInterface) nodeInfo).// - getAliquotFractionIDs(); + Vector activeFractionIDs = new Vector<>(); + if (sortByDateAsc) { + activeFractionIDs + = ((ReduxAliquotInterface) nodeInfo).// + getAliquotFractionIDsSortedByDateAsc(); + } else { + activeFractionIDs + = ((ReduxAliquotInterface) nodeInfo).// + getAliquotFractionIDs(); + } if (((SampleDateInterpretationChooserDialog) myEditor).getSelectedModels().size() > 0) { DefaultMutableTreeNode sampleDateModelNode = null; @@ -431,9 +429,10 @@ public void mousePressed(MouseEvent e) { zeroFractionDates.add(activeFractionID); } } - zeroFractionDates.stream().forEach((zeroFractionDate) -> { - activeFractionIDs.remove(zeroFractionDate); - }); + + for (int i = 0; i < zeroFractionDates.size(); i++) { + activeFractionIDs.remove(zeroFractionDates.get(i)); + } // use next two lines to pre-select all fractions ((SampleDateModel) selectedSAM).setIncludedFractionIDsVector(activeFractionIDs); @@ -618,10 +617,10 @@ public void actionPerformed(ActionEvent arg0) { @Override public void actionPerformed(ActionEvent arg0) { DefaultMutableTreeNode sampleDateNode - = (DefaultMutableTreeNode) ((DefaultMutableTreeNode) node).getParent(); + = (DefaultMutableTreeNode) node.getParent(); Object SampleDateNodeInfo = sampleDateNode.getUserObject(); ((SampleDateModel) SampleDateNodeInfo).// - setIncludedFractionIDsVector(new Vector()); + setIncludedFractionIDsVector(new Vector<>()); SampleInterface.updateAndSaveSampleDateModelsByAliquot(sample); @@ -648,18 +647,22 @@ public void actionPerformed(ActionEvent arg0) { @Override public void actionPerformed(ActionEvent arg0) { DefaultMutableTreeNode sampleDateNode - = // - (DefaultMutableTreeNode) node.getParent(); + = (DefaultMutableTreeNode) node.getParent(); DefaultMutableTreeNode aliquotNode - = // - (DefaultMutableTreeNode) sampleDateNode.getParent(); + = (DefaultMutableTreeNode) sampleDateNode.getParent(); Object SampleDateNodeInfo = sampleDateNode.getUserObject(); Object AliquotNodeInfo = aliquotNode.getUserObject(); - ((SampleDateModel) SampleDateNodeInfo).// - setIncludedFractionIDsVector(// - ((ReduxAliquotInterface) AliquotNodeInfo).getAliquotFractionIDs()); + if (sortByDateAsc) { + ((SampleDateModel) SampleDateNodeInfo).// + setIncludedFractionIDsVector(// + ((ReduxAliquotInterface) AliquotNodeInfo).getAliquotFractionIDsSortedByDateAsc()); + } else { + ((SampleDateModel) SampleDateNodeInfo).// + setIncludedFractionIDsVector(// + ((ReduxAliquotInterface) AliquotNodeInfo).getAliquotFractionIDs()); + } SampleInterface.updateAndSaveSampleDateModelsByAliquot(sample); @@ -778,4 +781,53 @@ public Object getLastNodeSelected() { public void setLastNodeSelected(Object lastNodeSelected) { this.lastNodeSelected = lastNodeSelected; } + + /** + * @param sortByDateAsc the sortByDateAsc to set + */ + public void toggleSortByDateAsc() { + this.sortByDateAsc = !this.sortByDateAsc; + } + + /** + * @return the selRow + */ + public int getSelRow() { + return selRow; + } + + /** + * @param selRow the selRow to set + */ + public void setSelRow(int selRow) { + this.selRow = selRow; + } + + /** + * @return the selRowX + */ + public int getSelRowX() { + return selRowX; + } + + /** + * @param selRowX the selRowX to set + */ + public void setSelRowX(int selRowX) { + this.selRowX = selRowX; + } + + /** + * @return the selRowY + */ + public int getSelRowY() { + return selRowY; + } + + /** + * @param selRowY the selRowY to set + */ + public void setSelRowY(int selRowY) { + this.selRowY = selRowY; + } } diff --git a/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeCompilationMode.java b/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeCompilationMode.java index 17b58cef..e7db6468 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeCompilationMode.java +++ b/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeCompilationMode.java @@ -57,6 +57,10 @@ public class SampleTreeCompilationMode extends JTree implements SampleTreeI { private SampleInterface sample; private SampleTreeChangeI sampleTreeChange; private Object lastNodeSelected; + private static boolean sortByDateAsc = false; + private int selRow; + private int selRowX; + private int selRowY; /** * Creates a new instance of SampleTreeCompilationMode @@ -342,7 +346,9 @@ public void performLastUserSelection() { */ @Override public void mousePressed(MouseEvent e) { - int selRow = getRowForLocation(e.getX(), e.getY()); + selRowX = e.getX(); + selRowY = e.getY(); + selRow = getRowForLocation(e.getX(), e.getY()); TreePath selPath = getPathForLocation(e.getX(), e.getY()); if (selRow != -1) { @@ -717,4 +723,43 @@ public void setLastNodeSelected(Object lastNodeSelected) { public void performLastUserSelectionOfSampleDate() { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public void toggleSortByDateAsc() { + this.sortByDateAsc = !this.sortByDateAsc; + } + + /** + * @return the selRow + */ + public int getSelRow() { + return selRow; + } + + /** + * @param selRow the selRow to set + */ + public void setSelRow(int selRow) { + this.selRow = selRow; + } + + @Override + public int getSelRowX() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void setSelRowX(int selRowX) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public int getSelRowY() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void setSelRowY(int selRowY) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } } diff --git a/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeI.java b/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeI.java index 828e0291..c5fcccf9 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeI.java +++ b/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeI.java @@ -115,6 +115,40 @@ public interface SampleTreeI extends MouseListener, TreeSelectionListener { public String collectExpansionHistory(); public void expandToHistory(String expansionHistory); - + public void expandAllNodes(); + + public void toggleSortByDateAsc(); + + /** + * @return the selRow + */ + public int getSelRow(); + + /** + * @param selRow the selRow to set + */ + public void setSelRow(int selRow); + + /** + * @return the selRowX + */ + public int getSelRowX(); + + /** + * @param selRowX the selRowX to set + */ + public void setSelRowX(int selRowX); + + /** + * @return the selRowY + */ + public int getSelRowY(); + + /** + * @param selRowY the selRowY to set + */ + public void setSelRowY(int selRowY); + + } diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotEditorDialog.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotEditorDialog.java index 085a8757..53af51ca 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotEditorDialog.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotEditorDialog.java @@ -101,7 +101,6 @@ import org.earthtime.dataDictionaries.GeochronValidationResults; import org.earthtime.dataDictionaries.MineralTypes; import org.earthtime.dataDictionaries.RadDates; -import org.earthtime.dataDictionaries.SampleRegistries; import org.earthtime.dataDictionaries.SampleTypesEnum; import org.earthtime.dialogs.DialogEditor; import org.earthtime.exceptions.ETException; @@ -120,9 +119,6 @@ import org.earthtime.xmlUtilities.SimpleTransform; import org.jdesktop.layout.GroupLayout.ParallelGroup; import org.jdesktop.layout.GroupLayout.SequentialGroup; -import org.w3c.dom.DOMException; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; /** * @@ -2092,7 +2088,7 @@ protected void initAliquot() { addedFractions = new Vector<>(); // in compilation, leave everything blank - if (((UPbReduxAliquot) myAliquot).isCompiled()) { + if (((ReduxAliquotInterface) myAliquot).isCompiled()) { return; } @@ -2381,8 +2377,8 @@ public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) { for (int f = 0; f < getMyAliquot().getAliquotFractions().size(); f++) { - if (((JTextField) fractionTracerMassText.get(f)).isEnabled()) { - ((JTextField) fractionTracerMassText.get(f)).setText(masterTracerMass.getText()); + if (fractionTracerMassText.get(f).isEnabled()) { + ((JTextComponent) fractionTracerMassText.get(f)).setText(masterTracerMass.getText()); } } @@ -2404,8 +2400,8 @@ public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) { for (int f = 0; f < getMyAliquot().getAliquotFractions().size(); f++) { - if (((JTextField) fractionMassText.get(f)).isEnabled()) { - ((JTextField) fractionMassText.get(f)).setText(masterFractionMass.getText()); + if (fractionMassText.get(f).isEnabled()) { + ((JTextComponent) fractionMassText.get(f)).setText(masterFractionMass.getText()); } } @@ -3771,6 +3767,50 @@ protected void showArchiveNote(AliquotInterface aliquot, boolean validUser) { protected void showSavedDataI() { // general info + validateIGSNs(); + + aliquotName_text.setText(getMyAliquot().getAliquotName()); + analystName_text.setText(getMyAliquot().getAnalystName()); + + instrumentalMethod_jcombo.removeAllItems(); + for (int i = 0; i + < DataDictionary.AliquotInstrumentalMethod.length; i++) { + instrumentalMethod_jcombo.addItem(DataDictionary.AliquotInstrumentalMethod[i]); + } + + instrumentalMethod_jcombo.setSelectedItem(getMyAliquot(). + getAliquotInstrumentalMethod().toString()); + + instMethodRef_text.setText(getMyAliquot().getAliquotInstrumentalMethodReference()); + + reference_text.setText(getMyAliquot().getAliquotReference()); + + comment_textArea.setText(getMyAliquot().getAliquotComment()); + + calibrationUnct206_238_text.setText(// + getMyAliquot().getCalibrationUnct206_238()// + .setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, RoundingMode.HALF_UP).toPlainString()); + + calibrationUnct208_232_text.setText(getMyAliquot().getCalibrationUnct208_232()// + .setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, RoundingMode.HALF_UP).toPlainString()); + + calibrationUnct207_206_text.setText(getMyAliquot().getCalibrationUnct207_206()// + .setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, RoundingMode.HALF_UP).toPlainString()); + + keyWordsCSV_text.setText( // + getMyAliquot().getKeyWordsCSV()); + + for (JComponent cb : mineralStandardsCheckBoxes) { + if (getMyAliquot().getAMineralStandardModelByName(((AbstractButton) cb).getText()) != null) { + ((AbstractButton) cb).setSelected(true); + } else { + ((AbstractButton) cb).setSelected(false); + } + } + + } + + protected void validateIGSNs() { // April 2011 now using xxx.sampleID for sampleIGSN and need to split off aliquotIGSN_text.setText(getMyAliquot().getAlliquotIGSNnoRegistry()); @@ -3815,46 +3855,6 @@ protected void showSavedDataI() { "Aliquot IGSN " + getMyAliquot().getAliquotIGSN() + " is NOT REGISTERED as child of Sample IGSN " + sample.getSampleIGSNnoRegistry()); geochronArchivePanel_panel.setVisible(false); } - - aliquotName_text.setText(getMyAliquot().getAliquotName()); - analystName_text.setText(getMyAliquot().getAnalystName()); - - instrumentalMethod_jcombo.removeAllItems(); - for (int i = 0; i - < DataDictionary.AliquotInstrumentalMethod.length; i++) { - instrumentalMethod_jcombo.addItem(DataDictionary.AliquotInstrumentalMethod[i]); - } - - instrumentalMethod_jcombo.setSelectedItem(getMyAliquot(). - getAliquotInstrumentalMethod().toString()); - - instMethodRef_text.setText(getMyAliquot().getAliquotInstrumentalMethodReference()); - - reference_text.setText(getMyAliquot().getAliquotReference()); - - comment_textArea.setText(getMyAliquot().getAliquotComment()); - - calibrationUnct206_238_text.setText(// - getMyAliquot().getCalibrationUnct206_238()// - .setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, RoundingMode.HALF_UP).toPlainString()); - - calibrationUnct208_232_text.setText(getMyAliquot().getCalibrationUnct208_232()// - .setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, RoundingMode.HALF_UP).toPlainString()); - - calibrationUnct207_206_text.setText(getMyAliquot().getCalibrationUnct207_206()// - .setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, RoundingMode.HALF_UP).toPlainString()); - - keyWordsCSV_text.setText( // - getMyAliquot().getKeyWordsCSV()); - - for (JComponent cb : mineralStandardsCheckBoxes) { - if (getMyAliquot().getAMineralStandardModelByName(((AbstractButton) cb).getText()) != null) { - ((AbstractButton) cb).setSelected(true); - } else { - ((AbstractButton) cb).setSelected(false); - } - } - } /** @@ -4275,7 +4275,7 @@ private void saveAliquot() { } // general info - getMyAliquot().setAliquotName(aliquotName_text.getText()); + myAliquot.setAliquotName(aliquotName_text.getText().trim()); this.setTitle("Aliquot # " + getMyAliquot().getAliquotNumber() + " <> " + getMyAliquot().getAliquotName()); getMyAliquot().setAnalystName(analystName_text.getText()); @@ -4381,8 +4381,10 @@ private void saveAliquot() { myAliquot.setLaboratoryName(ReduxLabData.getInstance().getLabName()); // sept 2016 - myAliquot.setAliquotIGSN(aliquotIGSN_text.getText()); - + myAliquot.setAliquotIGSN(aliquotIGSN_text.getText().trim()); + + validateIGSNs(); + SampleInterface.saveSampleAsSerializedReduxFile(sample); System.out.println("**************** PRE-PUBLISH CHECKLIST FOR ALIQUOT"); @@ -4964,126 +4966,125 @@ public ValidationFromRegistry(// } } - private ValidationFromRegistry queryRegistryWithSampleID(String SampleID) { - // april 2011 simple validation: is sampleID an ID in the specified registry - // reg.SampleID - return new ValidationFromRegistry( // - SampleID, // - SampleRegistries.isSampleIdentifierValidAtRegistry(SampleID)); - } - - private ValidationFromRegistry querySESAR(String SampleID) { - String connectionStringSESAR = "http://www.geosamples.org/display.php?igsn="; - org.w3c.dom.Document doc = URIHelper.RetrieveXMLfromServerAsDOMdocument(connectionStringSESAR + SampleID.trim()); - - ValidationFromRegistry retVal = new ValidationFromRegistry(SampleID, false); - String selectedSampleIGSN; - - if (doc != null) { - if (doc.hasChildNodes()) { - Node SESARsample = doc.getFirstChild(); - - ArrayList messageTop = new ArrayList(); - if (SESARsample.getNodeName().equalsIgnoreCase("sample")) { - NodeList sampleDetails = SESARsample.getChildNodes(); - for (int i = 0; i < sampleDetails.getLength(); i++) { - System.out.println(sampleDetails.item(i).getNodeName()); - } - - // check for child or parent type SampleID - NodeList temp = doc.getElementsByTagName("ParentIGSN"); - if (temp.getLength() > 0) { - doc = URIHelper.RetrieveXMLfromServerAsDOMdocument(connectionStringSESAR// - + temp.item(0).getTextContent()); - - selectedSampleIGSN = temp.item(0).getTextContent(); - - messageTop.add( - "SESAR reports that IGSN " + SampleID + " is a child of a sample.\n\n"); - messageTop.add( - "You must choose a Sample IGSN, and SESAR reports that for this child, \n"); - messageTop.add( - "the parent Sample has IGSN " // - + selectedSampleIGSN // - + ", identified as:\n\n"); - } else { - // we have a sample SampleID - selectedSampleIGSN = SampleID; - messageTop.add( - "SESAR reports that IGSN " + selectedSampleIGSN + " is a Sample identified as:\n\n"); - } - - // present the user with the sample SampleID and data and a confirm - try { - messageTop.add("IGSN = " + doc.getElementsByTagName("IGSN").item(0).getTextContent() + "\n"); - } catch (NullPointerException dOMException) { - } - try { - messageTop.add("SampleID = " + doc.getElementsByTagName("SampleID").item(0).getTextContent() + "\n"); - } catch (NullPointerException dOMException) { - } - try { - messageTop.add("SampleComment = " + doc.getElementsByTagName("SampleComment").item(0).getTextContent() + "\n"); - } catch (NullPointerException dOMException) { - } - try { - messageTop.add("GeoObjectType = " + doc.getElementsByTagName("GeoObjectType").item(0).getTextContent() + "\n"); - } catch (NullPointerException dOMException) { - } - try { - messageTop.add("Material = " + doc.getElementsByTagName("Material").item(0).getTextContent() + "\n"); - } catch (NullPointerException dOMException) { - } +// private ValidationFromRegistry queryRegistryWithSampleID(String SampleID) { +// // april 2011 simple validation: is sampleID an ID in the specified registry +// // reg.SampleID +// return new ValidationFromRegistry( // +// SampleID, // +// SampleRegistries.isSampleIdentifierValidAtRegistry(SampleID)); +// } +// +// private ValidationFromRegistry querySESAR(String SampleID) { +// String connectionStringSESAR = "http://www.geosamples.org/display.php?igsn="; +// org.w3c.dom.Document doc = URIHelper.RetrieveXMLfromServerAsDOMdocument(connectionStringSESAR + SampleID.trim()); +// +// ValidationFromRegistry retVal = new ValidationFromRegistry(SampleID, false); +// String selectedSampleIGSN; +// +// if (doc != null) { +// if (doc.hasChildNodes()) { +// Node SESARsample = doc.getFirstChild(); +// +// ArrayList messageTop = new ArrayList(); +// if (SESARsample.getNodeName().equalsIgnoreCase("sample")) { +// NodeList sampleDetails = SESARsample.getChildNodes(); +// for (int i = 0; i < sampleDetails.getLength(); i++) { +// System.out.println(sampleDetails.item(i).getNodeName()); +// } +// +// // check for child or parent type SampleID +// NodeList temp = doc.getElementsByTagName("ParentIGSN"); +// if (temp.getLength() > 0) { +// doc = URIHelper.RetrieveXMLfromServerAsDOMdocument(connectionStringSESAR// +// + temp.item(0).getTextContent()); +// +// selectedSampleIGSN = temp.item(0).getTextContent(); +// +// messageTop.add( +// "SESAR reports that IGSN " + SampleID + " is a child of a sample.\n\n"); +// messageTop.add( +// "You must choose a Sample IGSN, and SESAR reports that for this child, \n"); +// messageTop.add( +// "the parent Sample has IGSN " // +// + selectedSampleIGSN // +// + ", identified as:\n\n"); +// } else { +// // we have a sample SampleID +// selectedSampleIGSN = SampleID; +// messageTop.add( +// "SESAR reports that IGSN " + selectedSampleIGSN + " is a Sample identified as:\n\n"); +// } +// +// // present the user with the sample SampleID and data and a confirm // try { -// messageTop.add("PrimaryLocationName = " + doc.getElementsByTagName("PrimaryLocationName").item(0).getTextContent() + "\n"); +// messageTop.add("IGSN = " + doc.getElementsByTagName("IGSN").item(0).getTextContent() + "\n"); // } catch (NullPointerException dOMException) { // } // try { -// messageTop.add("MostRecentArchivalInstitution = " + doc.getElementsByTagName("MostRecentArchivalInstitution").item(0).getTextContent() + "\n"); +// messageTop.add("SampleID = " + doc.getElementsByTagName("SampleID").item(0).getTextContent() + "\n"); // } catch (NullPointerException dOMException) { // } - messageTop.add("\n Do you accept this Sample as the parent of this Aliquot?"); - - String[] message = new String[messageTop.size()]; - message = messageTop.toArray(message); - - int response = JOptionPane.showConfirmDialog(this, - message, - "U-Pb Redux Information", - JOptionPane.YES_NO_OPTION, - JOptionPane.INFORMATION_MESSAGE); - if (response == JOptionPane.NO_OPTION) { - retVal.selectedSampleID = SampleID; - retVal.valid = false; - } else { - retVal.selectedSampleID = selectedSampleIGSN; - retVal.valid = true; - } - - } else { - // assume error received - - String SESAR_message = "SESAR failed to process this request - please contact SESAR."; - - try { - SESAR_message = doc.getElementsByTagName("Error").item(0).getTextContent(); - } catch (DOMException dOMException) { - } - - JOptionPane.showMessageDialog(this, - new String[]{"SESAR responded: " + SESAR_message}); - - retVal.selectedSampleID = SampleID; - retVal.valid = false; - - } - - } - } - - return retVal; - } - +// try { +// messageTop.add("SampleComment = " + doc.getElementsByTagName("SampleComment").item(0).getTextContent() + "\n"); +// } catch (NullPointerException dOMException) { +// } +// try { +// messageTop.add("GeoObjectType = " + doc.getElementsByTagName("GeoObjectType").item(0).getTextContent() + "\n"); +// } catch (NullPointerException dOMException) { +// } +// try { +// messageTop.add("Material = " + doc.getElementsByTagName("Material").item(0).getTextContent() + "\n"); +// } catch (NullPointerException dOMException) { +// } +//// try { +//// messageTop.add("PrimaryLocationName = " + doc.getElementsByTagName("PrimaryLocationName").item(0).getTextContent() + "\n"); +//// } catch (NullPointerException dOMException) { +//// } +//// try { +//// messageTop.add("MostRecentArchivalInstitution = " + doc.getElementsByTagName("MostRecentArchivalInstitution").item(0).getTextContent() + "\n"); +//// } catch (NullPointerException dOMException) { +//// } +// messageTop.add("\n Do you accept this Sample as the parent of this Aliquot?"); +// +// String[] message = new String[messageTop.size()]; +// message = messageTop.toArray(message); +// +// int response = JOptionPane.showConfirmDialog(this, +// message, +// "U-Pb Redux Information", +// JOptionPane.YES_NO_OPTION, +// JOptionPane.INFORMATION_MESSAGE); +// if (response == JOptionPane.NO_OPTION) { +// retVal.selectedSampleID = SampleID; +// retVal.valid = false; +// } else { +// retVal.selectedSampleID = selectedSampleIGSN; +// retVal.valid = true; +// } +// +// } else { +// // assume error received +// +// String SESAR_message = "SESAR failed to process this request - please contact SESAR."; +// +// try { +// SESAR_message = doc.getElementsByTagName("Error").item(0).getTextContent(); +// } catch (DOMException dOMException) { +// } +// +// JOptionPane.showMessageDialog(this, +// new String[]{"SESAR responded: " + SESAR_message}); +// +// retVal.selectedSampleID = SampleID; +// retVal.valid = false; +// +// } +// +// } +// } +// +// return retVal; +// } // refactor this stuff to reduce coupling private GeochronValidationResults confirmAliquotArchivedInGeochron(AliquotInterface aliquot) { @@ -5091,8 +5092,7 @@ private GeochronValidationResults confirmAliquotArchivedInGeochron(AliquotInterf String password = ((ETReduxFrame) parent).getMyState().getReduxPreferences().getGeochronPassWord(); String connectionString - = // - "http://www.geochron.org/getxml.php?sampleigsn="// + = "http://www.geochron.org/getxml.php?sampleigsn="// + aliquot.getSampleIGSN() // + "&aliquotname=" // + aliquot.getAliquotName()// diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotEditorForLAICPMS.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotEditorForLAICPMS.java index 8298bf59..aac1bd6e 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotEditorForLAICPMS.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotEditorForLAICPMS.java @@ -40,7 +40,6 @@ import org.earthtime.UPb_Redux.aliquots.UPbReduxAliquot; import org.earthtime.UPb_Redux.exceptions.BadLabDataException; import org.earthtime.UPb_Redux.fractions.UPbReduxFractions.UPbFraction; -import org.earthtime.reduxLabData.ReduxLabData; import org.earthtime.UPb_Redux.renderers.EditFractionButton; import org.earthtime.UPb_Redux.valueModels.ValueModel; import org.earthtime.aliquots.AliquotInterface; @@ -49,6 +48,7 @@ import org.earthtime.exceptions.ETException; import org.earthtime.exceptions.ETWarningDialog; import org.earthtime.fractions.ETFractionInterface; +import org.earthtime.reduxLabData.ReduxLabData; import org.earthtime.samples.SampleInterface; import org.earthtime.xmlUtilities.XMLSerializationI; import org.jdesktop.layout.GroupLayout.ParallelGroup; @@ -662,7 +662,7 @@ protected void updateFractionRow(ETFractionInterface tempFrac, int row) { // Composition ((JTextComponent) fractionConcU_Text.get(row)).setText(tempFrac.getCompositionalMeasureByName("concU").getValue(). movePointRight(6).setScale(ReduxConstants.DEFAULT_CONSTANTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionConcU_Text.get(row)).setCaretPosition(0); ((JTextComponent) fractionRTh_Usample_Text.get(row)).setText(tempFrac.getCompositionalMeasureByName("rTh_Usample").getValue(). @@ -715,32 +715,32 @@ protected void updateFractionRow(ETFractionInterface tempFrac, int row) { // Isotopic Dates ((JTextComponent) fractionDate206_238r_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age206_238r).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_CONSTANTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate206_238r_Text.get(row)).setCaretPosition(0); ((JTextComponent) fractionDate206_238r2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age206_238r).getOneSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_CONSTANTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate206_238r2SigmaAbs_Text.get(row)).setCaretPosition(0); ((JTextComponent) fractionDate207_235r_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_235r).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_CONSTANTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_235r_Text.get(row)).setCaretPosition(0); ((JTextComponent) fractionDate207_235r2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_235r).getOneSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_CONSTANTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_235r2SigmaAbs_Text.get(row)).setCaretPosition(0); ((JTextComponent) fractionDate207_206r_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_206r).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_CONSTANTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_206r_Text.get(row)).setCaretPosition(0); ((JTextComponent) fractionDate207_206r2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_206r).getOneSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_CONSTANTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_206r2SigmaAbs_Text.get(row)).setCaretPosition(0); } @@ -890,7 +890,7 @@ public void actionPerformed(ActionEvent e) { private void saveAliquot() { // general info - getMyAliquot().setAliquotName(aliquotName_text.getText()); + myAliquot.setAliquotName(aliquotName_text.getText().trim()); this.setTitle("Aliquot # " + getMyAliquot().getAliquotNumber() + " <> " + getMyAliquot().getAliquotName()); getMyAliquot().setAnalystName(analystName_text.getText()); @@ -943,6 +943,12 @@ private void saveAliquot() { // removed april 2011 as part of registry upgrade // getMyAliquot().setSampleIGSN( aliquotIGSN_text.getText().trim() ); // sample.setSampleIGSN( aliquotIGSN_text.getText().trim() ); + + // sept 2016 + myAliquot.setAliquotIGSN(aliquotIGSN_text.getText().trim()); + + validateIGSNs(); + SampleInterface.saveSampleAsSerializedReduxFile(sample); System.out.println("**************** PRE-PUBLISH CHECKLIST FOR ALIQUOT"); diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotLegacyEditorForIDTIMS.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotLegacyEditorForIDTIMS.java index e8808165..84c42070 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotLegacyEditorForIDTIMS.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotLegacyEditorForIDTIMS.java @@ -37,7 +37,6 @@ import org.earthtime.UPb_Redux.ReduxConstants; import org.earthtime.UPb_Redux.exceptions.BadLabDataException; import org.earthtime.UPb_Redux.fractions.UPbReduxFractions.UPbFraction; -import org.earthtime.reduxLabData.ReduxLabData; import org.earthtime.UPb_Redux.renderers.EditFractionButton; import org.earthtime.UPb_Redux.valueModels.ValueModel; import org.earthtime.aliquots.AliquotInterface; @@ -46,6 +45,7 @@ import org.earthtime.exceptions.ETException; import org.earthtime.exceptions.ETWarningDialog; import org.earthtime.fractions.ETFractionInterface; +import org.earthtime.reduxLabData.ReduxLabData; import org.earthtime.samples.SampleInterface; import org.jdesktop.layout.GroupLayout.ParallelGroup; import org.jdesktop.layout.GroupLayout.SequentialGroup; @@ -841,12 +841,12 @@ private void updateFractionRow(ETFractionInterface tempFrac, int row) { ((JTextComponent) fractionConcU_Text.get(row)).setText( tempFrac.getCompositionalMeasureByName("concU").getValue(). movePointRight(6).setScale(1, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionConcPb_ib_Text.get(row)).setText( tempFrac.getCompositionalMeasureByName("concPb_ib").getValue(). movePointRight(6).setScale(3, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionRTh_Usample_Text.get(row)).setText(tempFrac.getCompositionalMeasureByName("rTh_Usample").getValue(). setScale(ReduxConstants.DEFAULT_DEFAULTS_SCALE, @@ -859,59 +859,59 @@ private void updateFractionRow(ETFractionInterface tempFrac, int row) { // Isotopic Dates ((JTextComponent) fractionDate206_238r_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age206_238r).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_DEFAULTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate206_238r2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age206_238r).getTwoSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_235r_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_235r).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_DEFAULTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_235r2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_235r).getTwoSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_206r_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_206r).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_DEFAULTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_206r2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_206r).getTwoSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate206_238r_Th_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age206_238r_Th).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_DEFAULTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate206_238r_Th2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age206_238r_Th).getTwoSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_235r_Pa_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_235r_Pa).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_DEFAULTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_235r_Pa2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_235r_Pa).getTwoSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_206r_Th_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_206r_Th).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_DEFAULTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_206r_Th2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_206r_Th).getTwoSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_206r_Pa_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_206r_Pa.getName()).getValue(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_DEFAULTS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); ((JTextComponent) fractionDate207_206r_Pa2SigmaAbs_Text.get(row)).setText(tempFrac.getRadiogenicIsotopeDateByName(RadDates.age207_206r_Pa.getName()).getTwoSigmaAbs(). movePointLeft(6).setScale(ReduxConstants.DEFAULT_PARAMETERS_SCALE, - RoundingMode.HALF_UP).toPlainString()); + RoundingMode.HALF_UP).toPlainString()); } @@ -1089,7 +1089,7 @@ public void actionPerformed(ActionEvent e) { private void saveAliquot() { // general info - getMyAliquot().setAliquotName(aliquotName_text.getText()); + myAliquot.setAliquotName(aliquotName_text.getText().trim()); this.setTitle("Aliquot # " + getMyAliquot().getAliquotNumber() + " <> " + getMyAliquot().getAliquotName()); getMyAliquot().setAnalystName(analystName_text.getText()); @@ -1131,6 +1131,11 @@ private void saveAliquot() { saveAliquotFraction(f); } + // sept 2016 + myAliquot.setAliquotIGSN(aliquotIGSN_text.getText().trim()); + + validateIGSNs(); + // save the sample SampleInterface.saveSampleAsSerializedReduxFile(sample); diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotLegacyEditorForLAICPMS.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotLegacyEditorForLAICPMS.java index 5e50c28f..1a733f5d 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotLegacyEditorForLAICPMS.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/aliquotManagers/AliquotLegacyEditorForLAICPMS.java @@ -36,10 +36,8 @@ import javax.swing.text.JTextComponent; import org.earthtime.ETReduxFrame; import org.earthtime.UPb_Redux.ReduxConstants; -import org.earthtime.UPb_Redux.aliquots.UPbReduxAliquot; import org.earthtime.UPb_Redux.exceptions.BadLabDataException; import org.earthtime.UPb_Redux.fractions.UPbReduxFractions.UPbFraction; -import org.earthtime.reduxLabData.ReduxLabData; import org.earthtime.UPb_Redux.renderers.EditFractionButton; import org.earthtime.UPb_Redux.valueModels.ValueModel; import org.earthtime.aliquots.AliquotInterface; @@ -48,6 +46,7 @@ import org.earthtime.exceptions.ETException; import org.earthtime.exceptions.ETWarningDialog; import org.earthtime.fractions.ETFractionInterface; +import org.earthtime.reduxLabData.ReduxLabData; import org.earthtime.samples.SampleInterface; import org.earthtime.xmlUtilities.XMLSerializationI; import org.jdesktop.layout.GroupLayout.ParallelGroup; @@ -894,7 +893,7 @@ private void saveAliquot() { this.setTitle("Aliquot # " + getMyAliquot().getAliquotNumber() + " <> " + getMyAliquot().getAliquotName()); getMyAliquot().setAnalystName(analystName_text.getText()); - ((UPbReduxAliquot) getMyAliquot()).getMyReduxLabData().setAnalystName(analystName_text.getText()); + getMyAliquot().getMyReduxLabData().setAnalystName(analystName_text.getText()); getMyAliquot().setAliquotInstrumentalMethod( instrumentalMethod_jcombo.getSelectedItem().toString()); getMyAliquot().setAliquotInstrumentalMethodReference(instMethodRef_text.getText()); @@ -943,6 +942,12 @@ private void saveAliquot() { // removed april 2011 as part of registry upgrade // getMyAliquot().setSampleIGSN( aliquotIGSN_text.getText().trim() ); // sample.setSampleIGSN( aliquotIGSN_text.getText().trim() ); + + // sept 2016 + myAliquot.setAliquotIGSN(aliquotIGSN_text.getText().trim()); + + validateIGSNs(); + SampleInterface.saveSampleAsSerializedReduxFile(sample); System.out.println("**************** PRE-PUBLISH CHECKLIST FOR ALIQUOT"); diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/graphManagers/WeightedMeanOptionsDialog.form b/src/main/java/org/earthtime/UPb_Redux/dialogs/graphManagers/WeightedMeanOptionsDialog.form index f554187e..a5a562ff 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/graphManagers/WeightedMeanOptionsDialog.form +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/graphManagers/WeightedMeanOptionsDialog.form @@ -35,7 +35,7 @@ - + @@ -74,8 +74,8 @@ - - + + @@ -97,6 +97,9 @@ + + + @@ -114,6 +117,9 @@ + + + diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/graphManagers/WeightedMeanOptionsDialog.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/graphManagers/WeightedMeanOptionsDialog.java index 506c7afd..466b3d99 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/graphManagers/WeightedMeanOptionsDialog.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/graphManagers/WeightedMeanOptionsDialog.java @@ -26,6 +26,7 @@ import javax.swing.JLabel; import org.earthtime.UPb_Redux.valueModels.SampleDateModel; import org.earthtime.aliquots.AliquotInterface; +import org.earthtime.beans.ET_JButton; import org.earthtime.dialogs.DialogEditor; import org.earthtime.samples.SampleInterface; import org.jdesktop.layout.GroupLayout.ParallelGroup; @@ -454,8 +455,8 @@ private String setAliquotFlag(String flags, int position, String value) { private void initComponents() { buttonsPanel = new javax.swing.JPanel(); - save_button = new javax.swing.JButton(); - close_button = new javax.swing.JButton(); + save_button = new ET_JButton(); + close_button = new ET_JButton(); jScrollPane1 = new javax.swing.JScrollPane(); wmAliquotArray_panel = new javax.swing.JPanel(); jLabel8 = new javax.swing.JLabel(); @@ -503,13 +504,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { buttonsPanelLayout.setVerticalGroup( buttonsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(buttonsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(save_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(close_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(save_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(close_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); wmAliquotArray_panel.setBackground(new java.awt.Color(244, 255, 244)); - jLabel8.setFont(new java.awt.Font("SansSerif", 1, 18)); + jLabel8.setFont(new java.awt.Font("Lucida Grande", 1, 18)); // NOI18N jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel8.setText("Weighted Mean Sample Date Interpretation"); @@ -543,7 +544,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() - .addContainerGap(363, Short.MAX_VALUE) + .addContainerGap(366, Short.MAX_VALUE) .add(buttonsPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/parameterManagers/AbstractProjectParametersManager.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/parameterManagers/AbstractProjectParametersManager.java index 080a7c96..cebeccdf 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/parameterManagers/AbstractProjectParametersManager.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/parameterManagers/AbstractProjectParametersManager.java @@ -204,7 +204,7 @@ public abstract class AbstractProjectParametersManager extends JLayeredPane { protected JRadioButton fullPropagationRB; protected ET_JButton monitorButton; - + protected ET_JButton repropagateButton; /** @@ -603,12 +603,17 @@ public void stateChanged(ChangeEvent e) { propagationSpeedGroup.add(fastPropagationRB); fastPropagationRB.setBounds(leftMargin, 450, 300, 25); fastPropagationRB.setSelected(!rawDataFileHandler.getAcquisitionModel().isUsingFullPropagation()); + fastPropagationRB.setOpaque(true); + fastPropagationRB.setBackground(this.getBackground()); this.add(fastPropagationRB); fullPropagationRB = new JRadioButton("Full uncertainty propagation"); propagationSpeedGroup.add(fullPropagationRB); fullPropagationRB.setBounds(leftMargin, 475, 300, 25); fullPropagationRB.setSelected(rawDataFileHandler.getAcquisitionModel().isUsingFullPropagation()); + fullPropagationRB.setOpaque(true); + fullPropagationRB.setBackground(this.getBackground()); + this.add(fullPropagationRB); initReferenceMaterialChooser(); @@ -643,11 +648,9 @@ protected void initReferenceMaterialChooser() { JButton viewStandardModelButton = new ET_JButton("View"); viewStandardModelButton.addActionListener((ActionEvent e) -> { AbstractRatiosDataModel selectedModel - = - ((AbstractRatiosDataModel) mineralStandardsComboBox.getSelectedItem()); + = ((AbstractRatiosDataModel) mineralStandardsComboBox.getSelectedItem()); AbstractRatiosDataView modelView - = - new ReferenceMaterialUPbRatiosDataViewNotEditable(selectedModel, null, false); + = new ReferenceMaterialUPbRatiosDataViewNotEditable(selectedModel, null, false); modelView.displayModelInFrame(); }); viewStandardModelButton.setFont(ReduxConstants.sansSerif_10_Bold); diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/parameterManagers/LAICPMSProjectParametersManager.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/parameterManagers/LAICPMSProjectParametersManager.java index 9ea2179c..1e63d241 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/parameterManagers/LAICPMSProjectParametersManager.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/parameterManagers/LAICPMSProjectParametersManager.java @@ -211,6 +211,8 @@ public class LAICPMSProjectParametersManager extends JLayeredPane { protected JTextField peakEndIndexTextBox; + protected AcquisitionTypesEnum acquisitionType; + /** * * @param project @@ -280,7 +282,7 @@ public void initView() { massSpecTypeLabel.setBounds(leftMargin, 45, parentDimension.width - 50, 25); this.add(massSpecTypeLabel); - AcquisitionTypesEnum acquisitionType = rawDataFileHandler.getAcquisitionType(); + acquisitionType = rawDataFileHandler.getAcquisitionType(); JLabel acquistionTypeLabel = new JLabel("Acquisition Type: " + acquisitionType.getName()); acquistionTypeLabel.setHorizontalAlignment(SwingConstants.LEFT); @@ -673,12 +675,16 @@ public void stateChanged(ChangeEvent e) { propagationSpeedGroup.add(fastPropagationRB); fastPropagationRB.setBounds(leftMargin, 450, 300, 25); fastPropagationRB.setSelected(!rawDataFileHandler.getAcquisitionModel().isUsingFullPropagation()); + fastPropagationRB.setOpaque(true); + fastPropagationRB.setBackground(this.getBackground()); this.add(fastPropagationRB); final JRadioButton fullPropagationRB = new JRadioButton("Full uncertainty propagation"); propagationSpeedGroup.add(fullPropagationRB); fullPropagationRB.setBounds(leftMargin, 475, 300, 25); fullPropagationRB.setSelected(rawDataFileHandler.getAcquisitionModel().isUsingFullPropagation()); + fullPropagationRB.setOpaque(true); + fullPropagationRB.setBackground(this.getBackground()); this.add(fullPropagationRB); // primary reference material chooser @@ -924,19 +930,20 @@ private void saveAndLoadData(boolean loadData) { } acquisitionModel.updateMassSpec(massSpecSetup); + // Aug 2016 + if (acquisitionType.equals(AcquisitionTypesEnum.SINGLE_COLLECTOR)) { + acquisitionModel.setBaselineStartIndex(Integer.parseInt(baselineStartIndexTextBox.getText())); + rawDataFileHandler.setBaselineStartIndex(Integer.parseInt(baselineStartIndexTextBox.getText())); - acquisitionModel.setBaselineStartIndex(Integer.parseInt(baselineStartIndexTextBox.getText())); - rawDataFileHandler.setBaselineStartIndex(Integer.parseInt(baselineStartIndexTextBox.getText())); - - acquisitionModel.setBaselineEndIndex(Integer.parseInt(baselineEndIndexTextBox.getText())); - rawDataFileHandler.setBaselineEndIndex(Integer.parseInt(baselineEndIndexTextBox.getText())); - - acquisitionModel.setPeakStartIndex(Integer.parseInt(peakStartIndexTextBox.getText())); - rawDataFileHandler.setPeakStartIndex(Integer.parseInt(peakStartIndexTextBox.getText())); + acquisitionModel.setBaselineEndIndex(Integer.parseInt(baselineEndIndexTextBox.getText())); + rawDataFileHandler.setBaselineEndIndex(Integer.parseInt(baselineEndIndexTextBox.getText())); - acquisitionModel.setPeakEndIndex(Integer.parseInt(peakEndIndexTextBox.getText())); - rawDataFileHandler.setPeakEndIndex(Integer.parseInt(peakEndIndexTextBox.getText())); + acquisitionModel.setPeakStartIndex(Integer.parseInt(peakStartIndexTextBox.getText())); + rawDataFileHandler.setPeakStartIndex(Integer.parseInt(peakStartIndexTextBox.getText())); + acquisitionModel.setPeakEndIndex(Integer.parseInt(peakEndIndexTextBox.getText())); + rawDataFileHandler.setPeakEndIndex(Integer.parseInt(peakEndIndexTextBox.getText())); + } readyToProcessData = loadData; } diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/analysisManagers/SampleAnalysisWorkflowManagerIDTIMS.form b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/analysisManagers/SampleAnalysisWorkflowManagerIDTIMS.form index 3ea291c2..8baeda77 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/analysisManagers/SampleAnalysisWorkflowManagerIDTIMS.form +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/analysisManagers/SampleAnalysisWorkflowManagerIDTIMS.form @@ -46,7 +46,7 @@ - + @@ -133,9 +133,12 @@ + + + - + @@ -168,9 +171,12 @@ + + + - + @@ -203,9 +209,12 @@ + + + - + @@ -238,9 +247,12 @@ + + + - + @@ -273,9 +285,12 @@ + + + - + @@ -308,9 +323,12 @@ + + + - + @@ -475,9 +493,12 @@ + + + - + @@ -488,9 +509,12 @@ + + + - + @@ -669,9 +693,12 @@ + + + - + @@ -685,9 +712,12 @@ + + + - + @@ -944,9 +974,12 @@ + + + - + @@ -1082,6 +1115,9 @@ + + + diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/analysisManagers/SampleAnalysisWorkflowManagerIDTIMS.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/analysisManagers/SampleAnalysisWorkflowManagerIDTIMS.java index 674314dc..ebedc2a8 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/analysisManagers/SampleAnalysisWorkflowManagerIDTIMS.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/analysisManagers/SampleAnalysisWorkflowManagerIDTIMS.java @@ -79,6 +79,7 @@ import org.earthtime.UPb_Redux.valueModels.ValueModel; import org.earthtime.aliquots.AliquotInterface; import org.earthtime.aliquots.ReduxAliquotInterface; +import org.earthtime.beans.ET_JButton; import org.earthtime.dataDictionaries.AnalysisMeasures; import org.earthtime.dataDictionaries.SampleRegistries; import org.earthtime.dialogs.DialogEditor; @@ -1605,7 +1606,6 @@ public void setSampleFolder(File sampleFolder) { } private void validateSampleID(String sampleID) { -// if ( ! mySample.isArchivedInRegistry() ) { boolean valid = SampleRegistries.isSampleIdentifierValidAtRegistry(// sampleID); validSampleID_label.setText((String) (valid ? "Sample ID is Valid at registry." : "Sample ID is NOT valid at registry.")); @@ -2466,12 +2466,12 @@ private void initComponents() { sampleType_panel = new javax.swing.JPanel(); sampleType_label = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); - saveSampleWithDataStructure_button = new javax.swing.JButton(); - setSampleMetaDataFolder_button = new javax.swing.JButton(); - saveAsSampleWithDataStructure_button = new javax.swing.JButton(); - saveAsSample_button = new javax.swing.JButton(); - revertToSaved_button = new javax.swing.JButton(); - closeAndSave_button = new javax.swing.JButton(); + saveSampleWithDataStructure_button = new ET_JButton(); + setSampleMetaDataFolder_button = new ET_JButton(); + saveAsSampleWithDataStructure_button = new ET_JButton(); + saveAsSample_button = new ET_JButton(); + revertToSaved_button = new ET_JButton(); + closeAndSave_button = new ET_JButton(); jLayeredPane1 = new javax.swing.JLayeredPane(); sampleIGSN_text = new javax.swing.JTextField(); sampleID_label = new javax.swing.JLabel(); @@ -2480,11 +2480,11 @@ private void initComponents() { physicalConstantsModel_label = new javax.swing.JLabel(); aliquotName_text = new javax.swing.JTextField(); jScrollPane2 = new javax.swing.JScrollPane(); - aliquotsList_jList = new javax.swing.JList(); + aliquotsList_jList = new javax.swing.JList<>(); aliquotName_label = new javax.swing.JLabel(); insertFractionCount_spinner = new javax.swing.JSpinner(); - insertFraction_button = new javax.swing.JButton(); - removeAliquot_button = new javax.swing.JButton(); + insertFraction_button = new ET_JButton(); + removeAliquot_button = new ET_JButton(); aliquotFractionsArea_label = new javax.swing.JLabel(); fastEdits_scrollPane = new javax.swing.JScrollPane(); fastEdits_panel = new javax.swing.JPanel(); @@ -2496,8 +2496,8 @@ private void initComponents() { sampleMetaData_label = new javax.swing.JLabel(); sampleMetaDataFolder_label = new javax.swing.JLabel(); aliquotsArea_label = new javax.swing.JLabel(); - addAliquot_button = new javax.swing.JButton(); - importFractionFiles_button = new javax.swing.JButton(); + addAliquot_button = new ET_JButton(); + importFractionFiles_button = new ET_JButton(); jTabbedPane1 = new javax.swing.JTabbedPane(); jScrollPane1 = new javax.swing.JScrollPane(); welcomeStatement_jTextArea = new javax.swing.JTextArea(); @@ -2513,16 +2513,16 @@ private void initComponents() { jTextArea3 = new javax.swing.JTextArea(); moveAliquotDown_button = new javax.swing.JButton(); moveAliquotUp_button = new javax.swing.JButton(); - editAliquot_button = new javax.swing.JButton(); + editAliquot_button = new ET_JButton(); fractionTableHeader = new javax.swing.JLabel(); chooseAnalysisPurpose_label = new javax.swing.JLabel(); - analysisPurposeChooser = new javax.swing.JComboBox(); - physicalConstantsModelChooser = new javax.swing.JComboBox(); + analysisPurposeChooser = new javax.swing.JComboBox<>(); + physicalConstantsModelChooser = new javax.swing.JComboBox<>(); sampleRegistry_label = new javax.swing.JLabel(); - sampleRegistryChooser = new javax.swing.JComboBox(); + sampleRegistryChooser = new javax.swing.JComboBox<>(); validSampleID_label = new javax.swing.JLabel(); allowTracerChange_checkbox = new javax.swing.JCheckBox(); - validateSampleID_button = new javax.swing.JButton(); + validateSampleID_button = new ET_JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setResizable(false); @@ -2577,7 +2577,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { saveSampleWithDataStructure_buttonActionPerformed(evt); } }); - jPanel2.add(saveSampleWithDataStructure_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 2, 207, 30)); + jPanel2.add(saveSampleWithDataStructure_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 2, 207, 25)); setSampleMetaDataFolder_button.setBackground(new java.awt.Color(255, 255, 255)); setSampleMetaDataFolder_button.setForeground(new java.awt.Color(255, 51, 0)); @@ -2601,7 +2601,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { setSampleMetaDataFolder_buttonActionPerformed(evt); } }); - jPanel2.add(setSampleMetaDataFolder_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(823, 2, 205, 30)); + jPanel2.add(setSampleMetaDataFolder_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(823, 2, 205, 25)); saveAsSampleWithDataStructure_button.setBackground(new java.awt.Color(255, 255, 255)); saveAsSampleWithDataStructure_button.setForeground(new java.awt.Color(255, 51, 0)); @@ -2625,7 +2625,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { saveAsSampleWithDataStructure_buttonActionPerformed(evt); } }); - jPanel2.add(saveAsSampleWithDataStructure_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(577, 2, 246, 30)); + jPanel2.add(saveAsSampleWithDataStructure_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(577, 2, 246, 25)); saveAsSample_button.setBackground(new java.awt.Color(255, 255, 255)); saveAsSample_button.setForeground(new java.awt.Color(255, 51, 0)); @@ -2649,7 +2649,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { saveAsSample_buttonActionPerformed(evt); } }); - jPanel2.add(saveAsSample_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(467, 2, -1, 30)); + jPanel2.add(saveAsSample_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(467, 2, -1, 25)); revertToSaved_button.setBackground(new java.awt.Color(255, 255, 255)); revertToSaved_button.setForeground(new java.awt.Color(255, 51, 0)); @@ -2673,7 +2673,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { revertToSaved_buttonActionPerformed(evt); } }); - jPanel2.add(revertToSaved_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 2, -1, 30)); + jPanel2.add(revertToSaved_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 2, -1, 25)); closeAndSave_button.setBackground(new java.awt.Color(255, 255, 255)); closeAndSave_button.setForeground(new java.awt.Color(255, 51, 0)); @@ -2697,7 +2697,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { closeAndSave_buttonActionPerformed(evt); } }); - jPanel2.add(closeAndSave_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 2, 150, 30)); + jPanel2.add(closeAndSave_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 2, 150, 25)); jLayeredPane1.setBackground(new java.awt.Color(245, 236, 206)); jLayeredPane1.setOpaque(true); @@ -2712,7 +2712,7 @@ public void focusLost(java.awt.event.FocusEvent evt) { } }); jLayeredPane1.add(sampleIGSN_text); - sampleIGSN_text.setBounds(270, 30, 100, 27); + sampleIGSN_text.setBounds(270, 30, 100, 25); sampleID_label.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N sampleID_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); @@ -2724,7 +2724,7 @@ public void focusLost(java.awt.event.FocusEvent evt) { sampleName_text.setHorizontalAlignment(javax.swing.JTextField.CENTER); sampleName_text.setText("Sample Name"); jLayeredPane1.add(sampleName_text); - sampleName_text.setBounds(130, 0, 190, 27); + sampleName_text.setBounds(130, 0, 190, 25); sampleName_label.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N sampleName_label.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); @@ -2742,7 +2742,7 @@ public void focusLost(java.awt.event.FocusEvent evt) { aliquotName_text.setHorizontalAlignment(javax.swing.JTextField.CENTER); aliquotName_text.setText("Aliquot Name"); jLayeredPane1.add(aliquotName_text); - aliquotName_text.setBounds(300, 100, 220, 27); + aliquotName_text.setBounds(300, 100, 220, 25); aliquotsList_jList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); jScrollPane2.setViewportView(aliquotsList_jList); @@ -2757,7 +2757,7 @@ public void focusLost(java.awt.event.FocusEvent evt) { insertFractionCount_spinner.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLayeredPane1.add(insertFractionCount_spinner); - insertFractionCount_spinner.setBounds(460, 160, 52, 26); + insertFractionCount_spinner.setBounds(460, 160, 52, 24); insertFraction_button.setForeground(new java.awt.Color(255, 51, 0)); insertFraction_button.setText("Insert Fractions:"); @@ -2767,7 +2767,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); jLayeredPane1.add(insertFraction_button); - insertFraction_button.setBounds(330, 160, 130, 29); + insertFraction_button.setBounds(330, 160, 130, 25); removeAliquot_button.setText("Remove Selected Aliquot"); removeAliquot_button.addActionListener(new java.awt.event.ActionListener() { @@ -2776,7 +2776,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); jLayeredPane1.add(removeAliquot_button); - removeAliquot_button.setBounds(300, 220, 220, 29); + removeAliquot_button.setBounds(300, 220, 220, 25); aliquotFractionsArea_label.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N aliquotFractionsArea_label.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); @@ -2858,7 +2858,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); jLayeredPane1.add(addAliquot_button); - addAliquot_button.setBounds(300, 130, 100, 29); + addAliquot_button.setBounds(300, 130, 100, 25); importFractionFiles_button.setForeground(new java.awt.Color(255, 51, 0)); importFractionFiles_button.setText("Import Fraction Files"); @@ -2868,7 +2868,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); jLayeredPane1.add(importFractionFiles_button); - importFractionFiles_button.setBounds(330, 190, 190, 29); + importFractionFiles_button.setBounds(330, 190, 190, 25); welcomeStatement_jTextArea.setBackground(new java.awt.Color(238, 255, 255)); welcomeStatement_jTextArea.setColumns(20); @@ -2976,7 +2976,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); jLayeredPane1.add(editAliquot_button); - editAliquot_button.setBounds(400, 130, 120, 29); + editAliquot_button.setBounds(400, 130, 120, 25); fractionTableHeader.setBackground(new java.awt.Color(238, 255, 255)); fractionTableHeader.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N @@ -3049,7 +3049,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .add(layout.createSequentialGroup() .add(sampleType_panel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jLayeredPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 674, Short.MAX_VALUE) + .add(jLayeredPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 679, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/heatMapManagers/HeatMapManager.form b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/heatMapManagers/HeatMapManager.form index 0ebaee11..f472856d 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/heatMapManagers/HeatMapManager.form +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/heatMapManagers/HeatMapManager.form @@ -95,6 +95,9 @@ + + + @@ -117,6 +120,9 @@ + + + @@ -139,6 +145,9 @@ + + + @@ -161,6 +170,9 @@ + + + @@ -183,6 +195,9 @@ + + + @@ -205,6 +220,9 @@ + + + @@ -227,6 +245,9 @@ + + + @@ -249,6 +270,9 @@ + + + diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/heatMapManagers/HeatMapManager.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/heatMapManagers/HeatMapManager.java index 06c9104c..337691b3 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/heatMapManagers/HeatMapManager.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/heatMapManagers/HeatMapManager.java @@ -39,13 +39,12 @@ import static org.earthtime.UPb_Redux.ReduxConstants.sansSerif_11_Plain; import static org.earthtime.UPb_Redux.ReduxConstants.sansSerif_12_Plain; import org.earthtime.UPb_Redux.dateInterpretation.DateInterpretationUpdateViewI; -import org.earthtime.dialogs.DialogEditor; -import org.earthtime.UPb_Redux.reports.ReportCategory; import org.earthtime.UPb_Redux.user.SampleDateInterpretationGUIOptions; import org.earthtime.UPb_Redux.utilities.BrowserControl; import org.earthtime.beans.ET_JButton; import org.earthtime.colorViews.HeatMapMapper; import org.earthtime.colorViews.HeatMapView; +import org.earthtime.dialogs.DialogEditor; import org.earthtime.reports.ReportCategoryInterface; import org.earthtime.reports.ReportColumnInterface; import org.earthtime.reports.ReportSettingsInterface; @@ -88,8 +87,8 @@ public HeatMapManager(java.awt.Frame parent, boolean modal, SampleInterface aSam this.reportSettings = sample.getReportSettingsModel(); - this.heatMapOptions =// - sample.getSampleDateInterpretationGUISettings().getHeatMapOptions(); + this.heatMapOptions + = sample.getSampleDateInterpretationGUISettings().getHeatMapOptions(); this.heatMapActive = Boolean.valueOf(getStringEntryFromHeatMapOptions("activateHeatMap", "false")); @@ -252,6 +251,8 @@ private void fieldChooserFactory(ReportCategoryInterface reportCategory, JLayere btn.setActionCommand(varName); btn.setBounds(10, layoutRow * 20, 300, 25); btn.setFont(sansSerif_11_Plain); + btn.setOpaque(true); + btn.setBackground(categoryPanel.getBackground()); btn.addItemListener(new ItemListener() { @Override @@ -278,6 +279,8 @@ public void itemStateChanged(ItemEvent e) { btn.setActionCommand(varNameUnct); btn.setBounds(325, layoutRow * 20, 300, 25); btn.setFont(sansSerif_11_Plain); + btn.setOpaque(true); + btn.setBackground(categoryPanel.getBackground()); btn.addItemListener(new ItemListener() { @Override @@ -322,7 +325,7 @@ private void determineFractionHeat() { NumberFormat formatter = new DecimalFormat("0.0000E0"); minLabel.setText(formatter.format(min)); maxLabel.setText(formatter.format(max)); - + variableLabel.setText(selectedReportColumn.getDisplayName()); if (selectedReportColumn.getRetrieveMethodName().contains("Date")) { @@ -419,6 +422,8 @@ private void initComponents() { variablesChart_tabbedPane.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N variablesChart_tabbedPane.setOpaque(true); + compositionPanel.setOpaque(true); + javax.swing.GroupLayout compositionPanelLayout = new javax.swing.GroupLayout(compositionPanel); compositionPanel.setLayout(compositionPanelLayout); compositionPanelLayout.setHorizontalGroup( @@ -432,6 +437,8 @@ private void initComponents() { variablesChart_tabbedPane.addTab("Compostion", compositionPanel); + ratiosPanel.setOpaque(true); + javax.swing.GroupLayout ratiosPanelLayout = new javax.swing.GroupLayout(ratiosPanel); ratiosPanel.setLayout(ratiosPanelLayout); ratiosPanelLayout.setHorizontalGroup( @@ -445,6 +452,8 @@ private void initComponents() { variablesChart_tabbedPane.addTab("Ratios", ratiosPanel); + rhosPanel.setOpaque(true); + javax.swing.GroupLayout rhosPanelLayout = new javax.swing.GroupLayout(rhosPanel); rhosPanel.setLayout(rhosPanelLayout); rhosPanelLayout.setHorizontalGroup( @@ -458,6 +467,8 @@ private void initComponents() { variablesChart_tabbedPane.addTab("rhos", rhosPanel); + ratiosPbcCorrPanel.setOpaque(true); + javax.swing.GroupLayout ratiosPbcCorrPanelLayout = new javax.swing.GroupLayout(ratiosPbcCorrPanel); ratiosPbcCorrPanel.setLayout(ratiosPbcCorrPanelLayout); ratiosPbcCorrPanelLayout.setHorizontalGroup( @@ -471,6 +482,8 @@ private void initComponents() { variablesChart_tabbedPane.addTab("Ratios PbcCorr", ratiosPbcCorrPanel); + datesPanel.setOpaque(true); + javax.swing.GroupLayout datesPanelLayout = new javax.swing.GroupLayout(datesPanel); datesPanel.setLayout(datesPanelLayout); datesPanelLayout.setHorizontalGroup( @@ -484,6 +497,8 @@ private void initComponents() { variablesChart_tabbedPane.addTab("Dates", datesPanel); + datesPbcCorrPanel.setOpaque(true); + javax.swing.GroupLayout datesPbcCorrPanelLayout = new javax.swing.GroupLayout(datesPbcCorrPanel); datesPbcCorrPanel.setLayout(datesPbcCorrPanelLayout); datesPbcCorrPanelLayout.setHorizontalGroup( @@ -497,6 +512,8 @@ private void initComponents() { variablesChart_tabbedPane.addTab("Dates PbcCorr", datesPbcCorrPanel); + traceElementsPanel.setOpaque(true); + javax.swing.GroupLayout traceElementsPanelLayout = new javax.swing.GroupLayout(traceElementsPanel); traceElementsPanel.setLayout(traceElementsPanelLayout); traceElementsPanelLayout.setHorizontalGroup( @@ -510,6 +527,8 @@ private void initComponents() { variablesChart_tabbedPane.addTab("Trace Elements", traceElementsPanel); + customPanel.setOpaque(true); + javax.swing.GroupLayout customPanelLayout = new javax.swing.GroupLayout(customPanel); customPanel.setLayout(customPanelLayout); customPanelLayout.setHorizontalGroup( diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/legacyManagers/AbstractSampleLegacyManagerDialog.form b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/legacyManagers/AbstractSampleLegacyManagerDialog.form index 4022289e..d6c1c88d 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/legacyManagers/AbstractSampleLegacyManagerDialog.form +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/legacyManagers/AbstractSampleLegacyManagerDialog.form @@ -259,13 +259,16 @@ + + + - + @@ -498,9 +501,12 @@ + + + - + @@ -530,8 +536,8 @@ - - + + @@ -553,6 +559,9 @@ + + + @@ -570,6 +579,9 @@ + + + diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/legacyManagers/AbstractSampleLegacyManagerDialog.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/legacyManagers/AbstractSampleLegacyManagerDialog.java index 2ecc9b4c..c1fc3f9b 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/legacyManagers/AbstractSampleLegacyManagerDialog.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/legacyManagers/AbstractSampleLegacyManagerDialog.java @@ -28,22 +28,23 @@ import java.util.ArrayList; import java.util.Vector; import org.earthtime.UPb_Redux.ReduxConstants.ANALYSIS_PURPOSE; -import org.earthtime.UPb_Redux.aliquots.UPbReduxAliquot; -import org.earthtime.dialogs.DialogEditor; import org.earthtime.UPb_Redux.exceptions.BadImportedCSVLegacyFileException; import org.earthtime.UPb_Redux.exceptions.BadLabDataException; import org.earthtime.UPb_Redux.fractions.FractionI; import org.earthtime.UPb_Redux.fractions.UPbReduxFractions.UPbFractionI; -import org.earthtime.reduxLabData.ReduxLabData; import org.earthtime.UPb_Redux.samples.UPbSampleInterface; import org.earthtime.UPb_Redux.samples.sampleImporters.AbstractSampleImporterFromLegacyCSVFile; import org.earthtime.aliquots.AliquotInterface; +import org.earthtime.aliquots.ReduxAliquotInterface; +import org.earthtime.beans.ET_JButton; import org.earthtime.dataDictionaries.MineralTypes; import org.earthtime.dataDictionaries.SampleRegistries; +import org.earthtime.dialogs.DialogEditor; import org.earthtime.exceptions.ETException; import org.earthtime.exceptions.ETWarningDialog; import org.earthtime.fractions.ETFractionInterface; import org.earthtime.ratioDataModels.AbstractRatiosDataModel; +import org.earthtime.reduxLabData.ReduxLabData; import org.earthtime.samples.SampleInterface; /** @@ -96,7 +97,8 @@ public AbstractSampleLegacyManagerDialog( this.converter = converter; // april 2011 - validateSampleID(); + // removed sept 2016 + // validateSampleID(); } /** @@ -124,17 +126,14 @@ public void setImportFractionFolderMRU(File importFractionFolderMRU) { private void validateSampleID() { - try { - saveSampleData(); + mySample.setSampleIGSN(((SampleRegistries) sampleRegistryChooser.getSelectedItem()).getCode() + "." + sampleIGSN_text.getText().trim()); + mySample.setSampleRegistry((SampleRegistries) sampleRegistryChooser.getSelectedItem()); - if (!mySample.isArchivedInRegistry()) { - boolean valid = SampleRegistries.isSampleIdentifierValidAtRegistry(// - mySample.getSampleIGSN()); - validSampleIGSN_label.setText((String) (valid ? "Sample IGSN is Valid at registry." : "Sample IGSN is NOT valid at registry.")); - mySample.setValidatedSampleIGSN(valid); - } - } catch (ETException ex) { - new ETWarningDialog(ex).setVisible(true); + if (!mySample.isArchivedInRegistry()) { + boolean valid = SampleRegistries.isSampleIdentifierValidAtRegistry(// + mySample.getSampleIGSN()); + validSampleIGSN_label.setText((String) (valid ? "Sample IGSN is Valid at registry." : "Sample IGSN is NOT valid at registry.")); + mySample.setValidatedSampleIGSN(valid); } } @@ -276,8 +275,8 @@ private void saveSampleData() if (getMySample().getFractions().isEmpty()) { AliquotInterface myAliquot = getMySample().addNewAliquot(aliquotName_text.getText().trim()); // May 2010 allows publication of legacy results - ((UPbReduxAliquot) myAliquot).setCompiled(false); - int myAliquotNumber = ((UPbReduxAliquot) myAliquot).getAliquotNumber(); + ((ReduxAliquotInterface) myAliquot).setCompiled(false); + int myAliquotNumber = myAliquot.getAliquotNumber(); // test for manual mode or bulk import from CSV file if (manualMode_radioBut.isSelected()) { @@ -317,11 +316,11 @@ private void saveSampleData() try { f.setPhysicalConstantsModel(getMySample().getPhysicalConstantsModel()); - ((FractionI)f).setMineralName(mySample.getMineralName()); + ((FractionI) f).setMineralName(mySample.getMineralName()); if (mySample.getMineralName().equalsIgnoreCase("zircon")) { - ((FractionI)f).setZircon(true); + ((FractionI) f).setZircon(true); } else { - ((FractionI)f).setZircon(false); + ((FractionI) f).setZircon(false); } f.setLegacy(true); @@ -422,25 +421,25 @@ private void initComponents() { fractionDestinationPanel_panel = new javax.swing.JPanel(); aliquotName_text = new javax.swing.JTextField(); aliquotName_label = new javax.swing.JLabel(); - physicalConstantsModelChooser = new javax.swing.JComboBox(); + physicalConstantsModelChooser = new javax.swing.JComboBox<>(); defaultHeader_label = new javax.swing.JLabel(); fractionSourcePanel_panel = new javax.swing.JPanel(); manualMode_radioBut = new javax.swing.JRadioButton(); bulkMode_radioBut = new javax.swing.JRadioButton(); - standardMineralNameChooser = new javax.swing.JComboBox(); + standardMineralNameChooser = new javax.swing.JComboBox<>(); chooseStandardMineral_label = new javax.swing.JLabel(); chooseAnalysisPurpose_label = new javax.swing.JLabel(); - analysisPurposeChooser = new javax.swing.JComboBox(); + analysisPurposeChooser = new javax.swing.JComboBox<>(); chooseTWrho_label = new javax.swing.JLabel(); TWZeroRho_radioBut = new javax.swing.JRadioButton(); TWCalculateRho_radioBut = new javax.swing.JRadioButton(); sampleIGSN_label1 = new javax.swing.JLabel(); - sampleRegistryChooser = new javax.swing.JComboBox(); + sampleRegistryChooser = new javax.swing.JComboBox<>(); validSampleIGSN_label = new javax.swing.JLabel(); - validateIGSN = new javax.swing.JButton(); + validateIGSN = new ET_JButton(); jPanel2 = new javax.swing.JPanel(); - close = new javax.swing.JButton(); - saveAndClose = new javax.swing.JButton(); + close = new ET_JButton(); + saveAndClose = new ET_JButton(); sampleType_panel = new javax.swing.JPanel(); sampleType_label = new javax.swing.JLabel(); @@ -530,7 +529,8 @@ public void focusLost(java.awt.event.FocusEvent evt) { jPanel1.add(fractionDestinationPanel_panel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 210, 450, -1)); physicalConstantsModelChooser.setBackground(new java.awt.Color(245, 236, 206)); - jPanel1.add(physicalConstantsModelChooser, new org.netbeans.lib.awtextra.AbsoluteConstraints(193, 115, 270, -1)); + physicalConstantsModelChooser.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N + jPanel1.add(physicalConstantsModelChooser, new org.netbeans.lib.awtextra.AbsoluteConstraints(183, 115, 290, -1)); defaultHeader_label.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N defaultHeader_label.setForeground(new java.awt.Color(204, 51, 0)); @@ -617,7 +617,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { validateIGSNActionPerformed(evt); } }); - jPanel1.add(validateIGSN, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 85, 230, 32)); + jPanel1.add(validateIGSN, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 85, 230, 25)); jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); @@ -655,8 +655,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(saveAndClose, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(close, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(saveAndClose, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(close, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); sampleType_panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationAny2AxesChooser.form b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationAny2AxesChooser.form index 43cd69b5..95b02f5c 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationAny2AxesChooser.form +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationAny2AxesChooser.form @@ -53,7 +53,7 @@ - + @@ -103,8 +103,8 @@ - - + + @@ -126,6 +126,9 @@ + + + @@ -143,6 +146,9 @@ + + + diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationAny2AxesChooser.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationAny2AxesChooser.java index 101e78d4..294c439c 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationAny2AxesChooser.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationAny2AxesChooser.java @@ -19,6 +19,7 @@ package org.earthtime.UPb_Redux.dialogs.sampleManagers.sampleDateInterpretationManagers; import java.util.Vector; +import org.earthtime.beans.ET_JButton; import org.earthtime.dialogs.DialogEditor; /** @@ -54,10 +55,10 @@ public SampleDateInterpretationAny2AxesChooser(// private void initComponents() { tracers_scrollPane = new javax.swing.JScrollPane(); - axes_list = new javax.swing.JList(); + axes_list = new javax.swing.JList<>(); buttonsPanel = new javax.swing.JPanel(); - save_button = new javax.swing.JButton(); - close_button = new javax.swing.JButton(); + save_button = new ET_JButton(); + close_button = new ET_JButton(); chooseTracer_label = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); @@ -112,8 +113,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { buttonsPanelLayout.setVerticalGroup( buttonsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(buttonsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(save_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(close_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(save_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(close_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); chooseTracer_label.setText("Testing list of available axes:"); @@ -138,7 +139,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(tracers_scrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE) .add(24, 24, 24) - .add(buttonsPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(buttonsPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationChooserDialog.form b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationChooserDialog.form index 10f8ed53..ac3d3c69 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationChooserDialog.form +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationChooserDialog.form @@ -95,9 +95,12 @@ + + + - + @@ -117,9 +120,12 @@ + + + - + diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationChooserDialog.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationChooserDialog.java index 86b15b17..b9bb479c 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationChooserDialog.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationChooserDialog.java @@ -19,9 +19,10 @@ package org.earthtime.UPb_Redux.dialogs.sampleManagers.sampleDateInterpretationManagers; import java.util.Vector; -import org.earthtime.dialogs.DialogEditor; import org.earthtime.UPb_Redux.valueModels.SampleDateModel; import org.earthtime.UPb_Redux.valueModels.ValueModel; +import org.earthtime.beans.ET_JButton; +import org.earthtime.dialogs.DialogEditor; /** * @@ -64,10 +65,10 @@ public SampleDateInterpretationChooserDialog(// private void initComponents() { tracers_scrollPane = new javax.swing.JScrollPane(); - modelTypes_list = new javax.swing.JList(); + modelTypes_list = new javax.swing.JList<>(); buttonsPanel = new javax.swing.JPanel(); - save_button = new javax.swing.JButton(); - close_button = new javax.swing.JButton(); + save_button = new ET_JButton(); + close_button = new ET_JButton(); chooseTracer_label = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); @@ -101,7 +102,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { save_buttonActionPerformed(evt); } }); - buttonsPanel.add(save_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(38, 2, 115, 28)); + buttonsPanel.add(save_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(38, 2, 115, 25)); close_button.setForeground(new java.awt.Color(255, 51, 0)); close_button.setText("Cancel"); @@ -112,7 +113,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { close_buttonActionPerformed(evt); } }); - buttonsPanel.add(close_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 2, 115, 28)); + buttonsPanel.add(close_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 2, 115, 25)); getContentPane().add(buttonsPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 343, 340, -1)); diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationsManager.form b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationsManager.form index 7c31635f..27b49b74 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationsManager.form +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationsManager.form @@ -57,6 +57,14 @@ + + + + + + + + @@ -135,6 +143,9 @@ + + + @@ -330,6 +341,9 @@ + + + @@ -347,6 +361,9 @@ + + + @@ -364,6 +381,9 @@ + + + @@ -456,7 +476,7 @@ - + @@ -479,7 +499,7 @@ - + @@ -501,6 +521,9 @@ + + + @@ -518,6 +541,9 @@ + + + @@ -535,6 +561,9 @@ + + + @@ -588,6 +617,9 @@ + + + @@ -606,7 +638,7 @@ - + @@ -628,6 +660,9 @@ + + + @@ -644,6 +679,9 @@ + + + @@ -824,6 +862,9 @@ + + + @@ -837,6 +878,9 @@ + + + @@ -858,6 +902,9 @@ + + + @@ -878,6 +925,9 @@ + + + @@ -899,6 +949,9 @@ + + + @@ -1268,6 +1321,9 @@ + + + @@ -1285,6 +1341,9 @@ + + + @@ -1302,6 +1361,9 @@ + + + @@ -1315,12 +1377,15 @@ - + + + + @@ -1334,12 +1399,15 @@ - + + + + @@ -1355,7 +1423,7 @@ - + @@ -1377,7 +1445,7 @@ - + @@ -1399,7 +1467,7 @@ - + @@ -1421,12 +1489,15 @@ - + + + + @@ -1479,7 +1550,7 @@ - + @@ -1643,6 +1714,9 @@ + + + @@ -1660,6 +1734,9 @@ + + + diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationsManager.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationsManager.java index 4462ed76..cb03804e 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationsManager.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sampleManagers/sampleDateInterpretationManagers/SampleDateInterpretationsManager.java @@ -199,8 +199,14 @@ public SampleDateInterpretationsManager( // public void refreshSampleDateInterpretations(boolean doReScale, boolean inLiveMode) { String expansionHistory = ""; + int selRow = 0; + int selRowX = 0; + int selRowY = 0; if (!doReScale) { expansionHistory = dateTreeByAliquot.collectExpansionHistory(); + selRow = dateTreeByAliquot.getSelRow(); + selRowX = dateTreeByAliquot.getSelRowX(); + selRowY = dateTreeByAliquot.getSelRowY(); } dateTreeByAliquot = new SampleTreeAnalysisMode(sample); dateTreeByAliquot.setSampleTreeChange(this); @@ -208,6 +214,10 @@ public void refreshSampleDateInterpretations(boolean doReScale, boolean inLiveMo dateTreeByAliquot_ScrollPane.setViewportView((Component) dateTreeByAliquot); if (!doReScale) { dateTreeByAliquot.expandToHistory(expansionHistory); + ((JTree)dateTreeByAliquot).setSelectionRow(selRow); + ((JTree)dateTreeByAliquot).scrollRowToVisible(selRow); +// dateTreeByAliquot.mousePressed(new MouseEvent((Component)dateTreeByAliquot, 0, System.currentTimeMillis(), MouseEvent.BUTTON1, selRowX, selRowY, 1, false)); +// ((PlottingDetailsDisplayInterface)concordiaGraphPanel).refreshPanel(true, false); } dateTreeBySample = new SampleTreeCompilationMode(sample); @@ -514,31 +524,31 @@ public void actionPerformed(ActionEvent arg0) { // zoom double rangeX = ((DateProbabilityDensityPanel) probabilityPanel).getRangeX_Display(); //System.out.println( "RANGE OUT = " + rangeX + " offset = " + ((DateProbabilityDensityPanel) probabilityPanel).getDisplayOffsetX()); - + double saveMinx = ((DateProbabilityDensityPanel) probabilityPanel).getMinX(); double proposedMinX = saveMinx - rangeX / 2.0; - + ((DateProbabilityDensityPanel) probabilityPanel).// setMinX(// Math.max(// proposedMinX, DateProbabilityDensityPanel.DEFAULT_DISPLAY_MINX)); - + // reset offset if hit the left wall double shiftMax = 0; if (proposedMinX <= DateProbabilityDensityPanel.DEFAULT_DISPLAY_MINX) { ((DateProbabilityDensityPanel) probabilityPanel).setDisplayOffsetX(0); shiftMax = DateProbabilityDensityPanel.DEFAULT_DISPLAY_MINX - proposedMinX; } - + ((DateProbabilityDensityPanel) probabilityPanel).// setMaxX(// Math.min(// (((DateProbabilityDensityPanel) probabilityPanel).getMaxX()// - + rangeX / 2.0 + shiftMax), DateProbabilityDensityPanel.DEFAULT_DISPLAY_MAXX)); - + + rangeX / 2.0 + shiftMax), DateProbabilityDensityPanel.DEFAULT_DISPLAY_MAXX)); + ((DateProbabilityDensityPanel) probabilityPanel).// setSelectedHistogramBinCount(0); - + probabilityPanel.repaint(); }); @@ -1021,6 +1031,7 @@ private void initComponents() { aliquotSpecificOptions_menu = new javax.swing.JMenu(); weightedMeansPlotOptions_menu = new javax.swing.JMenu(); weightedMeansChooser_menuItem = new javax.swing.JMenuItem(); + sortFractionsDateAsc_menuItemCheckBox = new javax.swing.JCheckBoxMenuItem(); weightedMeansLookAndFeel_menuItem = new javax.swing.JMenuItem(); choosePDFPeaks_menu = new javax.swing.JMenu(); heatMap_Menu = new javax.swing.JMenu(); @@ -1040,6 +1051,7 @@ public void windowClosing(java.awt.event.WindowEvent evt) { interpretations_SplitPane.setDividerLocation(250); + dateTrees_tabs.setForeground(new java.awt.Color(255, 51, 51)); dateTrees_tabs.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N dateTrees_tabs.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { @@ -1112,6 +1124,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(resetGraphDisplay_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 2, 35, 30)); + ellipseCenters_checkbox.setBackground(new java.awt.Color(255, 241, 230)); ellipseCenters_checkbox.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N ellipseCenters_checkbox.setSelected(true); ellipseCenters_checkbox.setText("Ellipse
Centers"); @@ -1122,6 +1135,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(ellipseCenters_checkbox, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 2, 70, 25)); + ellipseLabels_checkbox.setBackground(new java.awt.Color(255, 241, 230)); ellipseLabels_checkbox.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N ellipseLabels_checkbox.setSelected(true); ellipseLabels_checkbox.setText("Ellipse
Labels"); @@ -1132,6 +1146,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(ellipseLabels_checkbox, new org.netbeans.lib.awtextra.AbsoluteConstraints(760, 2, 70, 25)); + concordiaErrors_checkbox.setBackground(new java.awt.Color(255, 241, 230)); concordiaErrors_checkbox.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N concordiaErrors_checkbox.setSelected(true); concordiaErrors_checkbox.setText("Concordia
Unct Env"); @@ -1176,7 +1191,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(zoomBox_toggleButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(125, 2, 55, 30)); - concordiaFlavor_radioButton.setBackground(new java.awt.Color(204, 204, 255)); + concordiaFlavor_radioButton.setBackground(new java.awt.Color(255, 241, 230)); concordiaTeraW_buttonGroup.add(concordiaFlavor_radioButton); concordiaFlavor_radioButton.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N concordiaFlavor_radioButton.setText("C"); @@ -1188,7 +1203,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(concordiaFlavor_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 1, -1, 28)); - terraWasserburgFlavor_radioButton.setBackground(new java.awt.Color(204, 204, 255)); + terraWasserburgFlavor_radioButton.setBackground(new java.awt.Color(255, 241, 230)); concordiaTeraW_buttonGroup.add(terraWasserburgFlavor_radioButton); terraWasserburgFlavor_radioButton.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N terraWasserburgFlavor_radioButton.setText("TW"); @@ -1200,6 +1215,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(terraWasserburgFlavor_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(295, 1, -1, 28)); + thoriumCorrectionSelector_checkbox.setBackground(new java.awt.Color(255, 241, 230)); thoriumCorrectionSelector_checkbox.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N thoriumCorrectionSelector_checkbox.setText("Th"); thoriumCorrectionSelector_checkbox.setToolTipText("Correct for Thorium"); @@ -1210,6 +1226,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(thoriumCorrectionSelector_checkbox, new org.netbeans.lib.awtextra.AbsoluteConstraints(435, 2, -1, 25)); + protactiniumCorrectionSelector_checkbox.setBackground(new java.awt.Color(255, 241, 230)); protactiniumCorrectionSelector_checkbox.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N protactiniumCorrectionSelector_checkbox.setText("Pa"); protactiniumCorrectionSelector_checkbox.setToolTipText("Correct for Protactinium"); @@ -1220,6 +1237,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(protactiniumCorrectionSelector_checkbox, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 2, -1, 25)); + jLabel4.setBackground(new java.awt.Color(255, 241, 230)); jLabel4.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N jLabel4.setForeground(new java.awt.Color(255, 0, 51)); jLabel4.setText("Correct:"); @@ -1242,6 +1260,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(showTight_toggleButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 2, 30, 30)); + showExcludedFractions_checkbox.setBackground(new java.awt.Color(255, 241, 230)); showExcludedFractions_checkbox.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N showExcludedFractions_checkbox.setSelected(true); showExcludedFractions_checkbox.setText("Excluded
Fractions"); @@ -1252,7 +1271,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(showExcludedFractions_checkbox, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 2, 75, 25)); - thoriumConcordiaFlavor_radioButton.setBackground(new java.awt.Color(204, 204, 255)); + thoriumConcordiaFlavor_radioButton.setBackground(new java.awt.Color(255, 241, 230)); concordiaTeraW_buttonGroup.add(thoriumConcordiaFlavor_radioButton); thoriumConcordiaFlavor_radioButton.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N thoriumConcordiaFlavor_radioButton.setText("Th"); @@ -1264,6 +1283,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(thoriumConcordiaFlavor_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 1, -1, 28)); + showFilteredFractions_checkbox.setBackground(new java.awt.Color(255, 241, 230)); showFilteredFractions_checkbox.setFont(new java.awt.Font("SansSerif", 1, 10)); // NOI18N showFilteredFractions_checkbox.setText("Filtering ON
"); showFilteredFractions_checkbox.addActionListener(new java.awt.event.ActionListener() { @@ -1273,6 +1293,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); concordiaToolPanel.add(showFilteredFractions_checkbox, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 2, 80, 25)); + commonLeadCorrectionSelector_checkbox.setBackground(new java.awt.Color(255, 241, 230)); commonLeadCorrectionSelector_checkbox.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N commonLeadCorrectionSelector_checkbox.setText("Pbc"); commonLeadCorrectionSelector_checkbox.setToolTipText("Correct for Common Lead"); @@ -1340,10 +1361,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { pan_WeightedMean_toggleButton.setOpaque(true); weightedMeanToolPanel.add(pan_WeightedMean_toggleButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(113, 2, 28, 30)); + jLabel1.setBackground(new java.awt.Color(229, 250, 229)); jLabel1.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N jLabel1.setText("Order:"); weightedMeanToolPanel.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(369, 9, -1, -1)); + fractionOrderByName_radioButton.setBackground(new java.awt.Color(229, 250, 229)); weightedMeanFractionOrderButtonGroup.add(fractionOrderByName_radioButton); fractionOrderByName_radioButton.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N fractionOrderByName_radioButton.setSelected(true); @@ -1352,6 +1375,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { fractionOrderByName_radioButton.setName("name"); // NOI18N weightedMeanToolPanel.add(fractionOrderByName_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(412, 6, -1, -1)); + fractionOrderByWeight_radioButton.setBackground(new java.awt.Color(229, 250, 229)); weightedMeanFractionOrderButtonGroup.add(fractionOrderByWeight_radioButton); fractionOrderByWeight_radioButton.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N fractionOrderByWeight_radioButton.setText("weight"); @@ -1359,6 +1383,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { fractionOrderByWeight_radioButton.setName("weight"); // NOI18N weightedMeanToolPanel.add(fractionOrderByWeight_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(476, 6, -1, -1)); + fractionOrderByRandom_radioButton.setBackground(new java.awt.Color(229, 250, 229)); weightedMeanFractionOrderButtonGroup.add(fractionOrderByRandom_radioButton); fractionOrderByRandom_radioButton.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N fractionOrderByRandom_radioButton.setText("RND"); @@ -1367,6 +1392,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { fractionOrderByRandom_radioButton.setName("random"); // NOI18N weightedMeanToolPanel.add(fractionOrderByRandom_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(555, 6, -1, -1)); + fractionOrderByDate_radioButton.setBackground(new java.awt.Color(229, 250, 229)); weightedMeanFractionOrderButtonGroup.add(fractionOrderByDate_radioButton); fractionOrderByDate_radioButton.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N fractionOrderByDate_radioButton.setText("date"); @@ -1560,18 +1586,21 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); probabilityToolPanel.add(resetGraphProbability_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 40, 40, 25)); + ageR207_206r_radioB.setBackground(new java.awt.Color(241, 230, 255)); probabilityDateButtonGroup.add(ageR207_206r_radioB); ageR207_206r_radioB.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N ageR207_206r_radioB.setText("207/206"); ageR207_206r_radioB.setName("age207_206r"); // NOI18N probabilityToolPanel.add(ageR207_206r_radioB, new org.netbeans.lib.awtextra.AbsoluteConstraints(175, 20, -1, -1)); + ageR206_238r_radioB.setBackground(new java.awt.Color(241, 230, 255)); probabilityDateButtonGroup.add(ageR206_238r_radioB); ageR206_238r_radioB.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N ageR206_238r_radioB.setText("206/238"); ageR206_238r_radioB.setName("age206_238r"); // NOI18N probabilityToolPanel.add(ageR206_238r_radioB, new org.netbeans.lib.awtextra.AbsoluteConstraints(175, 0, -1, -1)); + positivePctDiscordance_slider.setBackground(new java.awt.Color(241, 230, 255)); positivePctDiscordance_slider.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N positivePctDiscordance_slider.setMajorTickSpacing(10); positivePctDiscordance_slider.setMinorTickSpacing(2); @@ -1580,8 +1609,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { positivePctDiscordance_slider.setSnapToTicks(true); positivePctDiscordance_slider.setAutoscrolls(true); positivePctDiscordance_slider.setName("positivePerCentDiscordanceSliderValue"); // NOI18N - probabilityToolPanel.add(positivePctDiscordance_slider, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 0, 200, 38)); + probabilityToolPanel.add(positivePctDiscordance_slider, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 5, 200, 38)); + percentUncertainty_slider.setBackground(new java.awt.Color(241, 230, 255)); percentUncertainty_slider.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N percentUncertainty_slider.setMajorTickSpacing(10); percentUncertainty_slider.setMinorTickSpacing(2); @@ -1590,8 +1620,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { percentUncertainty_slider.setSnapToTicks(true); percentUncertainty_slider.setAutoscrolls(true); percentUncertainty_slider.setName("uncertaintyPerCentSliderValue"); // NOI18N - probabilityToolPanel.add(percentUncertainty_slider, new org.netbeans.lib.awtextra.AbsoluteConstraints(750, 0, 168, 38)); + probabilityToolPanel.add(percentUncertainty_slider, new org.netbeans.lib.awtextra.AbsoluteConstraints(750, 5, 168, 38)); + negativePctDiscordance_slider.setBackground(new java.awt.Color(241, 230, 255)); negativePctDiscordance_slider.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N negativePctDiscordance_slider.setMajorTickSpacing(10); negativePctDiscordance_slider.setMaximum(0); @@ -1602,7 +1633,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { negativePctDiscordance_slider.setSnapToTicks(true); negativePctDiscordance_slider.setValue(-50); negativePctDiscordance_slider.setName("negativePerCentDiscordanceSliderValue"); // NOI18N - probabilityToolPanel.add(negativePctDiscordance_slider, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 0, 200, 38)); + probabilityToolPanel.add(negativePctDiscordance_slider, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 5, 200, 38)); positivePctDiscordance_text.setBackground(new java.awt.Color(241, 230, 255)); positivePctDiscordance_text.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N @@ -1611,7 +1642,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { positivePctDiscordance_text.setAlignmentX(0.0F); positivePctDiscordance_text.setAlignmentY(0.0F); positivePctDiscordance_text.setBorder(null); - probabilityToolPanel.add(positivePctDiscordance_text, new org.netbeans.lib.awtextra.AbsoluteConstraints(568, 40, 160, 15)); + probabilityToolPanel.add(positivePctDiscordance_text, new org.netbeans.lib.awtextra.AbsoluteConstraints(568, 45, 160, 15)); negativePctDiscordance_text.setBackground(new java.awt.Color(241, 230, 255)); negativePctDiscordance_text.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N @@ -1620,7 +1651,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { negativePctDiscordance_text.setAlignmentX(0.0F); negativePctDiscordance_text.setAlignmentY(0.0F); negativePctDiscordance_text.setBorder(null); - probabilityToolPanel.add(negativePctDiscordance_text, new org.netbeans.lib.awtextra.AbsoluteConstraints(347, 40, 160, 15)); + probabilityToolPanel.add(negativePctDiscordance_text, new org.netbeans.lib.awtextra.AbsoluteConstraints(347, 45, 160, 15)); pctUncertainty_text.setBackground(new java.awt.Color(241, 230, 255)); pctUncertainty_text.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N @@ -1629,8 +1660,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { pctUncertainty_text.setAlignmentX(0.0F); pctUncertainty_text.setAlignmentY(0.0F); pctUncertainty_text.setBorder(null); - probabilityToolPanel.add(pctUncertainty_text, new org.netbeans.lib.awtextra.AbsoluteConstraints(767, 40, 140, 15)); + probabilityToolPanel.add(pctUncertainty_text, new org.netbeans.lib.awtextra.AbsoluteConstraints(767, 45, 140, 15)); + ageBest_radio.setBackground(new java.awt.Color(241, 230, 255)); probabilityDateButtonGroup.add(ageBest_radio); ageBest_radio.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N ageBest_radio.setText("best"); @@ -1657,7 +1689,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { linkedUnlinkedDiscordanceActionPerformed(evt); } }); - probabilityToolPanel.add(linkedUnlinkedDiscordance, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 0, 20, 20)); + probabilityToolPanel.add(linkedUnlinkedDiscordance, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 5, 20, 20)); showHistogram_button.setBackground(new java.awt.Color(241, 230, 255)); showHistogram_button.setFont(new java.awt.Font("Braggadocio", 1, 24)); // NOI18N @@ -1728,6 +1760,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jLabel2.setText(" ?Hist #Bins ?WidthMa ?Lock"); probabilityToolPanel.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 170, 15)); + commonLeadCorrectionSelectorPDF_checkbox.setBackground(new java.awt.Color(241, 230, 255)); commonLeadCorrectionSelectorPDF_checkbox.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N commonLeadCorrectionSelectorPDF_checkbox.setText("PbcCorr"); commonLeadCorrectionSelectorPDF_checkbox.setToolTipText("Correct for Common Lead"); @@ -1738,6 +1771,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); probabilityToolPanel.add(commonLeadCorrectionSelectorPDF_checkbox, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 2, -1, 25)); + DatePbCorrSchemeA_radio.setBackground(new java.awt.Color(241, 230, 255)); probabilityDateButtonGroup.add(DatePbCorrSchemeA_radio); DatePbCorrSchemeA_radio.setFont(new java.awt.Font("Arial", 1, 10)); // NOI18N DatePbCorrSchemeA_radio.setText("UPb Date PbcCorr"); @@ -1857,6 +1891,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); weightedMeansPlotOptions_menu.add(weightedMeansChooser_menuItem); + sortFractionsDateAsc_menuItemCheckBox.setText("Sort Fractions by Date Ascending in Weighted Means Chooser"); + sortFractionsDateAsc_menuItemCheckBox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + sortFractionsDateAsc_menuItemCheckBoxActionPerformed(evt); + } + }); + weightedMeansPlotOptions_menu.add(sortFractionsDateAsc_menuItemCheckBox); + weightedMeansLookAndFeel_menuItem.setText("Weighted Means Display Options"); weightedMeansLookAndFeel_menuItem.setEnabled(false); weightedMeansPlotOptions_menu.add(weightedMeansLookAndFeel_menuItem); @@ -2307,6 +2349,11 @@ private void commonLeadCorrectionSelector_checkboxActionPerformed(java.awt.event ((PlottingDetailsDisplayInterface) concordiaGraphPanel).refreshPanel(true, false); }//GEN-LAST:event_commonLeadCorrectionSelector_checkboxActionPerformed + private void sortFractionsDateAsc_menuItemCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sortFractionsDateAsc_menuItemCheckBoxActionPerformed + dateTreeByAliquot.toggleSortByDateAsc(); + refreshSampleDateInterpretations(false, false); + }//GEN-LAST:event_sortFractionsDateAsc_menuItemCheckBoxActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JRadioButton DatePbCorrSchemeA_radio; private javax.swing.JRadioButton ageBest_radio; @@ -2375,6 +2422,7 @@ private void commonLeadCorrectionSelector_checkboxActionPerformed(java.awt.event private javax.swing.JButton showHistogram_button; private javax.swing.JButton showTightGraphProbability_button; private javax.swing.JToggleButton showTight_toggleButton; + private javax.swing.JCheckBoxMenuItem sortFractionsDateAsc_menuItemCheckBox; private javax.swing.JRadioButton terraWasserburgFlavor_radioButton; private javax.swing.JRadioButton thoriumConcordiaFlavor_radioButton; private javax.swing.JCheckBox thoriumCorrectionSelector_checkbox; @@ -2505,7 +2553,7 @@ public void sampleTreeChangeAnalysisMode(Object node) { } else if (nodeInfo instanceof ValueModel) { // sample date model ***************************** // get aliquot and retrieve subset of fractions for this sample date Object aliquotNodeInfo - = // + = ((DefaultMutableTreeNode) ((TreeNode) node).getParent()).getUserObject(); if (graphPanels_TabbedPane.getSelectedIndex() == graphPanels_TabbedPane.indexOfTab("Concordia")) { @@ -2982,8 +3030,7 @@ public void createWeightedMeanSVGandPDF() { try { selectedFileSVG - = - new File(selectedFile.getCanonicalPath().replaceFirst(".pdf", ".svg")); + = new File(selectedFile.getCanonicalPath().replaceFirst(".pdf", ".svg")); } catch (IOException iOException) { } diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.form b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.form index e939be85..8ca0aa76 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.form +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.form @@ -246,7 +246,7 @@ - +
@@ -277,7 +277,7 @@ - + @@ -308,7 +308,7 @@ - + @@ -340,7 +340,7 @@ - + @@ -454,7 +454,7 @@ - + @@ -473,7 +473,7 @@ - + @@ -492,7 +492,7 @@ - + @@ -512,7 +512,7 @@ - + @@ -525,7 +525,7 @@
- + @@ -538,7 +538,7 @@
- + @@ -560,7 +560,7 @@ - + @@ -937,7 +937,7 @@ - + @@ -987,7 +987,7 @@ - + @@ -1018,7 +1018,7 @@ - + @@ -1049,7 +1049,7 @@ - + @@ -1091,7 +1091,7 @@ - + @@ -1118,7 +1118,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1171,7 +1171,7 @@ - + @@ -1184,7 +1184,7 @@ - + @@ -1210,7 +1210,7 @@ - + @@ -1230,7 +1230,7 @@ - + diff --git a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.java b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.java index 05a08a59..cbdc8a0d 100644 --- a/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.java +++ b/src/main/java/org/earthtime/UPb_Redux/dialogs/sessionManagers/SessionAnalysisWorkflowManagerLAICPMS.java @@ -909,7 +909,7 @@ public void componentResized(java.awt.event.ComponentEvent evt) { fractionsShownLabel.setText("Fractions Shown:"); controlPanel_panel.setLayer(fractionsShownLabel, javax.swing.JLayeredPane.PALETTE_LAYER); controlPanel_panel.add(fractionsShownLabel); - fractionsShownLabel.setBounds(0, 435, 110, 16); + fractionsShownLabel.setBounds(1, 435, 110, 16); rawIsotopes_radioButton.setBackground(new java.awt.Color(173, 204, 182)); viewChooser_buttonGroup.add(rawIsotopes_radioButton); @@ -926,7 +926,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); controlPanel_panel.add(rawIsotopes_radioButton); - rawIsotopes_radioButton.setBounds(0, 70, 190, 20); + rawIsotopes_radioButton.setBounds(1, 70, 190, 20); correctedIsotopes_radioButton.setBackground(new java.awt.Color(204, 199, 173)); viewChooser_buttonGroup.add(correctedIsotopes_radioButton); @@ -943,7 +943,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); controlPanel_panel.add(correctedIsotopes_radioButton); - correctedIsotopes_radioButton.setBounds(0, 90, 190, 20); + correctedIsotopes_radioButton.setBounds(1, 90, 190, 20); rawRatios_radioButton.setBackground(new java.awt.Color(204, 184, 173)); viewChooser_buttonGroup.add(rawRatios_radioButton); @@ -965,7 +965,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); controlPanel_panel.add(rawRatios_radioButton); - rawRatios_radioButton.setBounds(0, 110, 190, 20); + rawRatios_radioButton.setBounds(1, 110, 190, 20); lockUnlockZoomSliders.setBackground(new java.awt.Color(51, 51, 51)); lockUnlockZoomSliders.setFont(new java.awt.Font("Braggadocio", 1, 24)); // NOI18N @@ -1032,7 +1032,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); controlPanel_panel.setLayer(includeAllFractions_button, javax.swing.JLayeredPane.PALETTE_LAYER); controlPanel_panel.add(includeAllFractions_button); - includeAllFractions_button.setBounds(0, 480, 150, 20); + includeAllFractions_button.setBounds(1, 480, 150, 20); refreshView_button.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N refreshView_button.setText("Refresh View"); @@ -1042,7 +1042,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); controlPanel_panel.add(refreshView_button); - refreshView_button.setBounds(0, 575, 150, 20); + refreshView_button.setBounds(1, 575, 150, 20); defaultZoom_button.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N defaultZoom_button.setText("Default Zoom"); @@ -1052,7 +1052,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); controlPanel_panel.add(defaultZoom_button); - defaultZoom_button.setBounds(0, 595, 150, 20); + defaultZoom_button.setBounds(1, 595, 150, 20); removeAllIndividualYAxisPanes_button.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N removeAllIndividualYAxisPanes_button.setText("Remove all Local Y-Axis"); @@ -1063,19 +1063,19 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); controlPanel_panel.setLayer(removeAllIndividualYAxisPanes_button, javax.swing.JLayeredPane.PALETTE_LAYER); controlPanel_panel.add(removeAllIndividualYAxisPanes_button); - removeAllIndividualYAxisPanes_button.setBounds(0, 540, 150, 20); + removeAllIndividualYAxisPanes_button.setBounds(1, 540, 150, 20); jLabel4.setFont(new java.awt.Font("SansSerif", 3, 10)); // NOI18N jLabel4.setText(" Select fractionation technique:"); controlPanel_panel.add(jLabel4); - jLabel4.setBounds(0, 145, 190, 13); + jLabel4.setBounds(10, 145, 170, 13); yAxisZoomSlider.setMaximum(320); yAxisZoomSlider.setMinimum(64); yAxisZoomSlider.setOrientation(javax.swing.JSlider.VERTICAL); yAxisZoomSlider.setValue(128); controlPanel_panel.add(yAxisZoomSlider); - yAxisZoomSlider.setBounds(0, 420, 20, 190); + yAxisZoomSlider.setBounds(1, 420, 20, 190); fractionationTechniqueTabbedPane.setBackground(new java.awt.Color(250, 240, 230)); fractionationTechniqueTabbedPane.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); @@ -1256,7 +1256,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { fractionationTechniqueTabbedPane.addTab("Intercept", interceptPanel); controlPanel_panel.add(fractionationTechniqueTabbedPane); - fractionationTechniqueTabbedPane.setBounds(0, 165, 190, 180); + fractionationTechniqueTabbedPane.setBounds(1, 165, 189, 180); restoreAllAquisitions.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N restoreAllAquisitions.setText("Restore all Aquisitions"); @@ -1267,7 +1267,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); controlPanel_panel.setLayer(restoreAllAquisitions, javax.swing.JLayeredPane.PALETTE_LAYER); controlPanel_panel.add(restoreAllAquisitions); - restoreAllAquisitions.setBounds(0, 500, 150, 20); + restoreAllAquisitions.setBounds(1, 500, 150, 20); jPanel1.setBackground(new java.awt.Color(250, 240, 230)); jPanel1.setPreferredSize(new java.awt.Dimension(191, 70)); @@ -1287,7 +1287,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { gridPlot_radioButtonActionPerformed(evt); } }); - jPanel1.add(gridPlot_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 8, 50, -1)); + jPanel1.add(gridPlot_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(1, 8, 50, -1)); graphPlot_radioButton.setBackground(new java.awt.Color(204, 255, 204)); plotStyleFractions_buttonGroup.add(graphPlot_radioButton); @@ -1303,7 +1303,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { graphPlot_radioButtonActionPerformed(evt); } }); - jPanel1.add(graphPlot_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 8, 65, -1)); + jPanel1.add(graphPlot_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(51, 8, 65, -1)); overlayPlot_radioButton.setBackground(new java.awt.Color(204, 255, 204)); plotStyleFractions_buttonGroup.add(overlayPlot_radioButton); @@ -1319,7 +1319,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { overlayPlot_radioButtonActionPerformed(evt); } }); - jPanel1.add(overlayPlot_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(115, 8, 75, -1)); + jPanel1.add(overlayPlot_radioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(116, 8, 75, -1)); jPanel1.add(samplesCompboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(2, 27, 185, -1)); amPrimaryRefMaterial_label.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N @@ -1334,7 +1334,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { yAxisOptionsLabel.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N yAxisOptionsLabel.setText("Y-axis Scaling Options:"); controlPanel_panel.add(yAxisOptionsLabel); - yAxisOptionsLabel.setBounds(0, 350, 160, 16); + yAxisOptionsLabel.setBounds(1, 350, 160, 16); yAxisScalingOptions.add(uniformYaxis); uniformYaxis.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N @@ -1349,7 +1349,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); controlPanel_panel.add(uniformYaxis); - uniformYaxis.setBounds(0, 365, 75, 20); + uniformYaxis.setBounds(1, 365, 75, 20); yAxisScalingOptions.add(independentYaxis); independentYaxis.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N @@ -1363,7 +1363,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); controlPanel_panel.add(independentYaxis); - independentYaxis.setBounds(75, 365, 115, 20); + independentYaxis.setBounds(76, 365, 115, 20); dataScalingOptions.add(allDataUsedForScaling); allDataUsedForScaling.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N @@ -1378,12 +1378,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); controlPanel_panel.add(allDataUsedForScaling); - allDataUsedForScaling.setBounds(0, 405, 75, 20); + allDataUsedForScaling.setBounds(1, 405, 75, 20); dataScalingOptionsLabel.setFont(new java.awt.Font("SansSerif", 0, 13)); // NOI18N dataScalingOptionsLabel.setText("Data Scaling Options:"); controlPanel_panel.add(dataScalingOptionsLabel); - dataScalingOptionsLabel.setBounds(0, 390, 150, 16); + dataScalingOptionsLabel.setBounds(1, 390, 150, 16); dataScalingOptions.add(includedDataUsedForScaling); includedDataUsedForScaling.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N @@ -1397,7 +1397,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); controlPanel_panel.add(includedDataUsedForScaling); - includedDataUsedForScaling.setBounds(75, 405, 115, 20); + includedDataUsedForScaling.setBounds(76, 405, 115, 20); setAllIndividualYAxisPanes_button.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N setAllIndividualYAxisPanes_button.setText("Show all Local Y-Axis"); @@ -1408,7 +1408,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); controlPanel_panel.setLayer(setAllIndividualYAxisPanes_button, javax.swing.JLayeredPane.PALETTE_LAYER); controlPanel_panel.add(setAllIndividualYAxisPanes_button); - setAllIndividualYAxisPanes_button.setBounds(0, 520, 150, 20); + setAllIndividualYAxisPanes_button.setBounds(1, 520, 150, 20); tripoliTab_layeredPane.add(controlPanel_panel); controlPanel_panel.setBounds(0, 0, 191, 620); diff --git a/src/main/java/org/earthtime/UPb_Redux/samples/Sample.java b/src/main/java/org/earthtime/UPb_Redux/samples/Sample.java index ae22a495..ea624cd0 100644 --- a/src/main/java/org/earthtime/UPb_Redux/samples/Sample.java +++ b/src/main/java/org/earthtime/UPb_Redux/samples/Sample.java @@ -300,7 +300,7 @@ public void setUpSample() { // April 2011 we are altering SampleIGSN to be of form rrr.IGSN // where rrr is registry as per enum SampleRegistries // this means that if sample is already flagged as validated - i.e. at SESAR - // we check that it is valid at GeochronID and change SampleIGSN and percolate it + // we check that it is valid at registry and change SampleIGSN and percolate it // down to all Aliquots updateWithRegistrySampleIGSN(); diff --git a/src/main/java/org/earthtime/UPb_Redux/valueModels/SampleDateModel.java b/src/main/java/org/earthtime/UPb_Redux/valueModels/SampleDateModel.java index 948abb0f..353fb4d7 100644 --- a/src/main/java/org/earthtime/UPb_Redux/valueModels/SampleDateModel.java +++ b/src/main/java/org/earthtime/UPb_Redux/valueModels/SampleDateModel.java @@ -1274,7 +1274,7 @@ private LogWMresults calculateWeightedMeansWithMSWDforLogRatioBasedData( // // logWMresults.setLogRatioMeanOneSigmaAnalyticalPlusInterStdPlusStdPlusLambda(logRatioMeanOneSigmaAnalyticalPlusInterStdPlusStdPlusLambda); // - System.out.println("Logratio based WM have ARRIVED !!"); +// System.out.println("Logratio based WM have ARRIVED !!"); } catch (Exception e) { } } diff --git a/src/main/java/org/earthtime/aliquots/ReduxAliquotInterface.java b/src/main/java/org/earthtime/aliquots/ReduxAliquotInterface.java index ac2debe5..45024a6e 100644 --- a/src/main/java/org/earthtime/aliquots/ReduxAliquotInterface.java +++ b/src/main/java/org/earthtime/aliquots/ReduxAliquotInterface.java @@ -16,10 +16,12 @@ package org.earthtime.aliquots; import java.util.Collections; +import java.util.Comparator; import java.util.Vector; import org.earthtime.UPb_Redux.utilities.comparators.IntuitiveStringComparator; import org.earthtime.archivingTools.AnalysisImageInterface; import org.earthtime.dataDictionaries.AnalysisImageTypes; +import org.earthtime.dataDictionaries.RadDates; import org.earthtime.fractions.ETFractionInterface; /** @@ -80,11 +82,33 @@ public default Vector getAliquotFractionIDs() { getAliquotFractions().stream().filter((f) -> (!f.isRejected())).forEach((f) -> { retVal.add(f.getFractionID()); }); - + Collections.sort(retVal, new IntuitiveStringComparator<>()); return retVal; } + public default Vector getAliquotFractionIDsSortedByDateAsc() { + Vector dateOrderedFractions = new Vector<>(); + getAliquotFractions().stream().filter((f) -> (!f.isRejected())).forEach((f) -> { + dateOrderedFractions.add(f); + }); + + Collections.sort(dateOrderedFractions, new Comparator() { + @Override + public int compare(ETFractionInterface frac1, ETFractionInterface frac2) { + return frac1.getRadiogenicIsotopeDateByName(RadDates.age206_238r.getName()).getValue()// + .compareTo(frac2.getRadiogenicIsotopeDateByName(RadDates.age206_238r.getName()).getValue()); + } + }); + + Vector retVal = new Vector<>(); + for (int i = 0; i < dateOrderedFractions.size(); i ++){ + retVal.add(dateOrderedFractions.get(i).getFractionID()); + } + + return retVal; + } + /** * * @param name @@ -133,8 +157,8 @@ public default Vector getAliquotSampleDateModelDeSelectedFr * @param inLiveMode the value of inLiveMode */ public void reduceData(boolean inLiveMode); - - /** + + /** * * @param imageType * @return diff --git a/src/main/java/org/earthtime/archivingTools/GeoSamplesWebServices.java b/src/main/java/org/earthtime/archivingTools/GeoSamplesWebServices.java index f1b9b4a6..9d478cf1 100644 --- a/src/main/java/org/earthtime/archivingTools/GeoSamplesWebServices.java +++ b/src/main/java/org/earthtime/archivingTools/GeoSamplesWebServices.java @@ -26,6 +26,7 @@ import org.earthtime.exceptions.ETWarningDialog; import org.geosamples.XMLDocumentInterface; import org.geosamples.samples.Samples; +import static org.geosamples.samples.Samples.registerSampleMetaDataWithSesarProductionService; import static org.geosamples.samples.Samples.registerSampleMetaDataWithSesarTestService; import static org.geosamples.samples.Samples.serializeSamplesToCompliantXMLPrettyPrint; import org.xml.sax.SAXException; @@ -49,7 +50,7 @@ public class GeoSamplesWebServices { * @param isVerbose * @return */ - public static XMLDocumentInterface getSampleMetaDataFromGeoSamplesIGSN(String igsn, String username, String password, boolean isVerbose) { + public static XMLDocumentInterface getSampleMetaDataFromTestSesarIGSN(String igsn, String username, String password, boolean isVerbose) { XMLDocumentInterface samples = new Samples(); try { @@ -63,6 +64,30 @@ public static XMLDocumentInterface getSampleMetaDataFromGeoSamplesIGSN(String ig return samples; } + /** + * This class is used to control access to GeoSamples services, since we are + * experimenting with flavors. + * + * @param igsn + * @param username + * @param password + * @param isVerbose + * @return + */ + public static XMLDocumentInterface getSampleMetaDataFromGeoSamplesIGSN(String igsn, String username, String password, boolean isVerbose) { + XMLDocumentInterface samples = new Samples(); + + try { + samples = Samples.downloadSampleMetadataFromProductionSesarIGSN(igsn, username, password); + } catch (IOException | JAXBException | ParserConfigurationException | SAXException | NoSuchAlgorithmException | KeyStoreException | KeyManagementException anException) { + if (isVerbose) { + new ETWarningDialog(anException.getMessage()).setVisible(true); + } + } + + return samples; + } + public static XMLDocumentInterface getSampleMetaDataFromTestGeoSamplesIGSN(String igsn, boolean isVerbose) { XMLDocumentInterface samples = new Samples(); @@ -108,6 +133,40 @@ public static XMLDocumentInterface registerSampleAtGeoSamplesIGSN(Samples.Sample } catch (JAXBException jAXBException) { } + XMLDocumentInterface success = null; + try { + success = registerSampleMetaDataWithSesarProductionService(userName, password, mySamples); + if (success.getSample().size() > 0) { + System.out.println("REGISTERED!!!"); + } else { + System.out.println("FAILURE!!!"); + success = null; + } + } catch (JAXBException | NoSuchAlgorithmException | KeyStoreException | KeyManagementException | IOException ex) { + success = null; + Logger.getLogger(Samples.class.getName()).log(Level.SEVERE, null, ex); + } + + return success; + } + + /** + * + * @param sesarSample the value of sesarSample + * @param isVerbose the value of isVerbose + * @param userName the value of userName + * @param password the value of password + * @return + */ + public static XMLDocumentInterface registerSampleAtTestSesarIGSN(Samples.Sample sesarSample, boolean isVerbose, String userName, String password) { + XMLDocumentInterface mySamples = new Samples(); + mySamples.getSample().add(sesarSample); + + try { + System.out.println(serializeSamplesToCompliantXMLPrettyPrint(mySamples)); + } catch (JAXBException jAXBException) { + } + XMLDocumentInterface success = null; try { success = registerSampleMetaDataWithSesarTestService(userName, password, mySamples); @@ -125,7 +184,7 @@ public static XMLDocumentInterface registerSampleAtGeoSamplesIGSN(Samples.Sample return success; } - public static boolean isSampleRegistered(String igsn) { + public static boolean isSampleRegisteredAtTestSesar(String igsn) { XMLDocumentInterface downloadedSample = getSampleMetaDataFromTestGeoSamplesIGSN(igsn, false); boolean isRegistered = false; @@ -136,6 +195,17 @@ public static boolean isSampleRegistered(String igsn) { return isRegistered; } + public static boolean isSampleRegisteredAtGeoSamples(String igsn) { + XMLDocumentInterface downloadedSample = getSampleMetaDataFromGeoSamplesIGSN(igsn, false); + + boolean isRegistered = false; + try { + isRegistered = downloadedSample.getSample().get(0).getIgsn() != null; + } catch (Exception e) { + } + return isRegistered; + } + public static boolean isSampleRegisteredToParentAtTestGeoSamples(String igsn, String parentIgsn) { XMLDocumentInterface downloadedSample = getSampleMetaDataFromTestGeoSamplesIGSN(igsn, false); boolean isRegistered = false; diff --git a/src/main/java/org/earthtime/archivingTools/GeochronAliquotManager.java b/src/main/java/org/earthtime/archivingTools/GeochronAliquotManager.java index 3d59ff37..f801fa3f 100644 --- a/src/main/java/org/earthtime/archivingTools/GeochronAliquotManager.java +++ b/src/main/java/org/earthtime/archivingTools/GeochronAliquotManager.java @@ -39,7 +39,7 @@ import javax.swing.JTextField; import org.earthtime.UPb_Redux.ReduxConstants; import org.earthtime.aliquots.AliquotInterface; -import static org.earthtime.archivingTools.GeoSamplesWebServices.isSampleRegistered; +import static org.earthtime.archivingTools.GeoSamplesWebServices.isSampleRegisteredToParentAtTestGeoSamples; import static org.earthtime.archivingTools.GeochronUploaderUtility.produceConcordiaGraphForUploading; import static org.earthtime.archivingTools.GeochronUploaderUtility.producePDFImageForUploading; import org.earthtime.archivingTools.forSESAR.SesarSampleManager; @@ -48,7 +48,7 @@ import org.earthtime.projects.ProjectInterface; import org.earthtime.samples.SampleInterface; import org.geosamples.samples.Samples; -import static org.earthtime.archivingTools.GeoSamplesWebServices.isSampleRegisteredToParentAtTestGeoSamples; +import static org.earthtime.archivingTools.GeoSamplesWebServices.isSampleRegisteredAtTestSesar; /** * @@ -236,7 +236,7 @@ public void keyPressed(KeyEvent e) { public void actionPerformed(ActionEvent e) { saveSample(); // get the igsn record and create a SesarSample to view - sesarSample = GeoSamplesWebServices.getSampleMetaDataFromGeoSamplesIGSN(sampleIGSN, userName, password, false).getSample().get(0); + sesarSample = GeoSamplesWebServices.getSampleMetaDataFromTestSesarIGSN(sampleIGSN, userName, password, false).getSample().get(0); if (sesarSample != null) { DialogEditor sesarSampleManager = new SesarSampleManager(null, true, sesarSample, sample.getSampleName(), false, userName, password); @@ -570,7 +570,7 @@ public aliquotReviewActionListener(AliquotInterface aliquot, Samples.Sample sesa public void actionPerformed(ActionEvent e) { saveAliquot(aliquot, aliquotIGSN_TextField.getText(), aliquotName_TextField); // get the igsn record and create a SesarSample to view - sesarAliquot = GeoSamplesWebServices.getSampleMetaDataFromGeoSamplesIGSN(aliquotIGSN_TextField.getText(), userName, password, false).getSample().get(0); + sesarAliquot = GeoSamplesWebServices.getSampleMetaDataFromTestSesarIGSN(aliquotIGSN_TextField.getText(), userName, password, false).getSample().get(0); if (sesarAliquot != null) { DialogEditor sesarSampleManager = new SesarSampleManager(null, true, sesarAliquot, aliquot.getAliquotName(), false, userName, password); @@ -663,7 +663,7 @@ public boolean verify(JComponent input) { boolean isValid = false; sampleIGSN = "IGSN"; if (proposedIGSN.length() == 9) { - isValid = isSampleRegistered(proposedIGSN); + isValid = isSampleRegisteredAtTestSesar(proposedIGSN); if (isValid) { sampleIGSN = proposedIGSN.trim().toUpperCase(); } else if (userCode.trim().length() == 0) { diff --git a/src/main/java/org/earthtime/archivingTools/URIHelper.java b/src/main/java/org/earthtime/archivingTools/URIHelper.java index 9a190e98..a91ff319 100644 --- a/src/main/java/org/earthtime/archivingTools/URIHelper.java +++ b/src/main/java/org/earthtime/archivingTools/URIHelper.java @@ -252,35 +252,37 @@ private static boolean validateXML(String xmlURI, String schemaURI) { */ public static org.w3c.dom.Document RetrieveXMLfromServerAsDOMdocument(String connectionString) { - org.w3c.dom.Document doc = null; - + Document convertedDocument = null; String tempSESARcontents = URIHelper.getTextFromURI(connectionString); - // write this to a file - String tempSESARFileName = "TempXMLfromServer.xml"; - FileOutputStream fos = null; - try { - fos = new FileOutputStream(tempSESARFileName); - } catch (FileNotFoundException ex) { - } + // sept 2016 SESAR started returning 400 for bad igsn + if (tempSESARcontents.length() > 0) { + // write this to a file + String tempSESARFileName = "TempXMLfromServer.xml"; + FileOutputStream fos = null; + try { + fos = new FileOutputStream(tempSESARFileName); + } catch (FileNotFoundException ex) { + } - OutputStreamWriter out = new OutputStreamWriter(fos); - try { - out.write(tempSESARcontents); - out.flush(); - out.close(); - } catch (IOException ex) { - JOptionPane.showMessageDialog(null, - new String[]{ - "Error reaching server: "// - + ex.getMessage() - }); - ex.printStackTrace(); - } + OutputStreamWriter out = new OutputStreamWriter(fos); + try { + out.write(tempSESARcontents); + out.flush(); + out.close(); + } catch (IOException ex) { + JOptionPane.showMessageDialog(null, + new String[]{ + "Error reaching server: "// + + ex.getMessage() + }); + ex.printStackTrace(); + } - File tempFile = new File(tempSESARFileName); - Document convertedDocument = convertXMLTextToDOMdocument(tempFile); - tempFile.delete(); + File tempFile = new File(tempSESARFileName); + convertedDocument = convertXMLTextToDOMdocument(tempFile); + tempFile.delete(); + } return convertedDocument; } diff --git a/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.java b/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.java index cdd5bcc7..2f40403f 100644 --- a/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.java +++ b/src/main/java/org/earthtime/archivingTools/forSESAR/SesarSampleManager.java @@ -35,13 +35,13 @@ import org.earthtime.UPb_Redux.ReduxConstants; import org.earthtime.UPb_Redux.utilities.BrowserControl; import static org.earthtime.archivingTools.GeoSamplesWebServices.CURRENT_GEOSAMPLES_WEBSERVICE_FOR_DOWNLOAD_IGSN; -import static org.earthtime.archivingTools.GeoSamplesWebServices.isSampleRegistered; import static org.earthtime.archivingTools.GeoSamplesWebServices.isWellFormedIGSN; -import static org.earthtime.archivingTools.GeoSamplesWebServices.registerSampleAtGeoSamplesIGSN; +import static org.earthtime.archivingTools.GeoSamplesWebServices.registerSampleAtTestSesarIGSN; import org.earthtime.beans.ET_JButton; import org.earthtime.dialogs.DialogEditor; import org.geosamples.XMLDocumentInterface; import org.geosamples.samples.Samples; +import static org.earthtime.archivingTools.GeoSamplesWebServices.isSampleRegisteredAtTestSesar; /** * @@ -265,7 +265,7 @@ public void keyPressed(KeyEvent e) { String proposedIGSN = sampleIGSNText.getText(); if (!proposedIGSN.toUpperCase().startsWith(sesarSample.getUserCode().toUpperCase())) { messageText = "User code prefix of IGSN should be: " + sesarSample.getUserCode(); - } else if (isSampleRegistered(proposedIGSN)) { + } else if (isSampleRegisteredAtTestSesar(proposedIGSN)) { messageText = "The IGSN: " + proposedIGSN + " is already in use."; } else if (!isWellFormedIGSN(proposedIGSN, sesarSample.getUserCode())) { messageText = "The IGSN: " + proposedIGSN + " is not of the form " + sesarSample.getUserCode() + "NNNNNNN\".substring(0, (9 - userCode.length())) + \", where N is any digit or any capital letter."; @@ -283,7 +283,7 @@ public void keyPressed(KeyEvent e) { sesarSample.setLatitude(new BigDecimal(decimalLatitude.getText())); sesarSample.setLongitude(new BigDecimal(decimalLongitude.getText())); // register at SESAR - XMLDocumentInterface success = registerSampleAtGeoSamplesIGSN(sesarSample, true, userName, password); + XMLDocumentInterface success = registerSampleAtTestSesarIGSN(sesarSample, true, userName, password); if (success != null) { sesarSample.setIgsn(success.getSample().get(0).getIgsn()); } else { diff --git a/src/main/java/org/earthtime/dataDictionaries/SampleRegistries.java b/src/main/java/org/earthtime/dataDictionaries/SampleRegistries.java index 0844f428..c5d5920a 100644 --- a/src/main/java/org/earthtime/dataDictionaries/SampleRegistries.java +++ b/src/main/java/org/earthtime/dataDictionaries/SampleRegistries.java @@ -27,9 +27,6 @@ public enum SampleRegistries { // Sample Registries - /** - * - */ /** * */ @@ -126,7 +123,7 @@ public static SampleRegistries getRegistryIfLegalCode ( String checkCode ) { public static String updateSampleID ( String sampleID ) { String retVal = sampleID; if ( !sampleID.contains(".") ) { - retVal = GeochronID.code + "." + sampleID; + retVal = SESAR.code + "." + sampleID; } return retVal; @@ -138,7 +135,7 @@ public static String updateSampleID ( String sampleID ) { * @return */ public static boolean isSampleIdentifierValidAtRegistry ( String sampleID ) { - // if missing or bad registry code, default to SampleRegistries.GeochronID + // if missing or bad registry code, default to SampleRegistries.SESAR boolean retVal = false; String[] parsed = new String[2]; SampleRegistries registry = null; @@ -170,18 +167,6 @@ public static boolean isSampleIdentifierValidAtRegistry ( String sampleID ) { retVal = doc.getElementsByTagName( "error" ).getLength() == 0; } } - -// -// // As of Aug 15 2011 SESAR uses , GeochronID uses for positive result -// // however, both use for negative result -// boolean resultsElementPresent = doc.getFirstChild().getNodeName().equalsIgnoreCase( "results" ); -// // for now, take negative approach -// if ( resultsElementPresent ) { -// retVal = doc.getElementsByTagName( "error" ).getLength() == 0; -// } else { -// // got GeochronID -// retVal = true; -// } } } } diff --git a/src/main/java/org/earthtime/dialogs/DialogEditor.java b/src/main/java/org/earthtime/dialogs/DialogEditor.java index 07fcc5d7..fb444081 100644 --- a/src/main/java/org/earthtime/dialogs/DialogEditor.java +++ b/src/main/java/org/earthtime/dialogs/DialogEditor.java @@ -65,14 +65,31 @@ public abstract class DialogEditor extends JDialog { public DialogEditor(java.awt.Frame parent, boolean modal) { super(parent, modal); - JDialog.setDefaultLookAndFeelDecorated(true); +// JDialog.setDefaultLookAndFeelDecorated(true); + /* Set the Metal look and feel */ + // + /* If Metal is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Metal".equals(info.getName())) { //Nimbus (original), Motif, Metal + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(org.earthtime.dialogs.DialogEditor.class.getName()).log(java.util.logging.Level.WARNING, null, ex); + } + // + initComponents(); } - public void initDialogContent(){ - + public void initDialogContent() { + } - + /** * * @param preferredWidth @@ -146,16 +163,16 @@ public void undoableEditHappened(UndoableEditEvent evt) { textComp.getActionMap().put("Undo", new AbstractAction("Undo") { - @Override - public void actionPerformed(ActionEvent evt) { - try { - if (undo.canUndo()) { - undo.undo(); - } - } catch (CannotUndoException e) { - } + @Override + public void actionPerformed(ActionEvent evt) { + try { + if (undo.canUndo()) { + undo.undo(); } - }); + } catch (CannotUndoException e) { + } + } + }); // Bind the undo action to ctl-Z textComp.getInputMap().put(KeyStroke.getKeyStroke("control Z"), "Undo"); @@ -164,16 +181,16 @@ public void actionPerformed(ActionEvent evt) { textComp.getActionMap().put("Redo", new AbstractAction("Redo") { - @Override - public void actionPerformed(ActionEvent evt) { - try { - if (undo.canRedo()) { - undo.redo(); - } - } catch (CannotRedoException e) { - } + @Override + public void actionPerformed(ActionEvent evt) { + try { + if (undo.canRedo()) { + undo.redo(); } - }); + } catch (CannotRedoException e) { + } + } + }); // Bind the redo action to ctl-Y textComp.getInputMap().put(KeyStroke.getKeyStroke("control Y"), "Redo"); diff --git a/src/main/java/org/earthtime/dialogs/projectManagers/projectLegacyManagers/AbstractProjectOfLegacySamplesDataManagerDialog.form b/src/main/java/org/earthtime/dialogs/projectManagers/projectLegacyManagers/AbstractProjectOfLegacySamplesDataManagerDialog.form index 720ee4bd..c855d931 100644 --- a/src/main/java/org/earthtime/dialogs/projectManagers/projectLegacyManagers/AbstractProjectOfLegacySamplesDataManagerDialog.form +++ b/src/main/java/org/earthtime/dialogs/projectManagers/projectLegacyManagers/AbstractProjectOfLegacySamplesDataManagerDialog.form @@ -45,7 +45,7 @@ - + @@ -270,9 +270,12 @@ + + + - + @@ -293,9 +296,12 @@ + + + - + diff --git a/src/main/java/org/earthtime/dialogs/projectManagers/projectLegacyManagers/AbstractProjectOfLegacySamplesDataManagerDialog.java b/src/main/java/org/earthtime/dialogs/projectManagers/projectLegacyManagers/AbstractProjectOfLegacySamplesDataManagerDialog.java index 25cba160..5e483951 100644 --- a/src/main/java/org/earthtime/dialogs/projectManagers/projectLegacyManagers/AbstractProjectOfLegacySamplesDataManagerDialog.java +++ b/src/main/java/org/earthtime/dialogs/projectManagers/projectLegacyManagers/AbstractProjectOfLegacySamplesDataManagerDialog.java @@ -319,8 +319,8 @@ private void initComponents() { dataSourceLabel = new javax.swing.JLabel(); dataSourceNameLabel = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); - close = new javax.swing.JButton(); - saveAndClose = new javax.swing.JButton(); + close = new ET_JButton(); + saveAndClose = new ET_JButton(); sampleType_panel = new javax.swing.JPanel(); sampleType_label = new javax.swing.JLabel(); @@ -408,7 +408,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { closeActionPerformed(evt); } }); - jPanel2.add(close, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 0, 168, 32)); + jPanel2.add(close, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 0, 168, 25)); saveAndClose.setForeground(new java.awt.Color(255, 51, 0)); saveAndClose.setText("Save and Close"); @@ -420,7 +420,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { saveAndCloseActionPerformed(evt); } }); - jPanel2.add(saveAndClose, new org.netbeans.lib.awtextra.AbsoluteConstraints(8, 2, 168, 32)); + jPanel2.add(saveAndClose, new org.netbeans.lib.awtextra.AbsoluteConstraints(8, 2, 168, 25)); sampleType_panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); @@ -453,7 +453,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .add(layout.createSequentialGroup() .add(sampleType_panel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(6, 6, 6) - .add(infoPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) + .add(infoPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE) .add(6, 6, 6) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); diff --git a/src/main/java/org/earthtime/reportViews/ReportAliquotFractionsView.java b/src/main/java/org/earthtime/reportViews/ReportAliquotFractionsView.java index c8fd3d63..e2d7e03c 100644 --- a/src/main/java/org/earthtime/reportViews/ReportAliquotFractionsView.java +++ b/src/main/java/org/earthtime/reportViews/ReportAliquotFractionsView.java @@ -474,6 +474,7 @@ public void actionPerformed(ActionEvent e) { reportFractionIDsScrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(0, 0)); // eliminate default "crawl" reportFractionIDsScrollPane.getVerticalScrollBar().setUnitIncrement(64); + reportFractionIDsScrollPane.getVerticalScrollBar().setBlockIncrement(2); reportFractionIDsScrollPane.getHorizontalScrollBar().setUnitIncrement(64); reportFractionIDsScrollPane.setLocation(0, DATATABLE_TOP_HEIGHT); @@ -503,6 +504,7 @@ public void adjustmentValueChanged(AdjustmentEvent evt) { reportBodyScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); // eliminate default "crawl" reportBodyScrollPane.getVerticalScrollBar().setUnitIncrement(64); + reportBodyScrollPane.getVerticalScrollBar().setBlockIncrement(2); reportBodyScrollPane.getHorizontalScrollBar().setUnitIncrement(64); reportBodyScrollPane.setLocation(fractionColumnWidth, DATATABLE_TOP_HEIGHT); diff --git a/src/main/java/org/earthtime/reportViews/TabbedReportViews.java b/src/main/java/org/earthtime/reportViews/TabbedReportViews.java index 9f45dc05..73c5ee86 100644 --- a/src/main/java/org/earthtime/reportViews/TabbedReportViews.java +++ b/src/main/java/org/earthtime/reportViews/TabbedReportViews.java @@ -67,6 +67,7 @@ public TabbedReportViews(ETReduxFrame parentFrame, SampleInterface sample) { public void initializeTabs() { setBackground(Color.white); + setForeground(Color.red); viewTabulatedAliquotActiveFractions = new ReportAliquotFractionsView(parentFrame, true); add("Active Fractions", viewTabulatedAliquotActiveFractions); diff --git a/src/main/java/org/earthtime/reports/ReportSettingsInterface.java b/src/main/java/org/earthtime/reports/ReportSettingsInterface.java index 28aa76cc..4a4e38b0 100644 --- a/src/main/java/org/earthtime/reports/ReportSettingsInterface.java +++ b/src/main/java/org/earthtime/reports/ReportSettingsInterface.java @@ -78,7 +78,7 @@ public default Map getReportCategoriesInOrder( public void assembleReportCategories(); public ReportSettingsInterface deepCopy(); - + /** * * @return @@ -167,15 +167,15 @@ public default Object readXMLObject(String filename, boolean doValidate) @Override boolean equals(Object reportSettingsModel); - public default void toggleMeasuredRatiosInCompositionCategory(){ + public default void toggleMeasuredRatiosInCompositionCategory() { ReportCategoryInterface composition = getCompositionCategory(); - for (ReportColumnInterface column : composition.getCategoryColumns()){ - if (column.getDisplayName1().contains("meas")){ + for (ReportColumnInterface column : composition.getCategoryColumns()) { + if (column.getDisplayName1().contains("meas")) { column.ToggleIsVisible(); } - } + } } - + /** * * @return @@ -415,11 +415,9 @@ public default String[][] reportFractionsByNumberStyle(// // get first activityValue and first Th_Umagma value and set standard footnote entries BigDecimal savedActivityValue - = // - fractions.get(0).getAnalysisMeasure(AnalysisMeasures.ar231_235sample.getName()).getValue(); + = fractions.get(0).getAnalysisMeasure(AnalysisMeasures.ar231_235sample.getName()).getValue(); BigDecimal savedMagmaValue - = // - fractions.get(0).getAnalysisMeasure(AnalysisMeasures.rTh_Umagma.getName()).getValue(); + = fractions.get(0).getAnalysisMeasure(AnalysisMeasures.rTh_Umagma.getName()).getValue(); activityFootnoteEntry = "= " + savedActivityValue.toString(); thU_MagmaFootnoteEntry = "= " + savedMagmaValue.toString(); @@ -650,8 +648,7 @@ public default String[][] reportFractionsByNumberStyle(// } retVal[fractionRowCount][1] - = // - sample.getAliquotByNumber(f.getAliquotNumber()).getAliquotName(); + = sample.getAliquotByNumber(f.getAliquotNumber()).getAliquotName(); } // field contains the Value in field[0] @@ -709,12 +706,10 @@ public default String[][] reportFractionsByNumberStyle(// String lambda235Ref = ""; try { lambda238Ref - = // - " (" + ((ValueModelReferenced) sample.getPhysicalConstantsModel()// + = " (" + ((ValueModelReferenced) sample.getPhysicalConstantsModel()// .getDatumByName(Lambdas.lambda238.getName())).getReference() + ")"; lambda235Ref - = // - " (" + ((ValueModelReferenced) sample.getPhysicalConstantsModel()// + = " (" + ((ValueModelReferenced) sample.getPhysicalConstantsModel()// .getDatumByName(Lambdas.lambda235.getName())).getReference() + ")"; } catch (BadLabDataException badLabDataException) { } diff --git a/src/main/java/org/earthtime/samples/SampleInterface.java b/src/main/java/org/earthtime/samples/SampleInterface.java index 83bfeca1..acd469d5 100644 --- a/src/main/java/org/earthtime/samples/SampleInterface.java +++ b/src/main/java/org/earthtime/samples/SampleInterface.java @@ -339,12 +339,17 @@ public default boolean isAnalysisTypeIDTIMS() { * @return */ public default boolean isAnalysisTypeLAICPMS() { - boolean retVal = false; - try { - retVal = SampleAnalysisTypesEnum.LAICPMS.equals(SampleAnalysisTypesEnum.valueOf(getSampleAnalysisType())); - } catch (Exception e) { - } - return retVal; +// boolean retVal = false; +// try { +// retVal = SampleAnalysisTypesEnum.LAICPMS.equals(SampleAnalysisTypesEnum.valueOf(getSampleAnalysisType())); +// } catch (Exception e) { +// } +// +// return retVal; +// + + // sept 2016 + return getSampleAnalysisType().startsWith("LAICPMS"); } /** diff --git a/src/test/java/org/earthtime/dataDictionaries/SampleRegistriesTest.java b/src/test/java/org/earthtime/dataDictionaries/SampleRegistriesTest.java index 077b4931..82a5e6f4 100644 --- a/src/test/java/org/earthtime/dataDictionaries/SampleRegistriesTest.java +++ b/src/test/java/org/earthtime/dataDictionaries/SampleRegistriesTest.java @@ -115,7 +115,7 @@ public void test_GetRegistryIfLegalCode() { public void test_UpdateSampleID() { System.out.println("Testing SampleRegistries's gupdateSampleID(String sampleId)"); String sampleID = "hello"; - String expResult = "GCH.hello"; + String expResult = "SSR.hello"; String result = SampleRegistries.updateSampleID(sampleID); assertEquals(expResult, result);