From f157fca6c3e084d827ba6ad7149e4cf932945487 Mon Sep 17 00:00:00 2001 From: "Dr. Philip Wenig" Date: Tue, 14 Apr 2020 21:37:27 +0200 Subject: [PATCH] Fixed #315 - Overlay Chart - add option to enable buffered selection --- .../ux/extension/xxd/ui/preferences/PreferenceConstants.java | 2 ++ .../ux/extension/xxd/ui/preferences/PreferenceInitializer.java | 2 ++ .../ux/extension/xxd/ui/preferences/PreferencePageOverlay.java | 3 ++- .../ux/extension/xxd/ui/swt/ExtendedChromatogramOverlayUI.java | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferenceConstants.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferenceConstants.java index e62ae17183..3fb7340c65 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferenceConstants.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferenceConstants.java @@ -140,6 +140,8 @@ public class PreferenceConstants extends ChartOptions { public static final String DEF_COLOR_SCHEME_DISPLAY_OVERLAY = Colors.COLOR_SCHEME_PRINT; public static final String P_LINE_STYLE_DISPLAY_OVERLAY = "lineStyleDisplayOverlay"; public static final String DEF_LINE_STYLE_DISPLAY_OVERLAY = LineStyle.SOLID.toString(); + public static final String P_OVERLAY_BUFFERED_SELECTION = "overlayBufferedSelection"; + public static final boolean DEF_OVERLAY_BUFFERED_SELECTION = false; /* * Peak Traces */ diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferenceInitializer.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferenceInitializer.java index fe2cbf2628..59d6da534f 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferenceInitializer.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferenceInitializer.java @@ -370,6 +370,8 @@ public static IPreferenceStore initializeOverlayDefaults(IPreferenceStore store) store.setDefault(PreferenceConstants.P_SHOW_REFERENCED_CHROMATOGRAMS, PreferenceConstants.DEF_SHOW_REFERENCED_CHROMATOGRAMS); store.setDefault(PreferenceConstants.P_COLOR_SCHEME_DISPLAY_OVERLAY, PreferenceConstants.DEF_COLOR_SCHEME_DISPLAY_OVERLAY); store.setDefault(PreferenceConstants.P_LINE_STYLE_DISPLAY_OVERLAY, PreferenceConstants.DEF_LINE_STYLE_DISPLAY_OVERLAY); + store.setDefault(PreferenceConstants.P_OVERLAY_BUFFERED_SELECTION, PreferenceConstants.DEF_OVERLAY_BUFFERED_SELECTION); + // store.setDefault(PreferenceConstants.P_CHROMATOGRAM_OVERLAY_NAMED_TRACES, PreferenceConstants.DEF_CHROMATOGRAM_OVERLAY_NAMED_TRACES); // store.setDefault(PreferenceConstants.P_OVERLAY_SHIFT_X, PreferenceConstants.DEF_OVERLAY_SHIFT_X); diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePageOverlay.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePageOverlay.java index 091171b38e..c41e356576 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePageOverlay.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePageOverlay.java @@ -36,7 +36,8 @@ public PreferencePageOverlay() { @Override public void createFieldEditors() { - addField(new ComboFieldEditor(PreferenceConstants.P_CHROMATOGRAM_CHART_COMPRESSION_TYPE, "Compression Type:", PreferenceConstants.COMPRESSION_TYPES, getFieldEditorParent())); + addField(new ComboFieldEditor(PreferenceConstants.P_OVERLAY_CHART_COMPRESSION_TYPE, "Compression Type:", PreferenceConstants.COMPRESSION_TYPES, getFieldEditorParent())); + addField(new BooleanFieldEditor(PreferenceConstants.P_OVERLAY_BUFFERED_SELECTION, "Buffered Selection", getFieldEditorParent())); // addField(new SpacerFieldEditor(getFieldEditorParent())); addField(new ComboFieldEditor(PreferenceConstants.P_COLOR_SCHEME_DISPLAY_OVERLAY, "Display Color Scheme", Colors.getAvailableColorSchemes(), getFieldEditorParent())); diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedChromatogramOverlayUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedChromatogramOverlayUI.java index 5c2f658b6f..c121d26e55 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedChromatogramOverlayUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedChromatogramOverlayUI.java @@ -46,6 +46,7 @@ import org.eclipse.chemclipse.ux.extension.xxd.ui.support.charts.ChromatogramChartSupport; import org.eclipse.chemclipse.ux.extension.xxd.ui.support.charts.Derivative; import org.eclipse.chemclipse.ux.extension.xxd.ui.support.charts.DisplayModus; +import org.eclipse.chemclipse.ux.extension.xxd.ui.swt.AxisConfig.ChartAxis; import org.eclipse.chemclipse.ux.extension.xxd.ui.traces.NamedTrace; import org.eclipse.chemclipse.ux.extension.xxd.ui.traces.NamedTraces; import org.eclipse.chemclipse.ux.extension.xxd.ui.traces.NamedTracesUI; @@ -484,6 +485,7 @@ private ChromatogramChart createOverlayChart(Composite parent) { chartSettings.setShowRangeSelectorInitially(false); chartSettings.setSupportDataShift(true); chartSettings.getRangeRestriction().setZeroY(false); + chartSettings.setBufferSelection(preferenceStore.getBoolean(PreferenceConstants.P_OVERLAY_BUFFERED_SELECTION)); chromatogramChart.applySettings(chartSettings); // BaseChart baseChart = chromatogramChart.getBaseChart(); @@ -512,6 +514,7 @@ private void refreshUpdateOverlayChart() { rangeRestriction.setExtendMaxX(0.0d); rangeRestriction.setExtendTypeY(ExtendType.ABSOLUTE); rangeRestriction.setExtendMaxY(0.0d); + chartSettings.setBufferSelection(preferenceStore.getBoolean(PreferenceConstants.P_OVERLAY_BUFFERED_SELECTION)); chromatogramChart.applySettings(chartSettings); // IAxisSet axisSet = chromatogramChart.getBaseChart().getAxisSet();