Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added per channel coloring to the Well Chart #673

Merged
merged 5 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

}
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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<ILineSeriesData> lineSeriesDataList = new ArrayList<ILineSeriesData>();
//
for(IWell well : plate.getWells()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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 {

Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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));
//
Mailaender marked this conversation as resolved.
Show resolved Hide resolved
buttonToolbarInfo = createButtonToggleToolbar(composite, toolbarInfo, IMAGE_INFO, TOOLTIP_INFO);
createResetButton(composite);
createSettingsButton(composite);
}

private void createResetButton(Composite parent) {
Expand All @@ -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);
Expand Down
Loading