Skip to content

Commit

Permalink
Fixed #315 - Overlay Chart - add option to enable buffered selection
Browse files Browse the repository at this point in the history
  • Loading branch information
eselmeister committed Apr 14, 2020
1 parent 22d3699 commit f157fca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f157fca

Please sign in to comment.