From ef7f7d2db8d0ea4f6cb74705b6d485ddcfabbcf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 30 Jun 2021 13:13:01 +0200 Subject: [PATCH 1/5] The crossing point is usually not visualized. --- .../xxd/ui/swt/ExtendedWellChartUI.java | 51 ------------------- 1 file changed, 51 deletions(-) diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java index 670c5a2cde..150edfd570 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java @@ -18,10 +18,6 @@ import java.util.concurrent.atomic.AtomicReference; import org.eclipse.chemclipse.logging.core.Logger; -import org.eclipse.chemclipse.numeric.core.IPoint; -import org.eclipse.chemclipse.numeric.core.Point; -import org.eclipse.chemclipse.numeric.equations.Equations; -import org.eclipse.chemclipse.numeric.equations.LinearEquation; import org.eclipse.chemclipse.pcr.model.core.IChannel; import org.eclipse.chemclipse.pcr.model.core.IPlate; import org.eclipse.chemclipse.pcr.model.core.IWell; @@ -284,11 +280,6 @@ private void addChannelData(IChannel channel, List lineSeriesDa if(channelCurve != null) { lineSeriesDataList.add(channelCurve); } - // - ILineSeriesData crossingPoint = getCrossingPoint(channel, color); - if(crossingPoint != null) { - lineSeriesDataList.add(crossingPoint); - } } private ILineSeriesData getChannelCurve(IChannel channel, Color color) { @@ -312,48 +303,6 @@ private ILineSeriesData getChannelCurve(IChannel channel, Color color) { return lineSeriesData; } - private ILineSeriesData getCrossingPoint(IChannel channel, Color color) { - - ILineSeriesData lineSeriesData = null; - if(channel != null) { - IPoint crossingPoint = getCrossingPoint(channel); - if(crossingPoint != null) { - double[] xSeries = new double[]{crossingPoint.getX()}; - double[] ySeries = new double[]{crossingPoint.getY()}; - ISeriesData seriesData = new SeriesData(xSeries, ySeries, "Crossing Point " + channel.getId()); - lineSeriesData = new LineSeriesData(seriesData); - ILineSeriesSettings lineSeriesSettings = lineSeriesData.getSettings(); - lineSeriesSettings.setSymbolColor(color); - lineSeriesSettings.setSymbolSize(8); - lineSeriesSettings.setSymbolType(PlotSymbolType.CROSS); - lineSeriesSettings.setEnableArea(false); - } - } - return lineSeriesData; - } - - private IPoint getCrossingPoint(IChannel channel) { - - double crossingPointX = channel.getCrossingPoint(); - int floor = (int)Math.floor(crossingPointX); - int ceil = (int)Math.ceil(crossingPointX); - // - List pointList = colorCompensation ? channel.getColorCompensatedFluorescence() : channel.getFluorescence(); - if(floor >= 0 && floor < pointList.size() && ceil >= 0 && ceil < pointList.size()) { - if(floor == ceil) { - double y = pointList.get(floor); - return new Point(crossingPointX, y); - } else { - IPoint p1 = new Point(floor, pointList.get(floor)); - IPoint p2 = new Point(ceil, pointList.get(ceil)); - LinearEquation equation = Equations.createLinearEquation(p1, p2); - double y = equation.calculateY(crossingPointX); - return new Point(crossingPointX, y); - } - } - return null; - } - private void updateLabel() { toolbarInfo.get().setText(well != null ? well.getLabel() : "--"); From 6aa9dd5f17d64280796226a4be329eeef396f9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 30 Jun 2021 13:14:44 +0200 Subject: [PATCH 2/5] Don't draw points so you can hover over the line. --- .../ux/extension/xxd/ui/swt/ExtendedWellChartUI.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java index 150edfd570..78889e3ba4 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java @@ -41,7 +41,6 @@ import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; -import org.eclipse.swtchart.ILineSeries.PlotSymbolType; import org.eclipse.swtchart.extensions.core.ISeriesData; import org.eclipse.swtchart.extensions.core.SeriesData; import org.eclipse.swtchart.extensions.linecharts.ILineSeriesData; @@ -295,9 +294,6 @@ private ILineSeriesData getChannelCurve(IChannel channel, Color color) { lineSeriesData = new LineSeriesData(seriesData); ILineSeriesSettings lineSeriesSettings = lineSeriesData.getSettings(); lineSeriesSettings.setLineColor(color); - lineSeriesSettings.setSymbolColor(color); - lineSeriesSettings.setSymbolSize(2); - lineSeriesSettings.setSymbolType(PlotSymbolType.CIRCLE); lineSeriesSettings.setEnableArea(false); } return lineSeriesData; From e9798ad780c4543eefd361cd3debf7aaed3f7f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 30 Jun 2021 13:17:37 +0200 Subject: [PATCH 3/5] Distinguish ID and description. --- .../ux/extension/xxd/ui/swt/ExtendedWellChartUI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java index 78889e3ba4..d5cf242a4b 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java @@ -290,11 +290,12 @@ private ILineSeriesData getChannelCurve(IChannel channel, Color color) { for(int index = 0; index < pointList.size(); index++) { points[index] = pointList.get(index); } - ISeriesData seriesData = new SeriesData(points, channel.getDetectionName()); + ISeriesData seriesData = new SeriesData(points, String.valueOf(channel.getId())); lineSeriesData = new LineSeriesData(seriesData); ILineSeriesSettings lineSeriesSettings = lineSeriesData.getSettings(); lineSeriesSettings.setLineColor(color); lineSeriesSettings.setEnableArea(false); + lineSeriesSettings.setDescription(channel.getDetectionName()); } return lineSeriesData; } From 32b76ecfe57338abe4e4a5ac41d5f64b4eba658a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 30 Jun 2021 13:56:10 +0200 Subject: [PATCH 4/5] Remove settings button for parts without preferences. --- .../xxd/ui/swt/ExtendedPlateDataUI.java | 24 ++---------------- .../xxd/ui/swt/ExtendedWellChannelsUI.java | 18 +------------ .../xxd/ui/swt/ExtendedWellDataUI.java | 24 +++--------------- .../ui/swt/editors/ExtendedPCRPlateUI.java | 25 ++----------------- 4 files changed, 8 insertions(+), 83 deletions(-) diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedPlateDataUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedPlateDataUI.java index 38ef0289d1..e002d3cbc2 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedPlateDataUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedPlateDataUI.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2020 Lablicate GmbH. + * Copyright (c) 2018, 2021 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -12,7 +12,6 @@ package org.eclipse.chemclipse.ux.extension.xxd.ui.swt; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicReference; @@ -26,7 +25,6 @@ import org.eclipse.chemclipse.support.ui.provider.AbstractLabelProvider; import org.eclipse.chemclipse.support.ui.provider.ListContentProvider; import org.eclipse.chemclipse.swt.ui.components.InformationUI; -import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePagePCR; import org.eclipse.jface.viewers.ComboViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; @@ -36,7 +34,6 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; public class ExtendedPlateDataUI extends Composite implements IExtendedPartUI { @@ -86,11 +83,10 @@ private void createToolbarMain(Composite parent) { GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalAlignment = SWT.END; composite.setLayoutData(gridData); - composite.setLayout(new GridLayout(3, false)); + composite.setLayout(new GridLayout(2, false)); // buttonToolbarInfo = createButtonToggleToolbar(composite, toolbarInfo, IMAGE_INFO, TOOLTIP_INFO); createResetButton(composite); - createSettingsButton(composite); } private void createResetButton(Composite parent) { @@ -112,22 +108,6 @@ public void widgetSelected(SelectionEvent e) { }); } - private void createSettingsButton(Composite parent) { - - createSettingsButton(parent, Arrays.asList(PreferencePagePCR.class), new ISettingsHandler() { - - @Override - public void apply(Display display) { - - applySettings(); - } - }); - } - - private void applySettings() { - - } - private void createToolbarInfo(Composite parent) { InformationUI informationUI = new InformationUI(parent, SWT.NONE); diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChannelsUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChannelsUI.java index 81a3b05ad5..b200df034f 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChannelsUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChannelsUI.java @@ -12,7 +12,6 @@ *******************************************************************************/ package org.eclipse.chemclipse.ux.extension.xxd.ui.swt; -import java.util.Arrays; import java.util.Collection; import java.util.concurrent.atomic.AtomicReference; @@ -23,7 +22,6 @@ import org.eclipse.chemclipse.rcp.ui.icons.core.ApplicationImageFactory; import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImage; import org.eclipse.chemclipse.swt.ui.components.InformationUI; -import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePagePCR; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -32,7 +30,6 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; @@ -87,11 +84,10 @@ private void createToolbarMain(Composite parent) { GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalAlignment = SWT.END; composite.setLayoutData(gridData); - composite.setLayout(new GridLayout(3, false)); + composite.setLayout(new GridLayout(2, false)); // buttonToolbarInfo = createButtonToggleToolbar(composite, toolbarInfo, IMAGE_INFO, TOOLTIP_INFO); createResetButton(composite); - createSettingsButton(composite); } private void createResetButton(Composite parent) { @@ -110,18 +106,6 @@ public void widgetSelected(SelectionEvent e) { }); } - private void createSettingsButton(Composite parent) { - - createSettingsButton(parent, Arrays.asList(PreferencePagePCR.class), new ISettingsHandler() { - - @Override - public void apply(Display display) { - - updateWidgets(); - } - }); - } - private void createToolbarInfo(Composite parent) { InformationUI informationUI = new InformationUI(parent, SWT.NONE); diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellDataUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellDataUI.java index 3da3d49e8c..492968a6fa 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellDataUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellDataUI.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2020 Lablicate GmbH. + * Copyright (c) 2018, 2021 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -31,7 +31,6 @@ import org.eclipse.chemclipse.swt.ui.components.ISearchListener; import org.eclipse.chemclipse.swt.ui.components.InformationUI; import org.eclipse.chemclipse.swt.ui.components.SearchSupportUI; -import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePagePCR; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; @@ -40,7 +39,6 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; @@ -71,6 +69,7 @@ public ExtendedWellDataUI(Composite parent, int style) { createControl(); } + @Override public boolean setFocus() { updateInput(); @@ -114,30 +113,13 @@ private void createToolbarMain(Composite parent) { GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalAlignment = SWT.END; composite.setLayoutData(gridData); - composite.setLayout(new GridLayout(6, false)); + composite.setLayout(new GridLayout(5, false)); // buttonToolbarInfo = createButtonToggleToolbar(composite, Arrays.asList(toolbarInfoTop, toolbarInfoBottom), IMAGE_INFO, TOOLTIP_INFO); buttonToolbarSearch = createButtonToggleToolbar(composite, toolbarSearch, IMAGE_SEARCH, TOOLTIP_SEARCH); buttonToolbarEdit = createButtonToggleToolbar(composite, toolbarEdit, IMAGE_EDIT, TOOLTIP_EDIT); buttonTableEdit = createButtonToggleEditTable(composite, tableViewer, IMAGE_EDIT_ENTRY); buttonDelete = createButtonDelete(composite); - createSettingsButton(composite); - } - - private void createSettingsButton(Composite parent) { - - createSettingsButton(parent, Arrays.asList(PreferencePagePCR.class), new ISettingsHandler() { - - @Override - public void apply(Display display) { - - applySettings(); - } - }); - } - - private void applySettings() { - } private void createToolbarInfoTop(Composite parent) { diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedPCRPlateUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedPCRPlateUI.java index 2f7e91bc16..07350490b0 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedPCRPlateUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedPCRPlateUI.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2020 Lablicate GmbH. + * Copyright (c) 2018, 2021 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -11,7 +11,6 @@ *******************************************************************************/ package org.eclipse.chemclipse.ux.extension.xxd.ui.swt.editors; -import java.util.Arrays; import java.util.List; import org.eclipse.chemclipse.pcr.model.core.IPlate; @@ -20,9 +19,7 @@ import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImage; import org.eclipse.chemclipse.support.events.IChemClipseEvents; import org.eclipse.chemclipse.swt.ui.notifier.UpdateNotifierUI; -import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePagePCR; import org.eclipse.chemclipse.ux.extension.xxd.ui.swt.IExtendedPartUI; -import org.eclipse.chemclipse.ux.extension.xxd.ui.swt.ISettingsHandler; import org.eclipse.chemclipse.ux.extension.xxd.ui.swt.PCRPlate; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; @@ -69,13 +66,12 @@ private void createToolbarMain(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); composite.setLayoutData(gridData); - composite.setLayout(new GridLayout(5, false)); + composite.setLayout(new GridLayout(4, false)); // createDataInfoLabel(composite); comboSubsets = createComboSubsets(composite); comboChannels = createComboChannels(composite); createResetButton(composite); - createSettingsButton(composite); } private void createDataInfoLabel(Composite parent) { @@ -154,23 +150,6 @@ public void widgetSelected(SelectionEvent e) { }); } - private void createSettingsButton(Composite parent) { - - createSettingsButton(parent, Arrays.asList(PreferencePagePCR.class), new ISettingsHandler() { - - @Override - public void apply(Display display) { - - applySettings(); - } - }); - } - - private void applySettings() { - - reset(); - } - private void reset() { updateWidget(); From 257a75ca617d3a935b9198d720223c1c7b6df915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 30 Jun 2021 14:17:41 +0200 Subject: [PATCH 5/5] Color the wells per channel. --- .../ui/preferences/PreferenceConstants.java | 6 ++- .../ui/preferences/PreferenceInitializer.java | 3 +- ...PCR.java => PreferencePagePlateChart.java} | 10 +++-- .../preferences/PreferencePageWellChart.java | 45 +++++++++++++++++++ .../xxd/ui/swt/ExtendedPlateChartsUI.java | 6 +-- .../xxd/ui/swt/ExtendedWellChartUI.java | 25 ++++++----- 6 files changed, 73 insertions(+), 22 deletions(-) rename chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/{PreferencePagePCR.java => PreferencePagePlateChart.java} (84%) create mode 100644 chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePageWellChart.java 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 92583ee722..d296a2975e 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 @@ -777,8 +777,10 @@ public class PreferenceConstants extends ChartOptions { */ public static final String P_PCR_DEFAULT_COLOR = "pcrDefaultColor"; public static final String DEF_PCR_DEFAULT_COLOR = "192,192,192"; - public static final String P_PCR_COLOR_CODES = "pcrColorCodes"; - public static final String DEF_PCR_COLOR_CODES = ""; + public static final String P_PCR_PLATE_COLOR_CODES = "pcrColorCodes"; + public static final String DEF_PCR_PLATE_COLOR_CODES = ""; + public static final String P_PCR_WELL_COLOR_CODES = "pcrWellColorCodes"; + public static final String DEF_PCR_WELL_COLOR_CODES = ""; public static final String P_PCR_SAVE_AS_FOLDER = "pcrSaveAsFolder"; public static final String DEF_PCR_SAVE_AS_FOLDER = ""; public static final String P_PCR_REFERENCE_LABEL = "pcrReferenceLabel"; 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 b11c3c5d02..3f3400305c 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 @@ -250,7 +250,8 @@ public void initializeDefaultPreferences() { * PCR */ store.setDefault(PreferenceConstants.P_PCR_DEFAULT_COLOR, PreferenceConstants.DEF_PCR_DEFAULT_COLOR); - store.setDefault(PreferenceConstants.P_PCR_COLOR_CODES, PreferenceConstants.DEF_PCR_COLOR_CODES); + store.setDefault(PreferenceConstants.P_PCR_PLATE_COLOR_CODES, PreferenceConstants.DEF_PCR_PLATE_COLOR_CODES); + store.setDefault(PreferenceConstants.P_PCR_WELL_COLOR_CODES, PreferenceConstants.DEF_PCR_WELL_COLOR_CODES); store.setDefault(PreferenceConstants.P_PCR_SAVE_AS_FOLDER, PreferenceConstants.DEF_PCR_SAVE_AS_FOLDER); store.setDefault(PreferenceConstants.P_PCR_REFERENCE_LABEL, PreferenceConstants.DEF_PCR_REFERENCE_LABEL); /* diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePagePCR.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePagePlateChart.java similarity index 84% rename from chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePagePCR.java rename to chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePagePlateChart.java index 11cfb1cab7..fe0e60c2b7 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePagePCR.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePagePlateChart.java @@ -22,24 +22,26 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; -public class PreferencePagePCR extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { +public class PreferencePagePlateChart extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - public PreferencePagePCR() { + public PreferencePagePlateChart() { super(GRID); setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setTitle("PCR"); + setTitle("Plate Chart"); setDescription(""); } + @Override public void createFieldEditors() { addField(new ComboFieldEditor(PreferenceConstants.P_PCR_REFERENCE_LABEL, "Reference Label:", LabelSetting.getOptions(), getFieldEditorParent())); addField(new SpacerFieldEditor(getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceConstants.P_PCR_DEFAULT_COLOR, "Default Line Color:", getFieldEditorParent())); - addField(new ColorCodesFieldEditor(PreferenceConstants.P_PCR_COLOR_CODES, "Color Codes", getFieldEditorParent())); + addField(new ColorCodesFieldEditor(PreferenceConstants.P_PCR_PLATE_COLOR_CODES, "Color Codes", getFieldEditorParent())); } + @Override public void init(IWorkbench workbench) { } diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePageWellChart.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePageWellChart.java new file mode 100644 index 0000000000..118c96adfa --- /dev/null +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/preferences/PreferencePageWellChart.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2018, 2021 Lablicate GmbH. + * + * All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Dr. Philip Wenig - initial API and implementation + * Matthias Mailänder - add a color codes setting + *******************************************************************************/ +package org.eclipse.chemclipse.ux.extension.xxd.ui.preferences; + +import org.eclipse.chemclipse.support.ui.preferences.fieldeditors.SpacerFieldEditor; +import org.eclipse.chemclipse.ux.extension.xxd.ui.Activator; +import org.eclipse.chemclipse.ux.extension.xxd.ui.fieldeditors.ColorCodesFieldEditor; +import org.eclipse.jface.preference.ColorFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +public class PreferencePageWellChart extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { + + public PreferencePageWellChart() { + + super(GRID); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setTitle("Well Chart"); + setDescription(""); + } + + @Override + public void createFieldEditors() { + + addField(new SpacerFieldEditor(getFieldEditorParent())); + addField(new ColorFieldEditor(PreferenceConstants.P_PCR_DEFAULT_COLOR, "Default Line Color:", getFieldEditorParent())); + addField(new ColorCodesFieldEditor(PreferenceConstants.P_PCR_WELL_COLOR_CODES, "Color Codes", getFieldEditorParent())); + } + + @Override + public void init(IWorkbench workbench) { + + } +} diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedPlateChartsUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedPlateChartsUI.java index 5f7754b369..80cf62d645 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedPlateChartsUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedPlateChartsUI.java @@ -32,7 +32,7 @@ import org.eclipse.chemclipse.ux.extension.xxd.ui.charts.ChartPCR; import org.eclipse.chemclipse.ux.extension.xxd.ui.model.ColorCodes; import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferenceConstants; -import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePagePCR; +import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePagePlateChart; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; @@ -137,7 +137,7 @@ private void createToolbarMain(Composite parent) { private void createSettingsButton(Composite parent) { - createSettingsButton(parent, Arrays.asList(PreferencePagePCR.class), new ISettingsHandler() { + createSettingsButton(parent, Arrays.asList(PreferencePagePlateChart.class), new ISettingsHandler() { @Override public void apply(Display display) { @@ -223,7 +223,7 @@ private void updateChart() { chartControl.get().deleteSeries(); if(plate != null) { ColorCodes colorCodes = new ColorCodes(); - colorCodes.load(preferenceStore.getString(PreferenceConstants.P_PCR_COLOR_CODES)); + colorCodes.load(preferenceStore.getString(PreferenceConstants.P_PCR_PLATE_COLOR_CODES)); List lineSeriesDataList = new ArrayList(); // for(IWell well : plate.getWells()) { diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java index d5cf242a4b..60fb7de09a 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedWellChartUI.java @@ -8,7 +8,7 @@ * * Contributors: * Dr. Philip Wenig - initial API and implementation - * Matthias Mailänder - add color compensation + * Matthias Mailänder - add color compensation, per channel coloring *******************************************************************************/ package org.eclipse.chemclipse.ux.extension.xxd.ui.swt; @@ -29,7 +29,7 @@ import org.eclipse.chemclipse.ux.extension.xxd.ui.charts.ChartPCR; import org.eclipse.chemclipse.ux.extension.xxd.ui.model.ColorCodes; import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferenceConstants; -import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePagePCR; +import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePageWellChart; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; @@ -183,7 +183,7 @@ public void widgetSelected(SelectionEvent e) { private void createSettingsButton(Composite parent) { - createSettingsButton(parent, Arrays.asList(PreferencePagePCR.class), new ISettingsHandler() { + createSettingsButton(parent, Arrays.asList(PreferencePageWellChart.class), new ISettingsHandler() { @Override public void apply(Display display) { @@ -236,18 +236,19 @@ private void updateChart() { * Extract the channels. */ ColorCodes colorCodes = new ColorCodes(); - colorCodes.load(preferenceStore.getString(PreferenceConstants.P_PCR_COLOR_CODES)); - Color color = getWellColor(well, colorCodes); + colorCodes.load(preferenceStore.getString(PreferenceConstants.P_PCR_WELL_COLOR_CODES)); // List lineSeriesDataList = new ArrayList(); int index = comboChannels.getSelectionIndex(); if(index == 0) { for(IChannel channel : well.getChannels().values()) { + Color color = getChannelColor(channel, colorCodes); addChannelData(channel, lineSeriesDataList, color); } } else { try { IChannel channel = well.getChannels().get(index - 1); + Color color = getChannelColor(channel, colorCodes); addChannelData(channel, lineSeriesDataList, color); } catch(NumberFormatException e) { logger.warn(e); @@ -260,14 +261,14 @@ private void updateChart() { } } - private Color getWellColor(IWell well, ColorCodes colorCodes) { + private Color getChannelColor(IChannel channel, ColorCodes colorCodes) { - String sampleSubset = well.getSampleSubset(); - String targetName = well.getTargetName(); - if(colorCodes.containsKey(sampleSubset)) { - return colorCodes.get(sampleSubset).getColor(); - } else if(colorCodes.containsKey(targetName)) { - return colorCodes.get(targetName).getColor(); + String detectionName = channel.getDetectionName(); + String channelName = channel.getName(); + if(colorCodes.containsKey(detectionName)) { + return colorCodes.get(detectionName).getColor(); + } else if(colorCodes.containsKey(channelName)) { + return colorCodes.get(channelName).getColor(); } else { return Colors.getColor(preferenceStore.getString(PreferenceConstants.P_PCR_DEFAULT_COLOR)); }