diff --git a/nb-configuration.xml b/nb-configuration.xml
index 80c97dd0..5b0f1f83 100644
--- a/nb-configuration.xml
+++ b/nb-configuration.xml
@@ -14,6 +14,5 @@ That way multiple projects can share the same settings (useful for formatting ru
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
true
- JDK_1.8
diff --git a/pom.xml b/pom.xml
index 9c2cc736..dbe6fbc4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
org.cirdles
ET_Redux
ET_Redux
- 3.6.71
+ 3.6.72
Successor to U-Pb_Redux
https://cirdles.org
2006
diff --git a/src/main/java/org/earthtime/ETReduxFrame.java b/src/main/java/org/earthtime/ETReduxFrame.java
index fb07b6b9..73d0be55 100644
--- a/src/main/java/org/earthtime/ETReduxFrame.java
+++ b/src/main/java/org/earthtime/ETReduxFrame.java
@@ -1603,9 +1603,15 @@ public void updateReportTable(boolean performReduction, boolean inLiveMode, Stri
((SampleDateInterpretationsManager) sampleDateInterpDialog).setSample(theSample);
}
- try {
- ((SampleDateInterpretationsManager) sampleDateInterpDialog).refreshSampleDateInterpretations(false, inLiveMode);
- } catch (Exception e) {
+
+ if ((theSample.getSampleAnalysisType().length() == 0)
+ ||theSample.isAnalysisTypeUSERIES()) {
+ // oct 2018 problem of time sink involving setselectedrow of tree
+ } else {
+ try {
+ ((SampleDateInterpretationsManager) sampleDateInterpDialog).refreshSampleDateInterpretations(false, inLiveMode);
+ } catch (Exception e) {
+ }
}
}
@@ -3660,12 +3666,12 @@ private void manageSampleDateInterpretation(SampleTreeI dateTreeByAliquot, Sampl
myPlotAnyPanel = new PlotAny2Panel(theSample, this);
myUseriesIsochronPanel = new IsochronsPanel(theSample, this);
- if (myEvolutionPlotPanel == null) {
+ // if (myEvolutionPlotPanel == null) {
// myEvolutionPlotPanel = null;
myEvolutionPlotPanel = new EvolutionPlotPanelII(theSample, this);
// PlaceHolderForJavaFxThread placeHolderForJavaFXThread = new PlaceHolderForJavaFxThread();
// placeHolderForJavaFXThread.runme();
- }
+ // }
theSample.getSampleDateInterpretationGUISettings().//
setConcordiaOptions(((ConcordiaPlotDisplayInterface) myConcordiaGraphPanel).getConcordiaOptions());
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 67ddb1cc..496a80ea 100644
--- a/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeAnalysisMode.java
+++ b/src/main/java/org/earthtime/UPb_Redux/dateInterpretation/SampleTreeAnalysisMode.java
@@ -638,7 +638,7 @@ public void actionPerformed(ActionEvent arg0) {
}
});
popup.add(menuItem);
-
+
if (sample.getIsotopeSystem().compareToIgnoreCase("UTh") == 0) {
menuItem = new JMenuItem("Set Isochrons for this model");
menuItem.addActionListener((ActionEvent arg0) -> {
@@ -647,7 +647,7 @@ public void actionPerformed(ActionEvent arg0) {
myIsochronDialog.setSize(325, 385);
myIsochronDialog.setVisible(true);
((SampleDateModel) nodeInfo).setIsochronModels(((IsochronsSelectorDialog) myIsochronDialog).getSelectedIsochrons());
-
+
getSampleTreeChange().sampleTreeChangeAnalysisMode(node);
});
popup.add(menuItem);
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 982bfc91..77d4d742 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
@@ -979,6 +979,13 @@
+
+
+
+
+
+
+
@@ -990,6 +997,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 375bb818..3008b12d 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
@@ -18,9 +18,7 @@
*/
package org.earthtime.UPb_Redux.dialogs.sampleManagers.sampleDateInterpretationManagers;
-import java.awt.BorderLayout;
import java.awt.Component;
-import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -60,7 +58,6 @@
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeNode;
import org.apache.batik.swing.JSVGCanvas;
-import org.earthtime.Tripoli.dataViews.AbstractRawDataView;
import org.earthtime.UPb_Redux.beans.ReduxSpinner;
import org.earthtime.UPb_Redux.beans.ReduxSuppressComponentEventsI;
import org.earthtime.UPb_Redux.customJTrees.CheckBoxNode;
@@ -99,8 +96,10 @@
import org.earthtime.plots.PlotAxesSetupInterface;
import org.earthtime.plots.PlotInterface;
import org.earthtime.plots.anyTwo.PlotAny2Panel;
+import org.earthtime.plots.evolution.EvolutionPlotPanelII;
import org.earthtime.plots.isochrons.IsochronsPanel;
import org.earthtime.plots.isochrons.UseriesIsochronPlotDisplayInterface;
+import org.earthtime.plots.isochrons.evolution.IsochronsEvolutionSelectorDialog;
import org.earthtime.reduxLabData.ReduxLabData;
import org.earthtime.reports.ReportColumnInterface;
import org.earthtime.samples.SampleInterface;
@@ -495,11 +494,16 @@ private void initUseriesIsochronPanel() {
private void initEvolutionPlotPanel() {
- // set toolbar choices per options
- // Map UIO = sample.getSampleDateInterpretationGUISettings().getuSeriesIsochronOptions();
+ evolutionLayeredPane.add(evolutionPlotPanel);
- evolutionLayeredPane.setLayout(new BorderLayout());
- evolutionLayeredPane.add(evolutionPlotPanel, BorderLayout.CENTER);
+ int heightWE = evolutionLayeredPane.getHeight();
+ int widthWE = evolutionLayeredPane.getWidth();
+
+ evolutionToolPanel.setBounds(
+ 1,
+ heightWE - 27,
+ widthWE,
+ 35);
((AliquotDetailsDisplayInterface) evolutionPlotPanel).//
setSelectedFractions(sample.getFractions());
@@ -971,8 +975,7 @@ public void synchronizePanelSizes(PlotAxesSetupInterface currentGraphAxesSetup)
} catch (Exception e) {
}
- evolutionPlotPanel.setPreferredSize(new Dimension(adjustedWidth, adjustedHeight));
-
+ // evolutionPlotPanel.setPreferredSize(new Dimension(adjustedWidth, adjustedHeight - 400));
((WeightedMeanGraphPanel) weightedMeanGraphPanel).setGraphWidth(adjustedWidth);
((WeightedMeanGraphPanel) weightedMeanGraphPanel).setGraphHeight(adjustedHeight);
@@ -1074,6 +1077,21 @@ private void initializeWeightedMeanOptions(
}
}
+ private void selectEvolutionIsochrons() {
+ DialogEditor myDialog
+ = new IsochronsEvolutionSelectorDialog(
+ null,
+ true,
+ ((SampleDateModel) sample.getSampleDateModelByName("DEFAULT")));
+ myDialog.setSize(340, 625);
+ myDialog.setVisible(true);
+
+ myDialog.dispose();
+
+ ((EvolutionPlotPanelII) evolutionPlotPanel).buildIsochronsAndContours();
+ evolutionPlotPanel.repaint();
+ }
+
// June 2010 new sections for additional tabs
// any 2 ratios plot tab
// Revisited for first time in Dec 2016 now that McLeanRegression Library is available
@@ -1225,6 +1243,13 @@ private void initComponents() {
fractionOrderByRandom_radioButton = new javax.swing.JRadioButton();
fractionOrderByDate_radioButton = new javax.swing.JRadioButton();
evolutionLayeredPane = new javax.swing.JLayeredPane();
+ evolutionToolPanel = new javax.swing.JPanel();
+ resetEvolution_button = new ET_JButton();
+ ellipseCentersEvolutionOnToggle_checkbox = new javax.swing.JCheckBox();
+ ellipseLabelsEvolutionOnToggle_checkbox = new javax.swing.JCheckBox();
+ zoomBoxEvolution_toggleButton = new ET_JToggleButton();
+ showTightEvolution_toggleButton = new ET_JToggleButton();
+ isochrons_button = new ET_JButton();
useriesIsochronLayeredPane = new javax.swing.JLayeredPane();
uSeriesIsochronToolPanel = new javax.swing.JPanel();
zoomInX2Isochron_button = new ET_JButton();
@@ -1665,6 +1690,103 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
weightedMeanToolPanel.setBounds(1, 604, 910, 36);
graphPanels_TabbedPane.addTab("Weighted Mean", weightedMeanLayeredPane);
+
+ evolutionLayeredPane.setBackground(new java.awt.Color(231, 255, 253));
+ evolutionLayeredPane.setName("Evolution"); // NOI18N
+ evolutionLayeredPane.setOpaque(true);
+
+ evolutionToolPanel.setBackground(new java.awt.Color(231, 255, 253));
+ evolutionToolPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+ evolutionToolPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
+
+ resetEvolution_button.setBackground(new java.awt.Color(255, 255, 255));
+ resetEvolution_button.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N
+ resetEvolution_button.setText("Reset");
+ resetEvolution_button.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+ resetEvolution_button.setMargin(new java.awt.Insets(0, 0, 0, 0));
+ resetEvolution_button.setOpaque(true);
+ resetEvolution_button.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ resetEvolution_buttonActionPerformed(evt);
+ }
+ });
+ evolutionToolPanel.add(resetEvolution_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 2, 35, 30));
+
+ ellipseCentersEvolutionOnToggle_checkbox.setBackground(new java.awt.Color(231, 255, 253));
+ ellipseCentersEvolutionOnToggle_checkbox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
+ ellipseCentersEvolutionOnToggle_checkbox.setSelected(true);
+ ellipseCentersEvolutionOnToggle_checkbox.setText("Ellipse Centers");
+ ellipseCentersEvolutionOnToggle_checkbox.setOpaque(true);
+ ellipseCentersEvolutionOnToggle_checkbox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ ellipseCentersEvolutionOnToggle_checkboxActionPerformed(evt);
+ }
+ });
+ evolutionToolPanel.add(ellipseCentersEvolutionOnToggle_checkbox, new org.netbeans.lib.awtextra.AbsoluteConstraints(556, 6, -1, -1));
+
+ ellipseLabelsEvolutionOnToggle_checkbox.setBackground(new java.awt.Color(231, 255, 253));
+ ellipseLabelsEvolutionOnToggle_checkbox.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
+ ellipseLabelsEvolutionOnToggle_checkbox.setText("Labels");
+ ellipseLabelsEvolutionOnToggle_checkbox.setOpaque(true);
+ ellipseLabelsEvolutionOnToggle_checkbox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ ellipseLabelsEvolutionOnToggle_checkboxActionPerformed(evt);
+ }
+ });
+ evolutionToolPanel.add(ellipseLabelsEvolutionOnToggle_checkbox, new org.netbeans.lib.awtextra.AbsoluteConstraints(685, 6, -1, -1));
+
+ zoomBoxEvolution_toggleButton.setBackground(new java.awt.Color(255, 255, 255));
+ concordiaPanZoom_buttonGroup.add(zoomBoxEvolution_toggleButton);
+ zoomBoxEvolution_toggleButton.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N
+ zoomBoxEvolution_toggleButton.setText("Zoom-Box");
+ zoomBoxEvolution_toggleButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+ zoomBoxEvolution_toggleButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
+ zoomBoxEvolution_toggleButton.setName("ZOOM"); // NOI18N
+ zoomBoxEvolution_toggleButton.setOpaque(true);
+ zoomBoxEvolution_toggleButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ zoomBoxEvolution_toggleButtonActionPerformed(evt);
+ }
+ });
+ evolutionToolPanel.add(zoomBoxEvolution_toggleButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(95, 2, 55, 30));
+
+ showTightEvolution_toggleButton.setBackground(new java.awt.Color(255, 255, 255));
+ concordiaPanZoom_buttonGroup.add(showTightEvolution_toggleButton);
+ showTightEvolution_toggleButton.setFont(new java.awt.Font("SansSerif", 1, 9)); // NOI18N
+ showTightEvolution_toggleButton.setText("Tight");
+ showTightEvolution_toggleButton.setToolTipText("Zooms in until ellipses touch borders.");
+ showTightEvolution_toggleButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+ showTightEvolution_toggleButton.setContentAreaFilled(false);
+ showTightEvolution_toggleButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
+ showTightEvolution_toggleButton.setName("TIGHT"); // NOI18N
+ showTightEvolution_toggleButton.setOpaque(true);
+ showTightEvolution_toggleButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ showTightEvolution_toggleButtonActionPerformed(evt);
+ }
+ });
+ evolutionToolPanel.add(showTightEvolution_toggleButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 2, 30, 30));
+
+ isochrons_button.setBackground(new java.awt.Color(255, 255, 255));
+ isochrons_button.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
+ isochrons_button.setText("Isochrons");
+ isochrons_button.setAlignmentY(0.0F);
+ isochrons_button.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+ isochrons_button.setFocusable(false);
+ isochrons_button.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+ isochrons_button.setMargin(new java.awt.Insets(0, 0, 0, 0));
+ isochrons_button.setOpaque(true);
+ isochrons_button.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+ isochrons_button.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ isochrons_buttonActionPerformed(evt);
+ }
+ });
+ evolutionToolPanel.add(isochrons_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 2, 70, 30));
+
+ evolutionLayeredPane.add(evolutionToolPanel);
+ evolutionToolPanel.setBounds(0, 604, 790, 35);
+
graphPanels_TabbedPane.addTab("Evolution", evolutionLayeredPane);
useriesIsochronLayeredPane.setBackground(new java.awt.Color(255, 237, 255));
@@ -2549,8 +2671,8 @@ private void graphPanelsTabbedPaneResized(java.awt.event.ComponentEvent evt) {//
} catch (Exception e) {
}
- evolutionPlotPanel.setBounds(evolutionLayeredPane.getBounds());
- evolutionPlotPanel.setSize(evolutionLayeredPane.getSize());
+ // evolutionPlotPanel.setBounds(0,0,evolutionLayeredPane.getWidth(), evolutionLayeredPane.getHeight() - 400);
+ //evolutionPlotPanel.setSize(evolutionLayeredPane.getSize());
((org.earthtime.plots.AbstractDataView) evolutionPlotPanel).refreshPanel(true);
((WeightedMeanGraphPanel) weightedMeanGraphPanel).setGraphWidth(adjustedWidth);
@@ -3029,6 +3151,34 @@ private void writeVisiblePlotSvgPdf_buttonActionPerformed(java.awt.event.ActionE
delegatePlotFileWriting();
}//GEN-LAST:event_writeVisiblePlotSvgPdf_buttonActionPerformed
+ private void resetEvolution_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetEvolution_buttonActionPerformed
+ ((EvolutionPlotPanelII) evolutionPlotPanel).showLoose();
+ }//GEN-LAST:event_resetEvolution_buttonActionPerformed
+
+ private void ellipseCentersEvolutionOnToggle_checkboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ellipseCentersEvolutionOnToggle_checkboxActionPerformed
+ ((EvolutionPlotPanelII) evolutionPlotPanel)
+ .setShowCenters(ellipseCentersEvolutionOnToggle_checkbox.isSelected());
+ ((EvolutionPlotPanelII) evolutionPlotPanel).repaint();
+ }//GEN-LAST:event_ellipseCentersEvolutionOnToggle_checkboxActionPerformed
+
+ private void ellipseLabelsEvolutionOnToggle_checkboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ellipseLabelsEvolutionOnToggle_checkboxActionPerformed
+ ((EvolutionPlotPanelII) evolutionPlotPanel)
+ .setShowLabels(ellipseLabelsEvolutionOnToggle_checkbox.isSelected());
+ ((EvolutionPlotPanelII) evolutionPlotPanel).repaint();
+ }//GEN-LAST:event_ellipseLabelsEvolutionOnToggle_checkboxActionPerformed
+
+ private void zoomBoxEvolution_toggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zoomBoxEvolution_toggleButtonActionPerformed
+ ((EvolutionPlotPanelII) evolutionPlotPanel).putInImageModeZoom();
+ }//GEN-LAST:event_zoomBoxEvolution_toggleButtonActionPerformed
+
+ private void showTightEvolution_toggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showTightEvolution_toggleButtonActionPerformed
+ ((EvolutionPlotPanelII) evolutionPlotPanel).showTight();
+ }//GEN-LAST:event_showTightEvolution_toggleButtonActionPerformed
+
+ private void isochrons_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_isochrons_buttonActionPerformed
+ selectEvolutionIsochrons();
+ }//GEN-LAST:event_isochrons_buttonActionPerformed
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JRadioButton DatePbCorrSchemeA_radio;
private javax.swing.JRadioButton ageBest_radio;
@@ -3056,12 +3206,15 @@ private void writeVisiblePlotSvgPdf_buttonActionPerformed(java.awt.event.ActionE
private javax.swing.JButton defaultFilters_button;
private javax.swing.JMenu displayOptions_menu;
private javax.swing.JCheckBox ellipseCentersAny2OnToggle_checkbox;
+ private javax.swing.JCheckBox ellipseCentersEvolutionOnToggle_checkbox;
private javax.swing.JCheckBox ellipseCentersIsochron_Checkbox;
private javax.swing.JCheckBox ellipseCenters_checkbox;
private javax.swing.JCheckBox ellipseLabelsAny2OnToggle_checkbox;
+ private javax.swing.JCheckBox ellipseLabelsEvolutionOnToggle_checkbox;
private javax.swing.JCheckBox ellipseLabelsIsochron_checkbox;
private javax.swing.JCheckBox ellipseLabels_checkbox;
private javax.swing.JLayeredPane evolutionLayeredPane;
+ private javax.swing.JPanel evolutionToolPanel;
private javax.swing.JRadioButton fractionOrderByDate_radioButton;
private javax.swing.JRadioButton fractionOrderByName_radioButton;
private javax.swing.JRadioButton fractionOrderByRandom_radioButton;
@@ -3070,6 +3223,7 @@ private void writeVisiblePlotSvgPdf_buttonActionPerformed(java.awt.event.ActionE
private javax.swing.JMenu heatMap_Menu;
private javax.swing.JSpinner histogramBinCount_spinner;
private javax.swing.JSplitPane interpretations_SplitPane;
+ private javax.swing.JButton isochrons_button;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel4;
@@ -3091,6 +3245,7 @@ private void writeVisiblePlotSvgPdf_buttonActionPerformed(java.awt.event.ActionE
private javax.swing.JPanel probabilityToolPanel;
private javax.swing.JCheckBox protactiniumCorrectionSelector_checkbox;
private javax.swing.JRadioButton radiumFlavorIsochron_radioButton;
+ private javax.swing.JButton resetEvolution_button;
private javax.swing.JButton resetGraphAny2Display_button;
private javax.swing.JButton resetGraphDisplayIsochron_button;
private javax.swing.JButton resetGraphDisplay_button;
@@ -3108,6 +3263,7 @@ private void writeVisiblePlotSvgPdf_buttonActionPerformed(java.awt.event.ActionE
private javax.swing.JCheckBox showRegressionLineIsochron_checkbox;
private javax.swing.JCheckBox showRegressionUnctIsochron_checkbox;
private javax.swing.JToggleButton showTightAny2_toggleButton;
+ private javax.swing.JToggleButton showTightEvolution_toggleButton;
private javax.swing.JButton showTightGraphProbability_button;
private javax.swing.JToggleButton showTightIsochron_toggleButton;
private javax.swing.JToggleButton showTight_toggleButton;
@@ -3127,6 +3283,7 @@ private void writeVisiblePlotSvgPdf_buttonActionPerformed(java.awt.event.ActionE
private javax.swing.JMenu weightedMeansPlotOptions_menu;
private javax.swing.JButton writeVisiblePlotSvgPdf_button;
private javax.swing.JToggleButton zoomBoxAny2_toggleButton;
+ private javax.swing.JToggleButton zoomBoxEvolution_toggleButton;
private javax.swing.JToggleButton zoomBox_toggleButton;
private javax.swing.JToggleButton zoomBox_toggleIsochron_button;
private javax.swing.JButton zoomInAny2X2_button;
@@ -3264,7 +3421,7 @@ public void sampleTreeChangeAnalysisMode(Object node) {
((AliquotDetailsDisplayInterface) evolutionPlotPanel).//
setSelectedFractions(sample.getFractions());
((AbstractDataView) evolutionPlotPanel).refreshPanel(true);
-
+
// update weighted means in case of delete or (oct 2010) add
weightedMeanOptions = sample.getSampleDateInterpretationGUISettings().getWeightedMeanOptions();
((WeightedMeanGraphPanel) weightedMeanGraphPanel).setWeightedMeanOptions(weightedMeanOptions);
@@ -3356,7 +3513,7 @@ public void sampleTreeChangeAnalysisMode(Object node) {
setSelectedFractions(((ReduxAliquotInterface) aliquotNodeInfo).
getAliquotSampleDateModelSelectedFractions(((SampleDateModel) nodeInfo).
getIncludedFractionIDsVector()));
- evolutionPlotPanel.repaint();
+ ((AbstractDataView) evolutionPlotPanel).refreshPanel(true);
// ((AliquotDetailsDisplayInterface) useriesIsochronPanel).//
// setDeSelectedFractions(((ReduxAliquotInterface) aliquotNodeInfo).//
// getAliquotSampleDateModelDeSelectedFractions(((SampleDateModel) nodeInfo).//
@@ -3537,7 +3694,8 @@ public void sampleTreeChangeAnalysisMode(Object node) {
setPreferredDatePanel(dateInterpretationBoxPanel);
concordiaGraphPanel.repaint();
} else if ((graphPanels_TabbedPane.getSelectedIndex() == graphPanels_TabbedPane.indexOfTab("Any 2"))
- || (graphPanels_TabbedPane.getSelectedIndex() == graphPanels_TabbedPane.indexOfTab("USeries Isochrons"))) {
+ || (graphPanels_TabbedPane.getSelectedIndex() == graphPanels_TabbedPane.indexOfTab("USeries Isochrons"))
+ || (graphPanels_TabbedPane.getSelectedIndex() == graphPanels_TabbedPane.indexOfTab("Evolution"))) {
// dec 2016
((AliquotDetailsDisplayInterface) plotAny2Panel).//
setSelectedFractions(((ReduxAliquotInterface) aliquotNodeInfo).//
@@ -3565,14 +3723,22 @@ public void sampleTreeChangeAnalysisMode(Object node) {
((AliquotDetailsDisplayInterface) useriesIsochronPanel).//
setDeSelectedFractions(((ReduxAliquotInterface) aliquotNodeInfo).//
getAliquotSampleDateModelDeSelectedFractions(((SampleDateModel) sampleDateNodeInfo).getIncludedFractionIDsVector()));
+ useriesIsochronPanel.repaint();
+ ((AliquotDetailsDisplayInterface) evolutionPlotPanel).//
+ setSelectedFractions(((ReduxAliquotInterface) aliquotNodeInfo).//
+ getAliquotSampleDateModelSelectedFractions(((SampleDateModel) sampleDateNodeInfo).getIncludedFractionIDsVector()));
+// ((AliquotDetailsDisplayInterface) evolutionToolPanel).//
+// setDeSelectedFractions(((ReduxAliquotInterface) aliquotNodeInfo).//
+// getAliquotSampleDateModelDeSelectedFractions(((SampleDateModel) sampleDateNodeInfo).getIncludedFractionIDsVector()));
+ ((AbstractDataView) evolutionPlotPanel).refreshPanel(true);
+
// // fix dateTreeByAliquot
// ((DefaultTreeModel) ((JTree) dateTreeByAliquot).getModel()).//
// nodeChanged(((TreeNode) node).//
// getParent().//
// getParent().//
// getChildAt(0));
- useriesIsochronPanel.repaint();
} else if (graphPanels_TabbedPane.getSelectedIndex() == graphPanels_TabbedPane.indexOfTab("Weighted Mean")) {
@@ -3769,7 +3935,11 @@ private Vector filterActiveUPbFractions(Vector isochronModels;
+ private boolean automaticIsochronSelection;
/**
* creates a new instance of SampleDateModel
with all of its
@@ -192,6 +193,7 @@ public SampleDateModel() {
//this.unitsForYears = "Ma";
this.isochronModels = new TreeSet<>();
+ this.automaticIsochronSelection = true;
}
/**
@@ -3174,4 +3176,18 @@ public SortedSet getIsochronModels() {
public void setIsochronModels(SortedSet isochronModels) {
this.isochronModels = isochronModels;
}
+
+ /**
+ * @return the automaticIsochronSelection
+ */
+ public boolean isAutomaticIsochronSelection() {
+ return automaticIsochronSelection;
+ }
+
+ /**
+ * @param automaticIsochronSelection the automaticIsochronSelection to set
+ */
+ public void setAutomaticIsochronSelection(boolean automaticIsochronSelection) {
+ this.automaticIsochronSelection = automaticIsochronSelection;
+ }
}
diff --git a/src/main/java/org/earthtime/UTh_Redux/samples/SampleUTh.java b/src/main/java/org/earthtime/UTh_Redux/samples/SampleUTh.java
index 1df956fc..34e1f029 100644
--- a/src/main/java/org/earthtime/UTh_Redux/samples/SampleUTh.java
+++ b/src/main/java/org/earthtime/UTh_Redux/samples/SampleUTh.java
@@ -539,7 +539,9 @@ public static ValueModel generateDefaultSampleDateModel(){
ValueModel defaultSDM = new SampleDateModel();
defaultSDM.setName("DEFAULT");
- ((SampleDateModel)defaultSDM).setIsochronModels(IsochronModel.generateDefaultEvolutionIsochronModels());
+ ((SampleDateModel)defaultSDM).setIsochronModels(
+ IsochronModel.generateDefaultEvolutionIsochronModels());
+ ((SampleDateModel)defaultSDM).setAutomaticIsochronSelection(true);
return defaultSDM;
}
diff --git a/src/main/java/org/earthtime/plots/AbstractDataView.java b/src/main/java/org/earthtime/plots/AbstractDataView.java
index c210fea6..5933769c 100644
--- a/src/main/java/org/earthtime/plots/AbstractDataView.java
+++ b/src/main/java/org/earthtime/plots/AbstractDataView.java
@@ -20,8 +20,10 @@
package org.earthtime.plots;
import Jama.Matrix;
+import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
+import java.awt.Composite;
import java.awt.Cursor;
import java.awt.Font;
import java.awt.Graphics2D;
@@ -58,8 +60,9 @@
*/
public abstract class AbstractDataView extends JLayeredPane implements AliquotDetailsDisplayInterface, MouseInputListener, MouseWheelListener {
- protected static final double ZOOM_FACTOR = 50.0;
+ protected static final double ZOOM_FACTOR = 10.0;
protected static final int minGraphWidthHeight = 100;
+ protected static final int maxGraphWidthHeight = 500;
protected double width;
protected double height;
@@ -141,6 +144,11 @@ public abstract class AbstractDataView extends JLayeredPane implements AliquotDe
// <0 = zoom out, 0 = original, >0 = zoom in
protected int zoomCount;
+ protected String imageMode;
+
+ protected boolean showCenters;
+ protected boolean showLabels;
+
/**
*
*/
@@ -174,6 +182,11 @@ protected AbstractDataView(Rectangle bounds, int leftMargin, int topMargin) {
this.zoomCount = 0;
+ putInImageModePan();
+
+ this.showCenters = true;
+ this.showLabels = false;
+
addMeAsMouseListener();
}
@@ -274,6 +287,7 @@ public void refreshPanel(boolean doReset) {
/**
*
+ * @param doReset
* @param doReScale the value of doReScale
* @param inLiveMode the value of inLiveMode
*/
@@ -288,20 +302,6 @@ protected void drawAxesAndTicks(Graphics2D g2d, double rangeX, double rangeY) {
g2d.setPaint(Color.BLACK);
g2d.setStroke(new BasicStroke(2.0f));
-// // determine the axis ticks
-// BigDecimal[] ticsYaxis = TicGeneratorForAxes.generateTics(getMinY_Display(), getMaxY_Display(), 15);
-//
-// // forced ticsYaxis here temp for evolution
-// ticsYaxis = new BigDecimal[(int) maxY * 4 + 4];
-// for (int i = 0; i < (int) maxY * 4 + 4; i++) {
-// ticsYaxis[i] = new BigDecimal(i * (0.25));
-// }
- // trap for bad plot
- if (ticsYaxis.length <= 1) {
- ticsYaxis = new BigDecimal[0];
- }
- double minXDisplay = 0.0;
- int yAxisTicWidth = 8;
int yTicLabelFrequency = 1;
int labeledTicCountYAxis = 0;
@@ -416,6 +416,71 @@ protected void drawAxesAndTicks(Graphics2D g2d, double rangeX, double rangeY) {
g2d.drawRect(
leftMargin, topMargin, graphWidth - 1, graphHeight - 1);
+
+ // label axes
+ String xAxisLabel = "[230Th/238U]t";//axes[0].getAxisLabel();
+ g2d.setFont(new Font("Monospaced", Font.BOLD, 18));
+ double xAxisLabelLength = calculateLengthOfStringPlot(g2d, xAxisLabel);
+
+ String yAxisLabel = "[234U/238U]t";//axes[1].getAxisLabel();
+ double yAxisLabelLength = calculateLengthOfStringPlot(g2d, yAxisLabel);
+
+ g2d.setFont(new Font("Monospaced", Font.BOLD, 12));
+ g2d.drawString("230",
+ leftMargin + (int) (graphWidth / 2.0) - (int) (xAxisLabelLength / 2.0) + 10,
+ topMargin + (int) graphHeight + 30);
+ g2d.drawString("238",
+ leftMargin + (int) (graphWidth / 2.0) - (int) (xAxisLabelLength / 2.0) + 65,
+ topMargin + (int) graphHeight + 30);
+ g2d.drawString("t",
+ leftMargin + (int) (graphWidth / 2.0) - (int) (xAxisLabelLength / 2.0) + 105,
+ topMargin + (int) graphHeight + 40);
+
+ g2d.setFont(new Font("Monospaced", Font.BOLD, 18));
+ g2d.drawString("[",
+ leftMargin + (int) (graphWidth / 2.0) - (int) (xAxisLabelLength / 2.0),
+ topMargin + (int) graphHeight + 35);
+ g2d.drawString("Th/",
+ leftMargin + (int) (graphWidth / 2.0) - (int) (xAxisLabelLength / 2.0) + 30,
+ topMargin + (int) graphHeight + 35);
+ g2d.drawString("U]",
+ leftMargin + (int) (graphWidth / 2.0) - (int) (xAxisLabelLength / 2.0) + 85,
+ topMargin + (int) graphHeight + 35);
+
+ // y axis
+ g2d.rotate(-Math.PI / 2.0);
+ g2d.setFont(new Font("Monospaced", Font.BOLD, 12));
+ g2d.drawString("234",
+ -(topMargin / 2 + (int) (graphHeight / 2.0) + (int) (yAxisLabelLength / 2.0) - 10),
+ leftMargin - 30);
+ g2d.drawString("238",
+ -(topMargin / 2 + (int) (graphHeight / 2.0) + (int) (yAxisLabelLength / 2.0) - 55),
+ leftMargin - 30);
+ g2d.drawString("t",
+ -(topMargin / 2 + (int) (graphHeight / 2.0) + (int) (yAxisLabelLength / 2.0) - 95),
+ leftMargin - 20);
+
+ g2d.setFont(new Font("Monospaced", Font.BOLD, 18));
+ g2d.drawString("[",
+ -(topMargin / 2 + (int) (graphHeight / 2.0) + (int) (yAxisLabelLength / 2.0)),
+ leftMargin - 25);
+ g2d.drawString("U/",
+ -(topMargin / 2 + (int) (graphHeight / 2.0) + (int) (yAxisLabelLength / 2.0) - 30),
+ leftMargin - 25);
+ g2d.drawString("U]",
+ -(topMargin / 2 + (int) (graphHeight / 2.0) + (int) (yAxisLabelLength / 2.0) - 75),
+ leftMargin - 25);
+
+ g2d.rotate(Math.PI / 2.0);
+ }
+
+ private double calculateLengthOfStringPlot(Graphics2D g2d, String label) {
+ TextLayout mLayout
+ = new TextLayout(
+ label, g2d.getFont(), g2d.getFontRenderContext());
+
+ Rectangle2D bounds = mLayout.getBounds();
+ return bounds.getWidth();
}
/**
@@ -577,19 +642,45 @@ public void mouseReleased(MouseEvent evt) {
int myX = evt.getX();
int myY = evt.getY();
+ if (isInImageModeZoom() //
+ && (zoomMaxX != zoomMinX) //using != provides for legal inverting of zoom box
+ && (zoomMaxY != zoomMinY)) {
+
+ // may 2010 check for bad zooms
+ double zMinX = convertMouseXToValue(Math.min(zoomMinX, zoomMaxX));
+ double zMinY = convertMouseYToValue(Math.max(zoomMinY, zoomMaxY));
+ double zMaxX = convertMouseXToValue(Math.max(zoomMaxX, zoomMinX));
+ double zMaxY = convertMouseYToValue(Math.min(zoomMaxY, zoomMinY));
+
+ if ((zMaxX > zMinX) && (zMaxY > zMinY)) {
+ minX = zMinX;
+ minY = zMinY;
+ maxX = zMaxX;
+ maxY = zMaxY;
+
+ displayOffsetX = 0.0;
+ displayOffsetY = 0.0;
+
+ zoomMaxX = zoomMinX;
+ zoomMaxY = zoomMinY;
+
+ putInImageModePan();
+ }
+ }
+
if (eastResizing ^ southResizing) {
if (eastResizing) {
- this.graphWidth = (myX - leftMargin > minGraphWidthHeight) ? myX - leftMargin : minGraphWidthHeight;
+ this.graphWidth = Math.min(maxGraphWidthHeight, (myX - leftMargin > minGraphWidthHeight) ? myX - leftMargin : minGraphWidthHeight);
} else {
- this.graphHeight = (myY - topMargin > minGraphWidthHeight) ? myY - topMargin : minGraphWidthHeight;
+ this.graphHeight = Math.min(maxGraphWidthHeight, (myY - topMargin > minGraphWidthHeight) ? myY - topMargin : minGraphWidthHeight);
}
- this.setBounds(leftMargin, topMargin, graphWidth, graphHeight);
+ this.setBounds(0, 0, graphWidth + leftMargin * 2, graphHeight + topMargin * 2);
}
if (eastResizing && southResizing) {
- this.graphWidth = (myX - leftMargin > minGraphWidthHeight) ? myX - leftMargin : minGraphWidthHeight;
- this.graphHeight = (myY - topMargin > minGraphWidthHeight) ? myY - topMargin : minGraphWidthHeight;
- this.setBounds(leftMargin, topMargin, graphWidth, graphHeight);
+ this.graphWidth = Math.min(maxGraphWidthHeight, (myX - leftMargin > minGraphWidthHeight) ? myX - leftMargin : minGraphWidthHeight);
+ this.graphHeight = Math.min(maxGraphWidthHeight, (myY - topMargin > minGraphWidthHeight) ? myY - topMargin : minGraphWidthHeight);
+ this.setBounds(0, 0, graphWidth + leftMargin * 2, graphHeight + topMargin * 2);
}
eastResizing = false;
@@ -625,18 +716,20 @@ public void mouseDragged(MouseEvent evt) {
zoomMaxX = evt.getX();
zoomMaxY = evt.getY();
- // prevent all but upper right quadrant
- double calcDisplayOffsetXDelta = convertMouseXToValue(zoomMinX) - convertMouseXToValue(zoomMaxX);
- displayOffsetX += (((minX + displayOffsetX + calcDisplayOffsetXDelta) > 0) ? calcDisplayOffsetXDelta : 0.0);
+ if (isInImageModePan()) {
+ // prevent all but upper right quadrant
+ double calcDisplayOffsetXDelta = convertMouseXToValue(zoomMinX) - convertMouseXToValue(zoomMaxX);
+ displayOffsetX += (((minX + displayOffsetX + calcDisplayOffsetXDelta) > 0) ? calcDisplayOffsetXDelta : 0.0);
- double calcDisplayOffsetYDelta = convertMouseYToValue(zoomMinY) - convertMouseYToValue(zoomMaxY);
- displayOffsetY += (((minY + displayOffsetY + calcDisplayOffsetYDelta) > 0) ? calcDisplayOffsetYDelta : 0.0);
+ double calcDisplayOffsetYDelta = convertMouseYToValue(zoomMinY) - convertMouseYToValue(zoomMaxY);
+ displayOffsetY += (((minY + displayOffsetY + calcDisplayOffsetYDelta) > 0) ? calcDisplayOffsetYDelta : 0.0);
- zoomMinX = zoomMaxX;
- zoomMinY = zoomMaxY;
+ zoomMinX = zoomMaxX;
+ zoomMinY = zoomMaxY;
- ticsYaxis = TicGeneratorForAxes.generateTics(getMinY_Display(), getMaxY_Display(), 10);
- ticsXaxis = TicGeneratorForAxes.generateTics(getMinX_Display(), getMaxX_Display(), 10);
+ ticsYaxis = TicGeneratorForAxes.generateTics(getMinY_Display(), getMaxY_Display(), 10);
+ ticsXaxis = TicGeneratorForAxes.generateTics(getMinX_Display(), getMaxX_Display(), 10);
+ }
repaint();
}
@@ -684,7 +777,9 @@ protected void plotAFraction(
Color centerColor,
float centerSize,
String ellipseLabelFont,
- String ellipseLabelFontSize) {
+ String ellipseLabelFontSize,
+ boolean showCenters,
+ boolean showLabels) {
Path2D ellipse = f.getErrorEllipsePath();
if (svgStyle) {
@@ -692,13 +787,20 @@ protected void plotAFraction(
} else {
// draw ellipse
g2d.setStroke(new BasicStroke(borderWeight));
- g2d.setPaint(borderColor);
+ g2d.setPaint(centerColor);
g2d.draw(ellipse);
+
+ Composite originalComposite = g2d.getComposite();
+ g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f));
+// g2d.setPaint(fillColor);
g2d.fill(ellipse);
+ //restore composite
+ g2d.setComposite(originalComposite);
+// g2d.fill(ellipse);
}
// draw ellipse centers
- if (true) {// (isShowEllipseCenters()) {
+ if (showCenters) {
float centerXbox = (float) (ellipse.getBounds().x + ellipse.getBounds().width / 2.0 - centerSize / 2.0);
float centerYbox = (float) (ellipse.getBounds().y + ellipse.getBounds().height / 2.0 - centerSize / 2.0);
@@ -708,12 +810,12 @@ protected void plotAFraction(
centerYbox,
centerSize,
centerSize);
- g2d.setPaint(centerColor);
+ g2d.setPaint(Color.BLACK);
g2d.setStroke(new BasicStroke(1.0f));
g2d.fill(fractionbox);
}
- if (false) {//(isShowEllipseLabels()) {
+ if (showLabels) {
g2d.setPaint(borderColor);
g2d.setFont(new Font(
ellipseLabelFont,
@@ -742,9 +844,9 @@ protected void generateEllipsePathIII(
ETFractionInterface f,
double ellipseSize) {
- ValueModel xAxisRatio = null;
- ValueModel yAxisRatio = null;
- ValueModel correlationCoefficient = null;
+ ValueModel xAxisRatio;
+ ValueModel yAxisRatio;
+ ValueModel correlationCoefficient;
xAxisRatio = f.getLegacyActivityRatioByName(UThAnalysisMeasures.ar230Th_238Ufc.getName());
yAxisRatio = f.getLegacyActivityRatioByName(UThAnalysisMeasures.ar234U_238Ufc.getName());
@@ -846,4 +948,33 @@ public void setShowFilteredEllipses(boolean showFilteredEllipses) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
+ public boolean isInImageModePan() {
+ return imageMode.compareToIgnoreCase("PAN") == 0;
+ }
+
+ public boolean isInImageModeZoom() {
+ return imageMode.compareToIgnoreCase("ZOOM") == 0;
+ }
+
+ public final void putInImageModePan() {
+ imageMode = "PAN";
+ }
+
+ public void putInImageModeZoom() {
+ imageMode = "ZOOM";
+ }
+
+ /**
+ * @param showCenters the showCenters to set
+ */
+ public void setShowCenters(boolean showCenters) {
+ this.showCenters = showCenters;
+ }
+
+ /**
+ * @param showLabels the showLabels to set
+ */
+ public void setShowLabels(boolean showLabels) {
+ this.showLabels = showLabels;
+ }
}
diff --git a/src/main/java/org/earthtime/plots/evolution/EvolutionPlotPanelII.java b/src/main/java/org/earthtime/plots/evolution/EvolutionPlotPanelII.java
index 4fa958df..6c462879 100644
--- a/src/main/java/org/earthtime/plots/evolution/EvolutionPlotPanelII.java
+++ b/src/main/java/org/earthtime/plots/evolution/EvolutionPlotPanelII.java
@@ -27,27 +27,45 @@
import java.awt.event.MouseWheelEvent;
import java.awt.geom.CubicCurve2D;
import java.awt.geom.Path2D;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
import java.math.BigDecimal;
import java.math.RoundingMode;
+import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.SortedSet;
import java.util.Vector;
+import org.apache.batik.apps.rasterizer.SVGConverter;
+import org.apache.batik.apps.rasterizer.SVGConverterException;
+import org.apache.batik.dom.GenericDOMImplementation;
+import org.apache.batik.svggen.SVGGraphics2D;
+import org.apache.batik.svggen.SVGGraphics2DIOException;
+import org.earthtime.UPb_Redux.dateInterpretation.concordia.PlottingDetailsDisplayInterface;
import org.earthtime.UPb_Redux.valueModels.SampleDateModel;
+import org.earthtime.UPb_Redux.valueModels.ValueModel;
import org.earthtime.dataDictionaries.UThAnalysisMeasures;
import org.earthtime.fractions.ETFractionInterface;
import org.earthtime.plots.AbstractDataView;
+import org.earthtime.plots.PlotAxesSetupInterface;
import org.earthtime.plots.isochrons.IsochronModel;
import org.earthtime.reportViews.ReportUpdaterInterface;
import org.earthtime.samples.SampleInterface;
import org.earthtime.utilities.TicGeneratorForAxes;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
/**
*
* @author James F. Bowring
*/
-public final class EvolutionPlotPanelII extends AbstractDataView {
+public final class EvolutionPlotPanelII extends AbstractDataView implements PlottingDetailsDisplayInterface {
protected transient ReportUpdaterInterface reportUpdater;
@@ -67,12 +85,12 @@ public final class EvolutionPlotPanelII extends AbstractDataView {
public EvolutionPlotPanelII(SampleInterface mySample, ReportUpdaterInterface reportUpdater) {
super();
- this.leftMargin = 100;
- this.topMargin = 100;
+ this.leftMargin = 50;
+ this.topMargin = 50;
this.graphWidth = 500;
this.graphHeight = 500;
- this.setBounds(leftMargin, topMargin, graphWidth, graphHeight);
+ this.setBounds(0, 0, graphWidth + leftMargin * 2, graphHeight + topMargin * 2);
setOpaque(true);
@@ -93,6 +111,19 @@ public EvolutionPlotPanelII(SampleInterface mySample, ReportUpdaterInterface rep
this.xy = new double[0][0][0];
this.dardt = new double[0][0][0];
+ this.ticsYaxis = new BigDecimal[0];
+ this.ticsXaxis = new BigDecimal[0];
+
+ this.eastResizing = false;
+ this.southResizing = false;
+
+ this.zoomCount = 0;
+
+ putInImageModePan();
+
+ this.showCenters = true;
+ this.showLabels = false;
+
addMouseListener(this);
addMouseMotionListener(this);
addMouseWheelListener(this);
@@ -109,9 +140,12 @@ public void paintComponent(Graphics g) {
public void paint(Graphics2D g2d, boolean svgStyle) {
paintInit(g2d);
- g2d.setPaint(Color.black);
+ //draw component border
+ g2d.setPaint(Color.blue);
+ g2d.drawRect(0, 0, (int) graphWidth + leftMargin * 2 - 1, (int) graphHeight + topMargin * 2 - 1);
- // draw border
+ // draw graph border
+ g2d.setPaint(Color.black);
g2d.drawRect(leftMargin, topMargin, (int) graphWidth, (int) graphHeight);
// draw isochrons
@@ -131,7 +165,8 @@ public void paint(Graphics2D g2d, boolean svgStyle) {
mapX(getMaxX_Display()), //
mapY(yItercepts[i] + slopes[i] * getMaxX_Display()));
- if (i == (annumIsochrons.length - 1)) {
+ if ((i == (annumIsochrons.length - 1))
+ && annumIsochrons[i] >= 10e10) {
g2d.setPaint(Color.black);
}
g2d.draw(isochronLine);
@@ -148,7 +183,7 @@ public void paint(Graphics2D g2d, boolean svgStyle) {
lowIndex = index;
}
if (ar48icntrs[index] < getMaxY_Display()) {
- highIndex = Math.min(ar48icntrs.length - 1, index + 6 + (zoomCount / 25) * 1);
+ highIndex = Math.min(ar48icntrs.length - 1, index + 6 + (zoomCount / 10) * 1);
}
}
for (int i = lowIndex; i < highIndex; i++) {
@@ -168,11 +203,12 @@ public void paint(Graphics2D g2d, boolean svgStyle) {
g2d.draw(ar48iContour);
+ DecimalFormat myFormatter = new DecimalFormat("#.##");
if (!labelPrinted && (xy[i][0][j - 1] > getMinX_Display()) && (ar48icntrs[i] > 0.0)) {
double angleOfText = (Math.atan(xy[i][1][j - 1] - xy[i][1][j]) / (xy[i][0][j - 1] - xy[i][0][j]));
// System.out.println(ar48icntrs[i] + " > " + angleOfText);
g2d.rotate(-angleOfText, leftMargin + 20, mapY(xy[i][1][j - 1]));
- g2d.drawString(String.valueOf(ar48icntrs[i]), leftMargin + 10, (float) mapY(xy[i][1][j - 1]) - 5);
+ g2d.drawString(myFormatter.format(ar48icntrs[i]), leftMargin + 10, (float) mapY(xy[i][1][j - 1]) - 5);
g2d.rotate(angleOfText, leftMargin + 20, mapY(xy[i][1][j - 1]));
labelPrinted = true;
}
@@ -189,19 +225,23 @@ public void paint(Graphics2D g2d, boolean svgStyle) {
String ellipseLabelFontSize = "12";
for (ETFractionInterface f : selectedFractions) {
- generateEllipsePathIII(//
- f,
- 2.0f);
- if (f.getErrorEllipsePath() != null) {
- plotAFraction(g2d,
- svgStyle,
+ if (!f.isRejected()) {
+ generateEllipsePathIII(//
f,
- includedBorderColor,
- 0.5f,
- includedCenterColor,
- includedCenterSize,
- ellipseLabelFont,
- ellipseLabelFontSize);
+ 2.0f);
+ if (f.getErrorEllipsePath() != null) {
+ plotAFraction(g2d,
+ svgStyle,
+ f,
+ includedBorderColor,
+ 0.5f,
+ includedCenterColor,
+ includedCenterSize,
+ ellipseLabelFont,
+ ellipseLabelFontSize,
+ showCenters,
+ showLabels);
+ }
}
}
@@ -244,36 +284,53 @@ public void paint(Graphics2D g2d, boolean svgStyle) {
(float) mapY(yItercepts[i] + slopes[i] * (labelX)));
}
}
+
+ // draw zoom box if in use
+ if (isInImageModeZoom()
+ && (Math.abs(zoomMaxX - zoomMinX) * Math.abs(zoomMinY - zoomMaxY)) > 0) {
+ g2d.setStroke(new BasicStroke(2.0f));
+ g2d.setColor(Color.red);
+ g2d.drawRect(//
+ Math.min(zoomMinX, zoomMaxX),
+ Math.min(zoomMaxY, zoomMinY),
+ Math.abs(zoomMaxX - zoomMinX),
+ Math.abs(zoomMinY - zoomMaxY));
+ }
}
@Override
public void preparePanel(boolean doReset) {
if (doReset) {
- zoomMaxX = 0;
- zoomMaxY = 0;
- zoomMinX = 0;
- zoomMinY = 0;
-
- displayOffsetX = 0.0;
- displayOffsetY = 0.0;
removeAll();
- minX = 0.0;
- minY = 0.0;
-
maxX = (xAxisMax == 0) ? 1.5 : xAxisMax;
xAxisMax = maxX;
maxY = (yAxisMax == 0) ? 2.0 : yAxisMax;
yAxisMax = maxY;
- // determine default zoom
- //todo: fix logic
- minX = Double.MAX_VALUE;
- maxX = -Double.MAX_VALUE;
- minY = Double.MAX_VALUE;
- maxY = -Double.MAX_VALUE;
- for (ETFractionInterface f : selectedFractions) {
+ showTight();
+ }
+
+ putInImageModePan();
+ repaint();
+ }
+
+ public void showTight() {
+ // determine default zoom
+ zoomMaxX = 0;
+ zoomMaxY = 0;
+ zoomMinX = 0;
+ zoomMinY = 0;
+
+ displayOffsetX = 0.0;
+ displayOffsetY = 0.0;
+ minX = Double.MAX_VALUE;
+ maxX = -Double.MAX_VALUE;
+ minY = Double.MAX_VALUE;
+ maxY = -Double.MAX_VALUE;
+ for (ETFractionInterface f : selectedFractions) {
+ if (!f.isRejected()) {
double xAxisRatio = f.getLegacyActivityRatioByName(UThAnalysisMeasures.ar230Th_238Ufc.getName()).getValue().doubleValue();
double xAxis2Sigma = f.getLegacyActivityRatioByName(UThAnalysisMeasures.ar230Th_238Ufc.getName()).getTwoSigmaAbs().doubleValue();
@@ -285,44 +342,77 @@ public void preparePanel(boolean doReset) {
minY = Math.min(minY, yAxisRatio - 2.0 * yAxis2Sigma);
maxY = Math.max(maxY, yAxisRatio + 2.0 * yAxis2Sigma);
}
+ }
- // maintain 2/1.5 aspect ratio
- if (getRangeY_Display() / getRangeX_Display() < 2.0 / 1.5) {
- // increase Y
- double yDelta = (2.0 / 1.5) * getRangeX_Display() - getRangeY_Display();
- minY -= yDelta / 2.0;
- maxY += yDelta / 2.0;
+ // maintain 2/1.5 aspect ratio
+ if (getRangeY_Display() / getRangeX_Display() < 2.0 / 1.5) {
+ // increase Y
+ double yDelta = (2.0 / 1.5) * getRangeX_Display() - getRangeY_Display();
+ minY -= yDelta / 2.0;
+ maxY += yDelta / 2.0;
+
+ zoomCount = (int) Math.min(10.0, 10.0 / getRangeY_Display());
+ } else {
+ // increase x
+ double xDelta = (1.5 / 2.0) * getRangeY_Display() - getRangeX_Display();
+ minX -= xDelta / 2.0;
+ maxX += xDelta / 2.0;
+
+ zoomCount = (int) Math.min(10.0, 10.0 / getRangeX_Display());
+ }
- zoomCount = (int) Math.min(100.0, 10.0 / getRangeY_Display());
- } else {
- // increase x
- double xDelta = (1.5 / 2.0) * getRangeY_Display() - getRangeX_Display();
- minX -= xDelta / 2.0;
- maxX += xDelta / 2.0;
+ buildIsochronsAndContours();
- zoomCount = (int) Math.min(100.0, 10.0 / getRangeX_Display());
- }
+ ticsYaxis = TicGeneratorForAxes.generateTics(getMinY_Display(), getMaxY_Display(), 10);
+ ticsXaxis = TicGeneratorForAxes.generateTics(getMinX_Display(), getMaxX_Display(), 10);
- buildIsochronsAndContours();
- repaint();
- validate();
+ repaint();
+ validate();
- ticsYaxis = TicGeneratorForAxes.generateTics(getMinY_Display(), getMaxY_Display(), 10);
- ticsXaxis = TicGeneratorForAxes.generateTics(getMinX_Display(), getMaxX_Display(), 10);
- }
+ }
+
+ public void showLoose() {
+ // determine default zoom
+ zoomMaxX = 0;
+ zoomMaxY = 0;
+ zoomMinX = 0;
+ zoomMinY = 0;
+
+ displayOffsetX = 0.0;
+ displayOffsetY = 0.0;
+
+ zoomCount = 0;
+
+ minX = 0.0;
+ maxX = 1.5;
+ xAxisMax = maxX;
+
+ minY = 0.0;
+ maxY = 2.0;
+ yAxisMax = maxY;
+
+ buildIsochronsAndContours();
+
+ ticsYaxis = TicGeneratorForAxes.generateTics(getMinY_Display(), getMaxY_Display(), 10);
+ ticsXaxis = TicGeneratorForAxes.generateTics(getMinX_Display(), getMaxX_Display(), 10);
repaint();
+ validate();
}
- private void buildIsochronsAndContours() {
+ public void buildIsochronsAndContours() {
// math adapted from Noah's matlab code
-
- SortedSet selectedIsochrons = ((SampleDateModel) sample.getSampleDateModelByName("DEFAULT")).getIsochronModels();
+ ValueModel sampleDateModel = ((SampleDateModel) sample.getSampleDateModelByName("DEFAULT"));
+ SortedSet selectedIsochrons = ((SampleDateModel) sampleDateModel).getIsochronModels();
List annumList = new ArrayList<>();
Iterator isochronIterator = selectedIsochrons.iterator();
while (isochronIterator.hasNext()) {
IsochronModel isochronModel = isochronIterator.next();
- isochronModel.setVisible(isochronModel.getDensityLevel()<= (zoomCount / 25));
+ if (((SampleDateModel) sampleDateModel).isAutomaticIsochronSelection()) {
+ isochronModel.setVisible(
+ (zoomCount >= 0) ? (isochronModel.getDensityLevel() <= (zoomCount / 4))
+ : (isochronModel.getDensityLevel() == 0));
+ }
if (isochronModel.isVisible()) {
annumList.add(isochronModel.getDateInAnnum());
}
@@ -339,7 +429,7 @@ private void buildIsochronsAndContours() {
// if (zoomCount >= 50) {
// annumIsochrons = new double[]{25.0e3, 50.0e3, 75.0e3, 85.0e3, 100.0e3, 115.0e3, 130.0e3, 140.0e3, 150.0e3, 160.0e3, 180.0e3, 200.0e3, 225.0e3, 250.0e3, 275.0e3, 300.0e3, 350.0e3, 400.0e3, 500.0e3, 10e16}; // plotted isochrons
// }
- int init48Density = (int) Math.pow(2, (2 + zoomCount / 25));
+ int init48Density = (int) Math.pow(2, (2 + zoomCount / 10));
ar48icntrs = new double[(int) maxY * init48Density + init48Density + 1];
for (int i = 0; i < ar48icntrs.length; i++) {
ar48icntrs[i] = i * (double) (1.0 / (double) init48Density);
@@ -574,54 +664,146 @@ public void mouseWheelMoved(MouseWheelEvent e) {
zoomMaxX = e.getX();
zoomMaxY = e.getY();
- int notches = e.getWheelRotation();
- if (notches < 0) {// zoom in
- minX += getRangeX_Display() / ZOOM_FACTOR;
- maxX -= getRangeX_Display() / ZOOM_FACTOR;
- minY += getRangeY_Display() / ZOOM_FACTOR;
- maxY -= getRangeY_Display() / ZOOM_FACTOR;
-
- zoomCount++;
-
- } else {// zoom out
- minX -= getRangeX_Display() / ZOOM_FACTOR;
- minX = Math.max(minX, 0.0);
-
- minY -= getRangeY_Display() / ZOOM_FACTOR;
- minY = Math.max(minY, 0.0);
-
- zoomCount--;
- // stop zoom out
- if (minX * minY > 0.0) {
- maxX += getRangeX_Display() / ZOOM_FACTOR;
- maxY += getRangeY_Display() / ZOOM_FACTOR;
+ // https://java.com/en/download/faq/release_changes.xml
+ double notches = e.getPreciseWheelRotation();
+ if (notches == Math.rint(notches)) {
+ if (notches < 0) {// zoom in
+ minX += getRangeX_Display() / ZOOM_FACTOR;
+ maxX -= getRangeX_Display() / ZOOM_FACTOR;
+ minY += getRangeY_Display() / ZOOM_FACTOR;
+ maxY -= getRangeY_Display() / ZOOM_FACTOR;
+
+ zoomCount++;
+
+ } else {// zoom out
+ minX -= getRangeX_Display() / ZOOM_FACTOR;
+ minX = Math.max(minX, 0.0);
+
+ minY -= getRangeY_Display() / ZOOM_FACTOR;
+ minY = Math.max(minY, 0.0);
+
+ zoomCount--;
+ // stop zoom out
+ if (minX * minY > 0.0) {
+ maxX += getRangeX_Display() / ZOOM_FACTOR;
+ maxY += getRangeY_Display() / ZOOM_FACTOR;
+
+ } else {
+ minX = 0.0;
+ maxX = xAxisMax;
+ minY = 0.0;
+ maxY = yAxisMax;
+ zoomCount = 0;
+ }
+ }
- } else {
+ if (minX <= 0.0) {
minX = 0.0;
- maxX = xAxisMax;
+ displayOffsetX = 0.0;
+ }
+ if (minY <= 0.0) {
minY = 0.0;
- maxY = yAxisMax;
- zoomCount = 0;
+ displayOffsetY = 0.0;
}
- }
- if (minX <= 0.0) {
- minX = 0.0;
- displayOffsetX = 0.0;
- }
- if (minY <= 0.0) {
- minY = 0.0;
- displayOffsetY = 0.0;
+ zoomMinX = zoomMaxX;
+ zoomMinY = zoomMaxY;
+
+ buildIsochronsAndContours();
+ ticsYaxis = TicGeneratorForAxes.generateTics(getMinY_Display(), getMaxY_Display(), 10);
+ ticsXaxis = TicGeneratorForAxes.generateTics(getMinX_Display(), getMaxX_Display(), 10);
+
+ repaint();
}
+ }
+ }
+
+ /**
+ *
+ * @param file
+ */
+ public void outputToSVG(File file) {
+
+ // Get a DOMImplementation.
+ DOMImplementation domImpl
+ = GenericDOMImplementation.getDOMImplementation();
+
+ // Create an instance of org.w3c.dom.Document.
+ String svgNS = "http://www.w3.org/2000/svg";
+ Document document = domImpl.createDocument(svgNS, "svg", null);
+
+ // Create an instance of the SVG Generator.
+ SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
+
+ // Ask the test to render into the SVG Graphics2D implementation.
+ paint(svgGenerator, false);
+
+ // Finally, stream out SVG to the standard output using
+ // UTF-8 encoding.
+ boolean useCSS = true; // we want to use CSS style attributes
+
+ Writer out = null;
+ try {
+ out = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
+ } catch (FileNotFoundException | UnsupportedEncodingException fileNotFoundException) {
+ }
+ try {
+ svgGenerator.stream(out, useCSS);
+ } catch (SVGGraphics2DIOException sVGGraphics2DIOException) {
+ }
+ }
+
+ /**
+ *
+ * @param file
+ */
+ public void outputToPDF(File file) {
+ SVGConverter myConv = new SVGConverter();
+ myConv.setDestinationType(org.apache.batik.apps.rasterizer.DestinationType.PDF);
+ try {
+ myConv.setSources(new String[]{file.getCanonicalPath()});
- zoomMinX = zoomMaxX;
- zoomMinY = zoomMaxY;
+ } catch (IOException iOException) {
+ }
+ myConv.setWidth((float) getWidth() + 2);
+ myConv.setHeight((float) getHeight() + 2);
- buildIsochronsAndContours();
- ticsYaxis = TicGeneratorForAxes.generateTics(getMinY_Display(), getMaxY_Display(), 10);
- ticsXaxis = TicGeneratorForAxes.generateTics(getMinX_Display(), getMaxX_Display(), 10);
+ try {
+ myConv.execute();
- repaint();
+ } catch (SVGConverterException sVGConverterException) {
+ System.out.println("Error in pdf conversion: " + sVGConverterException.getMessage());
}
+
+ }
+
+ @Override
+ public void preparePanel(boolean doReScale, boolean inLiveMode) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public void refreshPanel(boolean doReScale, boolean inLiveMode) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public void resetPanel(boolean doReScale, boolean inLiveMode) {
+ refreshPanel(doReScale);
+ }
+
+ @Override
+ public void setShowTightToEdges(boolean showTightToEdges) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public void performZoom(double factor) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public PlotAxesSetupInterface getCurrentPlotAxesSetup() {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
diff --git a/src/main/java/org/earthtime/plots/isochrons/IsochronModel.java b/src/main/java/org/earthtime/plots/isochrons/IsochronModel.java
index e70ed00e..40267e98 100644
--- a/src/main/java/org/earthtime/plots/isochrons/IsochronModel.java
+++ b/src/main/java/org/earthtime/plots/isochrons/IsochronModel.java
@@ -99,6 +99,23 @@ public String prettyPrintI() {
String retVal = new BigDecimal(dateInAnnum)
.movePointRight(ReduxConstants.getUnitConversionMoveCount(units))
.setScale(0).toPlainString() + " " + units;
+
+ if (dateInAnnum >= 10e10){
+ retVal = " \u221E" + " " + units;
+ }
+
+ return retVal;
+ }
+
+ public String prettyPrintINoUnits() {
+ String retVal = new BigDecimal(dateInAnnum)
+ .movePointRight(ReduxConstants.getUnitConversionMoveCount(units))
+ .setScale(0).toPlainString();
+
+ if (dateInAnnum >= 10e10){
+ retVal = " \u221E" + " " + units;
+ }
+
return retVal;
}
diff --git a/src/main/java/org/earthtime/plots/isochrons/evolution/IsochronsEvolutionSelectorDialog.form b/src/main/java/org/earthtime/plots/isochrons/evolution/IsochronsEvolutionSelectorDialog.form
index 3e0375d8..a66c463b 100644
--- a/src/main/java/org/earthtime/plots/isochrons/evolution/IsochronsEvolutionSelectorDialog.form
+++ b/src/main/java/org/earthtime/plots/isochrons/evolution/IsochronsEvolutionSelectorDialog.form
@@ -3,7 +3,7 @@