diff --git a/pom.xml b/pom.xml
index de32c279..82977bd6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -237,7 +237,7 @@
com.github.bowring
Calamari
- v1.0.5
+ -SNAPSHOT
diff --git a/src/main/java/org/earthtime/ETReduxFrame.java b/src/main/java/org/earthtime/ETReduxFrame.java
index 8f1f8e2c..36aea57c 100644
--- a/src/main/java/org/earthtime/ETReduxFrame.java
+++ b/src/main/java/org/earthtime/ETReduxFrame.java
@@ -1456,7 +1456,7 @@ private void customizeReduxSkin() {
public void rebuildFractionDisplays(boolean performReduction, boolean inLiveMode) {
((TabbedReportViews) getReportTableTabbedPane()).setSample(theSample);
- updateReportTable(performReduction, inLiveMode);
+ updateReportTable(performReduction, inLiveMode, "");
}
/**
@@ -1464,16 +1464,17 @@ public void rebuildFractionDisplays(boolean performReduction, boolean inLiveMode
*/
@Override
public void updateReportTable() {
- updateReportTable(false, false);
+ updateReportTable(false, false, "");
}
/**
*
* @param performReduction
* @param inLiveMode the value of inLiveMode
+ * @param fractionIdToFocus the value of fractionIdToFocus
*/
@Override
- public void updateReportTable(boolean performReduction, boolean inLiveMode) {
+ public void updateReportTable(boolean performReduction, boolean inLiveMode, String fractionIdToFocus) {
// march 2013
try {
UPbFractionReducer.getInstance().setSessionCorrectedUnknownsSummaries(//
@@ -1485,7 +1486,7 @@ public void updateReportTable(boolean performReduction, boolean inLiveMode) {
theSample.reduceSampleData(inLiveMode);
}
- loadAndShowReportTableData();
+ loadAndShowReportTableData(fractionIdToFocus);
// oct 2014
// this statement makes a difference if user went back to project manager and changed things
@@ -1502,9 +1503,10 @@ public void updateReportTable(boolean performReduction, boolean inLiveMode) {
/**
*
+ * @param fractionIdToFocus the value of fractionIdToFocus
*/
@Override
- public void loadAndShowReportTableData() {
+ public void loadAndShowReportTableData(String fractionIdToFocus) {
((TabbedReportViews) getReportTableTabbedPane()).prepareTabs();
}
@@ -3501,7 +3503,7 @@ private void LAICPMS_LegacyAnalysis_MC_UA_menuItemActionPerformed(java.awt.event
}//GEN-LAST:event_LAICPMS_LegacyAnalysis_MC_UA_menuItemActionPerformed
private void reduceAll_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reduceAll_buttonActionPerformed
- updateReportTable(true, false);
+ updateReportTable(true, false, "");
}//GEN-LAST:event_reduceAll_buttonActionPerformed
private void reportResultsTableAsStringsInExcel_menuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reportResultsTableAsStringsInExcel_menuItemActionPerformed
@@ -3512,14 +3514,14 @@ private void loadReportSettingsModelFromLocalXMLFileActionPerformed(java.awt.eve
myState.setMRUReportSettingsModelFolder(//
setReportSettingsModelFromXMLFile(myState.getMRUReportSettingsModelFolder()));
- updateReportTable(false, false);
+ updateReportTable(false, false, "");
}//GEN-LAST:event_loadReportSettingsModelFromLocalXMLFileActionPerformed
private void editCurrentReportSettingsModel_menuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editCurrentReportSettingsModel_menuItemActionPerformed
ReportSettingsInterface.EditReportSettings(theSample.getReportSettingsModel(), this);
- updateReportTable(false, false);
+ updateReportTable(false, false, "");
}//GEN-LAST:event_editCurrentReportSettingsModel_menuItemActionPerformed
private void reportResultsTableAsPDF_menuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reportResultsTableAsPDF_menuItemActionPerformed
@@ -3892,12 +3894,12 @@ private void updateData_buttonActionPerformed(java.awt.event.ActionEvent evt) {/
private void selectAllFractions_menuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectAllFractions_menuItemActionPerformed
theSample.selectAllFractions();
- updateReportTable(false, false);
+ updateReportTable(false, false, "");
}//GEN-LAST:event_selectAllFractions_menuItemActionPerformed
private void deSelectAllFractions_menuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deSelectAllFractions_menuItemActionPerformed
theSample.deSelectAllFractions();
- updateReportTable(false, false);
+ updateReportTable(false, false, "");
}//GEN-LAST:event_deSelectAllFractions_menuItemActionPerformed
private void credits_menuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_credits_menuItemActionPerformed
@@ -3916,7 +3918,7 @@ private void saveCurrentReportSettingsModelAsLocalXMLFileActionPerformed(java.aw
private void loadDefaultReportSettingsModelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadDefaultReportSettingsModelActionPerformed
theSample.restoreDefaultReportSettingsModel();
theSample.setLegacyStatusForReportTable();
- updateReportTable(false, false);
+ updateReportTable(false, false, "");
}//GEN-LAST:event_loadDefaultReportSettingsModelActionPerformed
private void writeCSVFileOfLAICPMSLegacyDataSampleFieldNames_SC_WSU_vBActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_writeCSVFileOfLAICPMSLegacyDataSampleFieldNames_SC_WSU_vBActionPerformed
@@ -4023,7 +4025,7 @@ private void saveCurrentReportSettingsAsDefault_menuItemActionPerformed ( java.a
private void loadEARTHTIMEDefaultReportSettingsModel_menuItemActionPerformed ( java.awt.event.ActionEvent evt ) {//GEN-FIRST:event_loadEARTHTIMEDefaultReportSettingsModel_menuItemActionPerformed
SampleInterface.loadDefaultEARTHTIMEReportSettingsModel(theSample);
theSample.setLegacyStatusForReportTable();
- updateReportTable(false, false);
+ updateReportTable(false, false, "");
}//GEN-LAST:event_loadEARTHTIMEDefaultReportSettingsModel_menuItemActionPerformed
private void exit_menuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exit_menuItemActionPerformed
diff --git a/src/main/java/org/earthtime/Tripoli/dataModels/RawIntensityDataModel.java b/src/main/java/org/earthtime/Tripoli/dataModels/RawIntensityDataModel.java
index c26d6ce6..2751d8b0 100644
--- a/src/main/java/org/earthtime/Tripoli/dataModels/RawIntensityDataModel.java
+++ b/src/main/java/org/earthtime/Tripoli/dataModels/RawIntensityDataModel.java
@@ -107,6 +107,7 @@ public class RawIntensityDataModel //
private int peakWidth;
private int backgroundRightShade;
private int backgroundWidth;
+ private int timeToNextTimeZero;
/**
*
@@ -1348,4 +1349,18 @@ public int getBackgroundWidth() {
public void setBackgroundWidth(int backgroundWidth) {
this.backgroundWidth = backgroundWidth;
}
+
+ /**
+ * @return the timeToNextTimeZero
+ */
+ public int getTimeToNextTimeZero() {
+ return timeToNextTimeZero;
+ }
+
+ /**
+ * @param timeToNextTimeZero the timeToNextTimeZero to set
+ */
+ public void setTimeToNextTimeZero(int timeToNextTimeZero) {
+ this.timeToNextTimeZero = timeToNextTimeZero;
+ }
}
diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/AbstractRawDataView.java b/src/main/java/org/earthtime/Tripoli/dataViews/AbstractRawDataView.java
index a35403c3..1eb1eb72 100644
--- a/src/main/java/org/earthtime/Tripoli/dataViews/AbstractRawDataView.java
+++ b/src/main/java/org/earthtime/Tripoli/dataViews/AbstractRawDataView.java
@@ -1173,7 +1173,7 @@ public void updateReportTableView() {
if (uPbReduxFrame == null) {
uPbReduxFrame = ((AbstractRawDataView) sampleSessionDataView).getuPbReduxFrame();
}
- uPbReduxFrame.updateReportTable(true, false);
+ uPbReduxFrame.updateReportTable(true, false, "");
}
diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/dataMonitorViews/AbstractDataMonitorView.java b/src/main/java/org/earthtime/Tripoli/dataViews/dataMonitorViews/AbstractDataMonitorView.java
index 46e57619..c2b3ca60 100644
--- a/src/main/java/org/earthtime/Tripoli/dataViews/dataMonitorViews/AbstractDataMonitorView.java
+++ b/src/main/java/org/earthtime/Tripoli/dataViews/dataMonitorViews/AbstractDataMonitorView.java
@@ -39,6 +39,7 @@
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.Iterator;
import java.util.Map;
import java.util.SortedSet;
@@ -52,12 +53,15 @@
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
import javax.swing.JProgressBar;
+import javax.swing.JRootPane;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.SwingWorker;
import javax.swing.Timer;
+import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.WindowConstants;
+import javax.swing.border.LineBorder;
import javax.swing.tree.DefaultMutableTreeNode;
import org.earthtime.ETReduxFrame;
import org.earthtime.Tripoli.dataModels.DataModelInterface;
@@ -98,6 +102,7 @@
import org.earthtime.projects.ProjectInterface;
import org.earthtime.ratioDataModels.AbstractRatiosDataModel;
import org.earthtime.reduxLabData.ReduxLabData;
+import org.earthtime.reportViews.ReportAliquotFractionsView;
import org.earthtime.reportViews.TabbedReportViews;
import org.earthtime.reports.ReportSettingsInterface;
import org.earthtime.samples.SampleInterface;
@@ -183,6 +188,7 @@ public class AbstractDataMonitorView extends AbstractRawDataView
private static JProgressBar loadDataTaskProgressBar;
private static JTextArea rawDataFilePathTextArea;
+ private static JLabel mostRecentFractionData;
private final static int pdfWidth = 625;
private final static int pdfHeight = 575;
@@ -224,7 +230,7 @@ public AbstractDataMonitorView(ProjectInterface myProject, ProjectManagerSubscri
saveMonitoredTime = 0L;
tripoliFractions = new TreeSet<>();
- parentDimension = new Dimension(2050, 1250);
+ parentDimension = new Dimension(2050, 1275);
initView();
}
@@ -242,6 +248,8 @@ private void initView() {
progressBarFactory();
+ showMostRecentFractionLabelFactory();
+
dataMonitorTimer = new Timer(2500, (ActionEvent e) -> {
monitorDataFile();
});
@@ -282,7 +290,11 @@ private void fireLoadDataTask() {
//loadAndShowRawData(rawDataFileHandler.getAcquisitionModel().isUsingFullPropagation(), 0);
}
- private void updateDisplays() {
+ /**
+ *
+ * @param fractionIdToFocus the value of fractionIdToFocus
+ */
+ private void updateDisplays(String fractionIdToFocus) {
// need to decide when to fit sessions
// initially let's just show the standards
@@ -305,7 +317,7 @@ private void updateDisplays() {
}
try {
- getuPbReduxFrame().updateReportTable(true, true);
+ getuPbReduxFrame().updateReportTable(true, true, fractionIdToFocus);
} catch (Exception e) {
}
@@ -413,9 +425,11 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
((TabbedReportViews) reportTableTabbedPane).initializeTabs();
((TabbedReportViews) reportTableTabbedPane).prepareTabs();
- reportTableTabbedPane.setBounds(leftMargin, topMargin + 705, 1900, 500);
+ reportTableTabbedPane.setBounds(leftMargin, topMargin + 705, 1930, 500);
this.add(reportTableTabbedPane, LAYER_FIVE);
+ this.add(mostRecentFractionData);
+
}
private void rawDataFilePathTextFactory() throws IOException {
@@ -431,9 +445,20 @@ private void rawDataFilePathTextFactory() throws IOException {
this.add(rawDataFilePathTextArea, JLayeredPane.DEFAULT_LAYER);
}
+ private void showMostRecentFractionLabelFactory() {
+ // show rawdatafile path
+ mostRecentFractionData = new JLabel("Most Recent");
+
+ mostRecentFractionData.setBounds(leftMargin + 25, topMargin + 647, 500, 22);
+ mostRecentFractionData.setBorder(new LineBorder(Color.black));
+
+ mostRecentFractionData.setForeground(Color.blue);
+ this.add(mostRecentFractionData, JLayeredPane.DEFAULT_LAYER);
+ }
+
private void buttonFactory() {
ET_JButton closeAndReviewButton = new ET_JButton("Halt Processing and Review Samples");
- closeAndReviewButton.setBounds(leftMargin + 0, topMargin + 660, 450, 25);
+ closeAndReviewButton.setBounds(leftMargin + 0, topMargin + 670, 450, 22);
closeAndReviewButton.addActionListener((ActionEvent ae) -> {
try {
loadDataTask.cancel(true);
@@ -449,7 +474,7 @@ private void buttonFactory() {
this.add(closeAndReviewButton, LAYER_FIVE);
ET_JButton recalcButton = new ET_JButton("Update Sessions");
- recalcButton.setBounds(leftMargin + 450, topMargin + 660, 120, 25);
+ recalcButton.setBounds(leftMargin + 450, topMargin + 670, 120, 22);
recalcButton.addActionListener((ActionEvent ae) -> {
try {
tripoliSession.resetAllUPbFractionReduction();
@@ -458,7 +483,7 @@ private void buttonFactory() {
} catch (Exception e) {
}
try {
- getuPbReduxFrame().updateReportTable(true, true);
+ getuPbReduxFrame().updateReportTable(true, true, "");
} catch (Exception e) {
}
preparePanel(true, true);
@@ -468,7 +493,7 @@ private void buttonFactory() {
this.add(recalcButton, LAYER_FIVE);
ET_JButton refreshButton = new ET_JButton("Refresh Views");
- refreshButton.setBounds(leftMargin + 570, topMargin + 660, 120, 25);
+ refreshButton.setBounds(leftMargin + 570, topMargin + 670, 120, 22);
refreshButton.addActionListener((ActionEvent ae) -> {
preparePanel(true, false);
});
@@ -477,10 +502,10 @@ private void buttonFactory() {
this.add(refreshButton, LAYER_FIVE);
ET_JButton editReportSettingsButton = new ET_JButton("Edit Report Settings");
- editReportSettingsButton.setBounds(602, topMargin + 600, 120, 25);
+ editReportSettingsButton.setBounds(602, topMargin + 600, 120, 22);
editReportSettingsButton.addActionListener((ActionEvent ae) -> {
ReportSettingsInterface.EditReportSettings(project.getSuperSample().getReportSettingsModel(), uPbReduxFrame);
- uPbReduxFrame.updateReportTable(false, true);
+ uPbReduxFrame.updateReportTable(false, true, "");
((TabbedReportViews) reportTableTabbedPane).prepareTabs();
});
@@ -488,7 +513,7 @@ private void buttonFactory() {
this.add(editReportSettingsButton, LAYER_FIVE);
ET_JButton concordiaSettingsButton = new ET_JButton("Concordia Settings");
- concordiaSettingsButton.setBounds(602, topMargin + 550, 120, 25);
+ concordiaSettingsButton.setBounds(602, topMargin + 550, 120, 22);
concordiaSettingsButton.addActionListener((ActionEvent ae) -> {
((AliquotDetailsDisplayInterface) concordiaGraphPanel).showConcordiaDisplayOptionsDialog();
});
@@ -504,7 +529,7 @@ private void progressBarFactory() {
loadDataTaskProgressBar.setMaximum(100);
loadDataTaskProgressBar.setMinimum(0);
loadDataTaskProgressBar.setValue(0);
- loadDataTaskProgressBar.setBounds(leftMargin + 0, 695, 450, 20);
+ loadDataTaskProgressBar.setBounds(leftMargin + 0, 700, 450, 20);
}
/**
@@ -628,7 +653,7 @@ public void preparePDF() {
add(probabilityPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);
- kwikiPDFToolBar = new KwikiPDFToolBar(1350, concordiaGraphPanel.getHeight() + topMargin + 60, probabilityPanel, concordiaGraphPanel, project.getSuperSample(), dateTreeByAliquot);
+ kwikiPDFToolBar = new KwikiPDFToolBar(1350, concordiaGraphPanel.getHeight() + topMargin + 50, probabilityPanel, concordiaGraphPanel, project.getSuperSample(), dateTreeByAliquot);
add(kwikiPDFToolBar, javax.swing.JLayeredPane.DEFAULT_LAYER);
}
@@ -710,7 +735,7 @@ private void loadAndShowRawData(//
}
- private synchronized void loadAndShowRawDataFinishUp() {
+ private synchronized void loadAndShowRawDataFinishUp() {
SortedSet tripoliFractionsCurrent;
if (savedCountOfFractions == 0) {
@@ -770,7 +795,6 @@ private synchronized void loadAndShowRawDataFinishUp() {
tripoliSession.prepareFractionTimeStamps();
tripoliSession.processRawData(true);
-// tripoliSession.postProcessDataForCommonLeadLossPreparation();
try {
loadDataTaskProgressBar.repaint();
@@ -781,7 +805,25 @@ private synchronized void loadAndShowRawDataFinishUp() {
getuPbReduxFrame().initializeProject(true);
- updateDisplays();
+//// updateDisplays("");
+ // July 2016
+ // TODO: refactor so more efficient
+ // find latest fraction and show in table
+ SortedSet tripoliFractionsByDate = new TreeSet<>(new Comparator() {
+ @Override
+ public int compare(TripoliFraction tf1, TripoliFraction tf2) {
+ return Long.compare(tf2.getPeakTimeStamp(), tf1.getPeakTimeStamp());
+ }
+ });
+
+ tripoliFractionsByDate.addAll(tripoliFractions);
+ System.out.println("Latest = " + tripoliFractionsByDate.first().getFractionID());
+ mostRecentFractionData.setText(tripoliFractionsByDate.first().getFractionID());
+
+ updateDisplays(tripoliFractionsByDate.first().getFractionID());
+
+ ((ReportAliquotFractionsView) ((TabbedReportViews) reportTableTabbedPane).getViewTabulatedAliquotActiveFractions())
+ .forceVerticalScrollToShowSpecificRow(tripoliFractionsByDate.first().getFractionID());
}
}
@@ -854,7 +896,7 @@ public void propertyChange(PropertyChangeEvent pce) {
} else if ("refMaterialLoaded".equalsIgnoreCase(pce.getPropertyName())) {
try {
tripoliSession.setRefMaterialSessionFittedForLiveMode(false);
- System.out.println("ref material loaded <<<<");
+// System.out.println("ref material loaded <<<<");
} catch (Exception e) {
}
}
@@ -873,6 +915,24 @@ protected class DataMonitorViewDialog extends javax.swing.JDialog {
*/
public DataMonitorViewDialog(Dialog owner, boolean modal) {
super(owner, modal);
+
+ for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
+ if ("Motif".equals(info.getName())) { //Nimbus (original), Motif, Metal
+ try {
+ javax.swing.UIManager.setLookAndFeel(info.getClassName());
+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException classNotFoundException) {
+ }
+ break;
+ }
+ }
+
+ initDialog();
+ }
+
+ private void initDialog() {
+ setUndecorated(false);
+ getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
+ setTitle("Live Data Monitor");
}
}
@@ -927,10 +987,14 @@ public JDialog displayModelInFrame() {
dataMonitorViewDialog = new DataMonitorViewDialog(null, true);
dataMonitorViewDialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
- dataMonitorViewDialog.setBounds( //
- 400, 400, //
- (int) parentDimension.getWidth(),
- (int) parentDimension.getHeight());
+// dataMonitorViewDialog.setBounds( //
+// 400, 400, //
+// (int) parentDimension.getWidth(),
+// (int) parentDimension.getHeight());
+ dataMonitorViewDialog.setPreferredSize(new Dimension(
+ (int) parentDimension.getWidth() - 25,
+ (int) parentDimension.getHeight() - 25));
+
dataMonitorViewDialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);//.HIDE_ON_CLOSE);
//Get the screen size
diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionOverlayContainer.java b/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionOverlayContainer.java
index d9ec6bff..4db98ae1 100644
--- a/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionOverlayContainer.java
+++ b/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionOverlayContainer.java
@@ -37,7 +37,7 @@
* @author James F. Bowring
*/
public class RawDataSessionOverlayContainer extends AbstractRawDataView {
-
+
private List rawIntensitiesDataOverlayViews;
private AbstractRawDataView firstRawIntensitiesDataOverlayView;
private List rawIntensitiesDataSerialViews;
@@ -54,13 +54,13 @@ public class RawDataSessionOverlayContainer extends AbstractRawDataView {
private boolean onLeftOfBackground;
private boolean onRightOfBackground;
private final AbstractRawDataView rawDataSessionSerialContainer;
-
+
public RawDataSessionOverlayContainer(Rectangle bounds, AbstractRawDataView rawDataSessionSerialContainer) {
super(bounds);
this.rawDataSessionSerialContainer = rawDataSessionSerialContainer;
initSession();
}
-
+
private void initSession() {
setBackground(new Color(255, 255, 255));
setOpaque(true);
@@ -75,14 +75,13 @@ private void initSession() {
@Override
public void paint(Graphics2D g2d) {
super.paint(g2d);
-
+
BufferedImage bufferedImage
= new BufferedImage(5, 5, BufferedImage.TYPE_INT_RGB);
Graphics2D big = bufferedImage.createGraphics();
Rectangle r = new Rectangle(0, 0, 5, 5);
// mark peak
-// g2d.setPaint(new Color(241, 255, 240));//pale green
Rectangle2D peakZone = new Rectangle2D.Double(//
mapX(myOnPeakNormalizedAquireTimes[timeZeroRelativeIndex + peakLeftShade]), //
mapY(maxY),//
@@ -94,17 +93,17 @@ public void paint(Graphics2D g2d) {
big.fillOval(0, 0, 5, 5);
g2d.setPaint(new TexturePaint(bufferedImage, r));
g2d.fill(peakZone);
-
+
g2d.setPaint(Color.black);
-
+
g2d.setStroke(new BasicStroke(0.75f));
-
+
g2d.draw(new Line2D.Double(//
mapX(myOnPeakNormalizedAquireTimes[timeZeroRelativeIndex + peakLeftShade]), //
mapY(minY),//
mapX(myOnPeakNormalizedAquireTimes[timeZeroRelativeIndex + peakLeftShade]),//
mapY(maxY)));
-
+
g2d.draw(new Line2D.Double(//
mapX(myOnPeakNormalizedAquireTimes[timeZeroRelativeIndex + peakLeftShade + peakWidth]), //
mapY(minY),//
@@ -112,7 +111,6 @@ public void paint(Graphics2D g2d) {
mapY(maxY)));
// mark background
-// g2d.setPaint(new Color(253, 253, 233));//pale yellow
Rectangle2D backgroundZone = new Rectangle2D.Double(//
mapX(myOnPeakNormalizedAquireTimes[timeZeroRelativeIndex - backgroundRightShade - backgroundWidth]), //
mapY(maxY),//
@@ -124,17 +122,17 @@ public void paint(Graphics2D g2d) {
big.fillOval(0, 0, 5, 5);
g2d.setPaint(new TexturePaint(bufferedImage, r));
g2d.fill(backgroundZone);
-
+
g2d.setPaint(Color.black);
-
+
g2d.setStroke(new BasicStroke(0.75f));
-
+
g2d.draw(new Line2D.Double(//
mapX(myOnPeakNormalizedAquireTimes[timeZeroRelativeIndex - backgroundRightShade - backgroundWidth]), //
mapY(minY),//
mapX(myOnPeakNormalizedAquireTimes[timeZeroRelativeIndex - backgroundRightShade - backgroundWidth]),//
mapY(maxY)));
-
+
g2d.draw(new Line2D.Double(//
mapX(myOnPeakNormalizedAquireTimes[timeZeroRelativeIndex - backgroundRightShade]), //
mapY(minY),//
@@ -161,7 +159,7 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
//this.removeAll();
setDisplayOffsetY(0.0);
setDisplayOffsetX(0.0);
-
+
rawIntensitiesDataOverlayViews = new ArrayList<>();
Component[] components = getComponents();
for (int i = 0; i < components.length; i++) {
@@ -169,7 +167,7 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
rawIntensitiesDataOverlayViews.add(((AbstractRawDataView) components[i]));
}
}
-
+
firstRawIntensitiesDataOverlayView = rawIntensitiesDataOverlayViews.get(0);
myOnPeakNormalizedAquireTimes = firstRawIntensitiesDataOverlayView.getDataModel().getNormalizedOnPeakAquireTimes();
peakLeftShade = ((RawIntensityDataModel) firstRawIntensitiesDataOverlayView.getDataModel()).getPeakLeftShade();
@@ -177,7 +175,7 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
backgroundRightShade = ((RawIntensityDataModel) firstRawIntensitiesDataOverlayView.getDataModel()).getBackgroundRightShade();
backgroundWidth = ((RawIntensityDataModel) firstRawIntensitiesDataOverlayView.getDataModel()).getBackgroundWidth();
timeZeroRelativeIndex = ((RawIntensityDataModel) firstRawIntensitiesDataOverlayView.getDataModel()).getTimeZeroRelativeIndex();
-
+
minX = firstRawIntensitiesDataOverlayView.getMinX();
maxX = firstRawIntensitiesDataOverlayView.getMaxX();
minY = firstRawIntensitiesDataOverlayView.getMinY();
@@ -191,7 +189,7 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
rawIntensitiesDataSerialViews.add(((AbstractRawDataView) components[i]));
}
}
-
+
}
/**
@@ -201,11 +199,11 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
@Override
public void mousePressed(MouseEvent evt) {
}
-
+
@Override
public void mouseReleased(MouseEvent evt) {
}
-
+
@Override
public void mouseMoved(MouseEvent evt) {
insidePeak = false;
@@ -214,7 +212,7 @@ public void mouseMoved(MouseEvent evt) {
insideBackground = false;
onLeftOfBackground = false;
onRightOfBackground = false;
-
+
if (confirmMouseInOnPeakZone(evt.getX())) {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
insidePeak = true;
@@ -224,7 +222,7 @@ public void mouseMoved(MouseEvent evt) {
} else if (confirmMouseRightPeakZone(evt.getX())) {
setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
onRightOfPeak = true;
-
+
} else if (confirmMouseInBackgroundZone(evt.getX())) {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
insideBackground = true;
@@ -238,178 +236,187 @@ public void mouseMoved(MouseEvent evt) {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
-
+
@Override
public void mouseDragged(MouseEvent evt) {
if (insidePeak) {
int deltaX = convertMouseXToValue(evt.getX()) - currentX;
if (deltaX < -1 * peakLeftShade) {
deltaX = -1 * peakLeftShade;
- }
- if ((timeZeroRelativeIndex + peakLeftShade + peakWidth + deltaX) > mapX(0.90 * maxX)) {
- deltaX = (int) mapX(0.90 * maxX) - (timeZeroRelativeIndex + peakLeftShade + peakWidth);
+ } else if ((timeZeroRelativeIndex + peakLeftShade + peakWidth + deltaX) > (0.95 * maxX)) {
+ deltaX = (int) (0.95 * maxX) - (timeZeroRelativeIndex + peakLeftShade + peakWidth);
}
currentX += deltaX;
peakLeftShade += deltaX;
updateModels();
-
+
repaint();
}
-
+
if (onLeftOfPeak) {
int deltaX = convertMouseXToValue(evt.getX()) - currentX;
if (deltaX < -1 * peakLeftShade) {
deltaX = -1 * peakLeftShade;
- }
- if (deltaX > (peakWidth - 10)) {
- deltaX = peakWidth - 10;
+ } else {
+ if (deltaX > (peakWidth - 10)) {
+ deltaX = peakWidth - 10;
+ }
}
currentX += deltaX;
peakLeftShade += deltaX;
peakWidth -= deltaX;
updateModels();
-
+
repaint();
}
-
+
if (onRightOfPeak) {
int deltaX = convertMouseXToValue(evt.getX()) - currentX;
- if ((timeZeroRelativeIndex + peakLeftShade + peakWidth + deltaX) > mapX(0.90 * maxX)) {
- deltaX = (int) mapX(0.90 * maxX) - (timeZeroRelativeIndex + peakLeftShade + peakWidth);
+ if ((timeZeroRelativeIndex + peakLeftShade + peakWidth + deltaX) > (0.95 * maxX)) {
+ deltaX = (int) ((0.95 * maxX)) - (timeZeroRelativeIndex + peakLeftShade + peakWidth);
+ } else {
+ if ((deltaX < 0) && (Math.abs(deltaX) > (peakWidth - 10))) {
+ deltaX = -(peakWidth - 10);
+ }
}
- if (Math.abs(deltaX) > (peakWidth - 10)) {
- deltaX = -(peakWidth - 10);
- }
-
+
+ currentX += deltaX;
peakWidth += deltaX;
updateModels();
-
- currentX += deltaX;
+
repaint();
}
-
+
if (insideBackground) {
int deltaX = convertMouseXToValue(evt.getX()) - currentX;
if (deltaX > backgroundRightShade) {
deltaX = backgroundRightShade;
- }
- if ((timeZeroRelativeIndex - backgroundRightShade - backgroundWidth + deltaX) < mapX(1.10 * minX)) {
- deltaX = (int) mapX(1.10 * minX) - (timeZeroRelativeIndex - backgroundRightShade - backgroundWidth);
+ } else {
+ if ((timeZeroRelativeIndex - backgroundRightShade - backgroundWidth + deltaX) < (1.05 * minX)) {
+ deltaX = (int) (1.05 * minX) - (timeZeroRelativeIndex - backgroundRightShade - backgroundWidth);
+ }
}
currentX += deltaX;
backgroundRightShade -= deltaX;
updateModels();
-
+
repaint();
}
-
+
if (onLeftOfBackground) {
int deltaX = convertMouseXToValue(evt.getX()) - currentX;
- if ((timeZeroRelativeIndex - backgroundRightShade - backgroundWidth + deltaX) < mapX(1.10 * minX)) {
- deltaX = (int) mapX(1.10 * minX) - (timeZeroRelativeIndex - backgroundRightShade - backgroundWidth);
- }
- if (deltaX > (backgroundWidth - 10)) {
- deltaX = backgroundWidth - 10;
+ if ((timeZeroRelativeIndex - backgroundRightShade - backgroundWidth + deltaX) < (1.05 * minX)) {
+ deltaX = (int) (1.05 * minX) - (timeZeroRelativeIndex - backgroundRightShade - backgroundWidth);
+ } else {
+ if (deltaX > (backgroundWidth - 10)) {
+ deltaX = backgroundWidth - 10;
+ }
}
currentX += deltaX;
backgroundWidth -= deltaX;
updateModels();
-
+
repaint();
}
-
+
if (onRightOfBackground) {
int deltaX = convertMouseXToValue(evt.getX()) - currentX;
if (deltaX > backgroundRightShade) {
deltaX = backgroundRightShade;
- }
- if (deltaX > (backgroundWidth - 10)) {
- deltaX = backgroundWidth - 10;
+ } else {
+ if (deltaX > (backgroundWidth - 10)) {
+ deltaX = backgroundWidth - 10;
+ }
}
currentX += deltaX;
backgroundRightShade -= deltaX;
backgroundWidth += deltaX;
updateModels();
-
+
repaint();
- }
+ }
}
-
+
private void updateModels() {
for (int i = 0; i < rawIntensitiesDataOverlayViews.size(); i++) {
((RawIntensityDataModel) rawIntensitiesDataOverlayViews.get(i).getDataModel()).setPeakLeftShade(peakLeftShade);
((RawIntensityDataModel) rawIntensitiesDataOverlayViews.get(i).getDataModel()).setPeakWidth(peakWidth);
((RawIntensityDataModel) rawIntensitiesDataOverlayViews.get(i).getDataModel()).setBackgroundRightShade(backgroundRightShade);
((RawIntensityDataModel) rawIntensitiesDataOverlayViews.get(i).getDataModel()).setBackgroundWidth(backgroundWidth);
-
+
rawIntensitiesDataOverlayViews.get(i).preparePanel(true, false);
rawIntensitiesDataSerialViews.get(i).preparePanel(true, false);
rawIntensitiesDataSerialViews.get(i).repaint();
}
-
- rawDataSessionSerialContainer.revalidate();
-
+
+// rawDataSessionSerialContainer.revalidate();
+ rawDataSessionSerialContainer.refreshPanel(true, false);
+
}
-
+
private boolean confirmMouseInOnPeakZone(int x) {
boolean retVal = false;
-
+
currentX = convertMouseXToValue(x);
retVal = ((currentX > (timeZeroRelativeIndex + peakLeftShade))//
&& (currentX < (timeZeroRelativeIndex + peakLeftShade + peakWidth)));
-
+
return retVal;
}
-
+
private boolean confirmMouseLeftPeakZone(int x) {
boolean retVal = false;
-
+
currentX = convertMouseXToValue(x);
- retVal = (currentX == (timeZeroRelativeIndex + peakLeftShade));
-
+ retVal = (currentX >= (timeZeroRelativeIndex + peakLeftShade - 2))//
+ && (currentX <= (timeZeroRelativeIndex + peakLeftShade + 2));
+
return retVal;
}
-
+
private boolean confirmMouseRightPeakZone(int x) {
boolean retVal = false;
-
+
currentX = convertMouseXToValue(x);
- retVal = (currentX == (timeZeroRelativeIndex + peakLeftShade + peakWidth));
-
+ retVal = (currentX <= (timeZeroRelativeIndex + peakLeftShade + peakWidth + 2))//
+ && (currentX >= (timeZeroRelativeIndex + peakLeftShade + peakWidth - 2));
+
return retVal;
}
-
+
private boolean confirmMouseInBackgroundZone(int x) {
boolean retVal = false;
-
+
currentX = convertMouseXToValue(x);
retVal = ((currentX > (timeZeroRelativeIndex - backgroundRightShade - backgroundWidth))//
&& (currentX < (timeZeroRelativeIndex - backgroundRightShade)));
-
+
return retVal;
}
-
+
private boolean confirmMouseLeftBackgroundZone(int x) {
boolean retVal = false;
-
+
currentX = convertMouseXToValue(x);
- retVal = (currentX == (timeZeroRelativeIndex - backgroundRightShade - backgroundWidth));
-
+ retVal = (currentX >= (timeZeroRelativeIndex - backgroundRightShade - backgroundWidth - 2))//
+ && (currentX <= (timeZeroRelativeIndex - backgroundRightShade - backgroundWidth + 2));
+
return retVal;
}
-
+
private boolean confirmMouseRightBackgroundZone(int x) {
boolean retVal = false;
-
+
currentX = convertMouseXToValue(x);
- retVal = (currentX == (timeZeroRelativeIndex - backgroundRightShade));
-
+ retVal = (currentX >= (timeZeroRelativeIndex - backgroundRightShade - 2))//
+ && (currentX <= (timeZeroRelativeIndex - backgroundRightShade + 2));
+
return retVal;
}
-
+
@Override
public DataModelInterface getDataModel() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
-
+
}
diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionPlot.java b/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionPlot.java
index 8920af38..91f54725 100644
--- a/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionPlot.java
+++ b/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionPlot.java
@@ -24,7 +24,6 @@
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
import java.util.List;
-import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
import org.earthtime.Tripoli.dataModels.DataModelInterface;
import org.earthtime.Tripoli.dataModels.RawIntensityDataModel;
import org.earthtime.Tripoli.dataViews.AbstractRawDataView;
@@ -43,6 +42,7 @@ public class RawDataSessionPlot extends AbstractRawDataView {
private int backgroundRightShade;
private int backgroundWidth;
private int timeZeroRelativeIndex;
+ private int timeToNextTimeZero;
/**
*
@@ -121,109 +121,100 @@ public void paint(Graphics2D g2d) {
mapX(myOnPeakNormalizedAquireTimes[timeZeroRelativeIndex - backgroundRightShade]),//
mapY(maxY)));
- // calculate good right to graph
- DescriptiveStatistics timeZeroDeltas = new DescriptiveStatistics();
- for (int i = 0; i < sessionTimeZeroIndices.size() - 1; i++) {
- timeZeroDeltas.addValue(Math.abs(sessionTimeZeroIndices.get(i + 1) - sessionTimeZeroIndices.get(i)));
- }
- int timeToNextTimeZero = (int) timeZeroDeltas.getMax();
+ // mark time zero
+ g2d.setPaint(Color.red);
+ g2d.setStroke(new BasicStroke(1.0f));
+ g2d.draw(new Line2D.Double(//
+ mapX(timeZeroRelativeIndex), //
+ mapY(minY),//
+ mapX(timeZeroRelativeIndex),//
+ mapY(maxY)));
+ g2d.setPaint(Color.black);
for (int i = 0; i < sessionTimeZeroIndices.size(); i++) {
- int timeZeroStartIndex = sessionTimeZeroIndices.get(i);
-
-// int timeToNextTimeZero = 300;
-// if (i < sessionTimeZeroIndices.size() - 1) {
-// timeToNextTimeZero = sessionTimeZeroIndices.get(i + 1) - timeZeroStartIndex;
-// } else {
-// timeToNextTimeZero = timeZeroStartIndex - sessionTimeZeroIndices.get(i - 1);
-// }
- // mark time zero
- g2d.setPaint(Color.red);
- g2d.setStroke(new BasicStroke(1.0f));
- g2d.draw(new Line2D.Double(//
- mapX(timeZeroRelativeIndex), //
- mapY(minY),//
- mapX(timeZeroRelativeIndex),//
- mapY(maxY)));
- g2d.setPaint(Color.black);
-
- Shape fractionPlot = new Path2D.Double();
- ((Path2D) fractionPlot).moveTo(//
- mapX(0), mapY(myOnPeakData[timeZeroStartIndex - timeZeroRelativeIndex]));
- int t = 1;
- for (int j = timeZeroStartIndex - timeZeroRelativeIndex - 1; j < timeZeroStartIndex + timeToNextTimeZero - timeZeroRelativeIndex; j++) {
- ((Path2D) fractionPlot).lineTo(//
- mapX(t), mapY(myOnPeakData[j]));
- t++;
+ if (sessionTimeZeroIndices.get(i) > 0) {
+ int timeZeroStartIndex = sessionTimeZeroIndices.get(i);
+
+ Shape fractionPlot = new Path2D.Double();
+ ((Path2D) fractionPlot).moveTo(//
+ mapX(0), mapY(myOnPeakData[timeZeroStartIndex - timeZeroRelativeIndex]));
+ int t = 1;
+ for (int j = timeZeroStartIndex - timeZeroRelativeIndex - 1; j < timeZeroStartIndex + timeToNextTimeZero - timeZeroRelativeIndex; j++) {
+ ((Path2D) fractionPlot).lineTo(//
+ mapX(t), mapY(myOnPeakData[j]));
+ t++;
- }
- g2d.setPaint(Color.black);
- g2d.setStroke(new BasicStroke(0.75f));
- g2d.draw(fractionPlot);
+ }
+ g2d.setPaint(Color.black);
+ g2d.setStroke(new BasicStroke(0.75f));
+ g2d.draw(fractionPlot);
+ }
}
} else { //serial mode
for (int i = 0; i < sessionTimeZeroIndices.size(); i++) {
- // mark onpeak
- g2d.setPaint(new Color(241, 255, 240)); //pale green
- int peakStartIndex = sessionTimeZeroIndices.get(i) + peakLeftShade;
- g2d.fill(new Rectangle2D.Double(//
- mapX(myOnPeakNormalizedAquireTimes[peakStartIndex]), //
- mapY(maxY),//
- mapX(peakWidth),//
- Math.abs(mapY(maxY) - mapY(minY))));
-
- g2d.setPaint(Color.black);
- g2d.setStroke(new BasicStroke(0.75f));
-
- g2d.draw(new Line2D.Double(//
- mapX(myOnPeakNormalizedAquireTimes[peakStartIndex]), //
- mapY(minY),//
- mapX(myOnPeakNormalizedAquireTimes[peakStartIndex]),//
- mapY(maxY)));
-
- g2d.draw(new Line2D.Double(//
- mapX(myOnPeakNormalizedAquireTimes[peakStartIndex + peakWidth]), //
- mapY(minY),//
- mapX(myOnPeakNormalizedAquireTimes[peakStartIndex + peakWidth]),//
- mapY(maxY)));
-
- // mark background
- g2d.setPaint(new Color(253, 253, 233)); //pale yellow
- int backgroundStartIndex = sessionTimeZeroIndices.get(i) - backgroundRightShade - backgroundWidth;
- g2d.fill(new Rectangle2D.Double(//
- mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex]), //
- mapY(maxY),//
- mapX(backgroundWidth),//
- Math.abs(mapY(maxY) - mapY(minY))));
-
- g2d.setPaint(Color.black);
- g2d.setStroke(new BasicStroke(0.75f));
-
- g2d.draw(new Line2D.Double(//
- mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex]), //
- mapY(minY),//
- mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex]),//
- mapY(maxY)));
-
- g2d.draw(new Line2D.Double(//
- mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex + backgroundWidth]), //
- mapY(minY),//
- mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex + backgroundWidth]),//
- mapY(maxY)));
-
- // mark time zero
- g2d.setPaint(Color.red);
- int timeZeroIndex = sessionTimeZeroIndices.get(i);
- g2d.draw(new Line2D.Double(//
- mapX(myOnPeakNormalizedAquireTimes[timeZeroIndex]), //
- mapY(minY),//
- mapX(myOnPeakNormalizedAquireTimes[timeZeroIndex]),//
- mapY(maxY)));
- g2d.setPaint(Color.black);
+ // test if ignored
+ if (sessionTimeZeroIndices.get(i) > 0) {
+ // mark onpeak
+ g2d.setPaint(new Color(241, 255, 240)); //pale green
+ int peakStartIndex = sessionTimeZeroIndices.get(i) + peakLeftShade;
+ g2d.fill(new Rectangle2D.Double(//
+ mapX(myOnPeakNormalizedAquireTimes[peakStartIndex]), //
+ mapY(maxY),//
+ mapX(peakWidth),//
+ Math.abs(mapY(maxY) - mapY(minY))));
+
+ g2d.setPaint(Color.black);
+ g2d.setStroke(new BasicStroke(0.75f));
+
+ g2d.draw(new Line2D.Double(//
+ mapX(myOnPeakNormalizedAquireTimes[peakStartIndex]), //
+ mapY(minY),//
+ mapX(myOnPeakNormalizedAquireTimes[peakStartIndex]),//
+ mapY(maxY)));
+
+ g2d.draw(new Line2D.Double(//
+ mapX(myOnPeakNormalizedAquireTimes[peakStartIndex + peakWidth]), //
+ mapY(minY),//
+ mapX(myOnPeakNormalizedAquireTimes[peakStartIndex + peakWidth]),//
+ mapY(maxY)));
+
+ // mark background
+ g2d.setPaint(new Color(253, 253, 233)); //pale yellow
+ int backgroundStartIndex = sessionTimeZeroIndices.get(i) - backgroundRightShade - backgroundWidth;
+ g2d.fill(new Rectangle2D.Double(//
+ mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex]), //
+ mapY(maxY),//
+ mapX(backgroundWidth),//
+ Math.abs(mapY(maxY) - mapY(minY))));
+
+ g2d.setPaint(Color.black);
+ g2d.setStroke(new BasicStroke(0.75f));
+
+ g2d.draw(new Line2D.Double(//
+ mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex]), //
+ mapY(minY),//
+ mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex]),//
+ mapY(maxY)));
+
+ g2d.draw(new Line2D.Double(//
+ mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex + backgroundWidth]), //
+ mapY(minY),//
+ mapX(myOnPeakNormalizedAquireTimes[backgroundStartIndex + backgroundWidth]),//
+ mapY(maxY)));
+
+ // mark time zero
+ g2d.setPaint(Color.red);
+ int timeZeroIndex = sessionTimeZeroIndices.get(i);
+ g2d.draw(new Line2D.Double(//
+ mapX(myOnPeakNormalizedAquireTimes[timeZeroIndex]), //
+ mapY(minY),//
+ mapX(myOnPeakNormalizedAquireTimes[timeZeroIndex]),//
+ mapY(maxY)));
+ g2d.setPaint(Color.black);
+ }
}
-
// draw data over selection zone
Shape connectingLine = new Path2D.Double();
((Path2D) connectingLine).moveTo(//
@@ -266,6 +257,7 @@ public void preparePanel(boolean doReScale, boolean inLiveMode
backgroundRightShade = ((RawIntensityDataModel) rawRatioDataModel).getBackgroundRightShade();
backgroundWidth = ((RawIntensityDataModel) rawRatioDataModel).getBackgroundWidth();
timeZeroRelativeIndex = ((RawIntensityDataModel) rawRatioDataModel).getTimeZeroRelativeIndex();
+ timeToNextTimeZero = ((RawIntensityDataModel) rawRatioDataModel).getTimeToNextTimeZero();
if (doReScale) {
setDisplayOffsetY(0.0);
@@ -276,7 +268,7 @@ public void preparePanel(boolean doReScale, boolean inLiveMode
minX = myOnPeakNormalizedAquireTimes[0];
maxX = myOnPeakNormalizedAquireTimes[myOnPeakNormalizedAquireTimes.length - 1];
if (overlayMode) {
- maxX /= sessionTimeZeroIndices.size();
+ maxX = timeToNextTimeZero;// + 20;//(maxX / sessionTimeZeroIndices.size()) + timeZeroRelativeIndex * 2.0;
}
// double xMarginStretch = TicGeneratorForAxes.generateMarginAdjustment(minX, maxX, 0.05);
diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionSerialContainer.java b/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionSerialContainer.java
index b53aa521..42138121 100644
--- a/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionSerialContainer.java
+++ b/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/RawDataSessionSerialContainer.java
@@ -15,8 +15,19 @@
*/
package org.earthtime.Tripoli.dataViews.rawDataReviews;
+import java.awt.Color;
+import java.awt.Component;
import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.AbstractButton;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
import org.earthtime.Tripoli.dataModels.DataModelInterface;
+import org.earthtime.Tripoli.dataModels.RawIntensityDataModel;
import org.earthtime.Tripoli.dataViews.AbstractRawDataView;
/**
@@ -25,6 +36,30 @@
*/
public class RawDataSessionSerialContainer extends AbstractRawDataView {
+ private List rawIntensitiesDataSerialViews;
+ private AbstractRawDataView firstRawIntensitiesDataSerialView;
+ List sessionTimeZeroIndices;
+ private int timeZeroRelativeIndex;
+ private int peakLeftShade;
+ private int peakWidth;
+ private int backgroundRightShade;
+ private int backgroundWidth;
+ private transient boolean initialized;
+ private JLabel[] fractionNameLabels;
+ private String[] fractionNames;
+ private JCheckBox[] fractionIgnores;
+
+ /**
+ *
+ * @param bounds the value of bounds
+ * @param fractionNames the value of fractionNames
+ */
+ public RawDataSessionSerialContainer(Rectangle bounds, String[] fractionNames) {
+ super(bounds);
+ initialized = false;
+ this.fractionNames = fractionNames;
+ }
+
/**
*
* @param g2d
@@ -32,11 +67,143 @@ public class RawDataSessionSerialContainer extends AbstractRawDataView {
@Override
public void paint(Graphics2D g2d) {
super.paint(g2d);
+
+// g2d.setPaint(new Color(235, 255, 255));
+// g2d.setStroke(new BasicStroke(1.f));
+//
+// for (int i = 0; i < sessionTimeZeroIndices.size(); i++) {
+// Rectangle2D fractionZOne = new Rectangle2D.Double(//
+// mapX(myOnPeakNormalizedAquireTimes[sessionTimeZeroIndices.get(i)] - backgroundRightShade - backgroundWidth), //
+// 0,//
+// mapX(backgroundRightShade + backgroundWidth + peakLeftShade + peakWidth),//
+// 25);
+//
+// g2d.fill(fractionZOne);
+// }
+ }
+
+ public void initPanel() {
+ setDisplayOffsetY(0.0);
+ setDisplayOffsetX(0.0);
+
+ //get a handle on serial view models
+ rawIntensitiesDataSerialViews = new ArrayList<>();
+ Component[] components = getComponents();
+ for (int i = 0; i < components.length; i++) {
+ if (components[i] instanceof RawDataSessionPlot) {
+ rawIntensitiesDataSerialViews.add(((AbstractRawDataView) components[i]));
+ }
+ }
+
+ firstRawIntensitiesDataSerialView = rawIntensitiesDataSerialViews.get(0);
+ sessionTimeZeroIndices = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getSessionTimeZeroIndices();
+ myOnPeakNormalizedAquireTimes = firstRawIntensitiesDataSerialView.getDataModel().getNormalizedOnPeakAquireTimes();
+ peakLeftShade = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getPeakLeftShade();
+ peakWidth = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getPeakWidth();
+ backgroundRightShade = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getBackgroundRightShade();
+ backgroundWidth = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getBackgroundWidth();
+ timeZeroRelativeIndex = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getTimeZeroRelativeIndex();
+
+ minX = firstRawIntensitiesDataSerialView.getMinX();
+ maxX = firstRawIntensitiesDataSerialView.getMaxX();
+ minY = firstRawIntensitiesDataSerialView.getMinY();
+ maxY = firstRawIntensitiesDataSerialView.getMaxY();
+
+ fractionNameLabels = new JLabel[sessionTimeZeroIndices.size()];
+ for (int i = 0; i < sessionTimeZeroIndices.size(); i++) {
+ fractionNameLabels[i] = new JLabel();
+ fractionNameLabels[i].setBounds(//
+ (int) mapX(myOnPeakNormalizedAquireTimes[sessionTimeZeroIndices.get(i) - backgroundWidth - backgroundRightShade]),//
+ 1, (int) mapX(backgroundWidth + backgroundRightShade + peakLeftShade + peakWidth), 20);
+ fractionNameLabels[i].setHorizontalAlignment(JLabel.CENTER);
+ fractionNameLabels[i].setOpaque(true);
+ fractionNameLabels[i].setBackground(new Color(235, 255, 255));
+ fractionNameLabels[i].setBorder(javax.swing.BorderFactory.createLineBorder(Color.black));
+ add(fractionNameLabels[i], DEFAULT_LAYER);
+ }
+
+ renameFractions();
+
+ fractionIgnores = new JCheckBox[sessionTimeZeroIndices.size()];
+ for (int i = 0; i < sessionTimeZeroIndices.size(); i++) {
+ fractionIgnores[i] = new JCheckBox("Ignore");
+ fractionIgnores[i].setBounds(//
+ (int) mapX(myOnPeakNormalizedAquireTimes[sessionTimeZeroIndices.get(i) - backgroundWidth - backgroundRightShade]),//
+ (int) mapY(minY) - 25, (int) mapX(backgroundWidth + backgroundRightShade + peakLeftShade + peakWidth), 20);
+ fractionIgnores[i].setHorizontalAlignment(JLabel.CENTER);
+ fractionIgnores[i].setOpaque(true);
+ fractionIgnores[i].setBackground(new Color(235, 255, 255));
+ fractionIgnores[i].setBorder(javax.swing.BorderFactory.createLineBorder(Color.black));
+ fractionIgnores[i].addItemListener(new fractionIgnoresListener(i));
+ add(fractionIgnores[i], DEFAULT_LAYER);
+ }
+
+ initialized = true;
}
+ private void renameFractions() {
+ int countIgnored = 0;
+ for (int i = 0; i < sessionTimeZeroIndices.size(); i++) {
+ if (sessionTimeZeroIndices.get(i) < 0) {
+ countIgnored++;
+ fractionNameLabels[i].setText("X " + i);
+ } else {
+ if ((i - countIgnored) < fractionNames.length) {
+ fractionNameLabels[i].setText(fractionNames[i - countIgnored]);
+ } else {
+ fractionNameLabels[i].setText("none " + i);
+ }
+ }
+ }
+ }
+
+ private class fractionIgnoresListener implements ItemListener {
+
+ private int i;
+
+ public fractionIgnoresListener(int i) {
+ this.i = i;
+ }
+
+ @Override
+ public void itemStateChanged(ItemEvent e) {
+ sessionTimeZeroIndices.set(i, Math.abs(sessionTimeZeroIndices.get(i)) * (int) (((AbstractButton) e.getSource()).isSelected() ? -1 : 1));
+ renameFractions();
+ repaint();
+ }
+
+ }
+
+ /**
+ *
+ * @param doReScale the value of doReScale
+ * @param inLiveMode the value of inLiveMode
+ */
@Override
public void preparePanel(boolean doReScale, boolean inLiveMode) {
+ if (!initialized) {
+ initPanel();
+ }
+
+ peakLeftShade = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getPeakLeftShade();
+ peakWidth = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getPeakWidth();
+ backgroundRightShade = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getBackgroundRightShade();
+ backgroundWidth = ((RawIntensityDataModel) firstRawIntensitiesDataSerialView.getDataModel()).getBackgroundWidth();
+
+ // relocate fractionLabels and fraction ignores
+ for (int i = 0; i < fractionNameLabels.length; i++) {
+ fractionNameLabels[i].setBounds(//
+ (int) mapX(myOnPeakNormalizedAquireTimes[sessionTimeZeroIndices.get(i) - backgroundWidth - backgroundRightShade]),//
+ 1, (int) mapX(backgroundWidth + backgroundRightShade + peakLeftShade + peakWidth), 20);
+ fractionNameLabels[i].revalidate();
+
+ fractionIgnores[i].setBounds(//
+ (int) mapX(myOnPeakNormalizedAquireTimes[sessionTimeZeroIndices.get(i) - backgroundWidth - backgroundRightShade]),//
+ (int) mapY(minY) - 25, (int) mapX(backgroundWidth + backgroundRightShade + peakLeftShade + peakWidth), 20);
+ fractionIgnores[i].revalidate();
+ }
+
}
@Override
diff --git a/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/TimeResolvedAnalysisDataView.form b/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/TimeResolvedAnalysisDataView.form
index 24bc0510..a5cd2a9a 100644
--- a/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/TimeResolvedAnalysisDataView.form
+++ b/src/main/java/org/earthtime/Tripoli/dataViews/rawDataReviews/TimeResolvedAnalysisDataView.form
@@ -3,11 +3,12 @@