Skip to content
Open
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 @@ -13,6 +13,7 @@
package org.eclipse.chemclipse.model.filter;

import java.util.Collection;
import java.util.List;

import org.eclipse.chemclipse.model.core.IPeak;
import org.eclipse.chemclipse.model.selection.IChromatogramSelection;
Expand Down Expand Up @@ -67,4 +68,6 @@ default DataCategory[] getDataCategories() {

return new DataCategory[]{DataCategory.CSD, DataCategory.MSD, DataCategory.WSD, DataCategory.VSD};
}

List<String> getLegacyIDs();
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,11 @@ private void doFilter(IChromatogramSelection chromatogramSelection, ConfigType p

filter.filterPeaks(chromatogramSelection, processSettings, context);
}

@Override
public boolean matchesId(String id) {

return super.matchesId(id) || filter.getLegacyIDs().contains(id);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2024 Lablicate GmbH.
* Copyright (c) 2019, 2025 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 Down Expand Up @@ -44,7 +44,7 @@ public JavaType findTypeMapping(DeserializationConfig config, JavaType type) {

Class<?> sourceClass = type.getRawClass();
Class<?> destinationClass = MAPPINGS.get(sourceClass);
//

if(destinationClass == null) {
return null;
}
Expand Down Expand Up @@ -78,7 +78,7 @@ public Map<InputValue, Object> fromObject(Collection<? extends InputValue> input
}
}
}
//

return resultMap;
}

Expand All @@ -88,7 +88,7 @@ private Map<String, InputValue> getInputValueMap(Collection<? extends InputValue
for(InputValue inputValue : inputValues) {
inputValueMap.put(inputValue.getName(), inputValue);
}
//

return inputValueMap;
}

Expand All @@ -107,7 +107,7 @@ public String toString(Map<InputValue, Object> values) throws IOException {
private ObjectMapper createMapper() {

ObjectMapper objectMapper = new ObjectMapper();
//

SimpleModule simpleModule = new SimpleModule("ChemClipse", Version.unknownVersion());
simpleModule.setAbstractTypes(RESOLVER);
/*
Expand All @@ -123,10 +123,10 @@ private ObjectMapper createMapper() {
}
}
}
//

objectMapper.registerModule(simpleModule);
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
//

return objectMapper;
}

Expand Down Expand Up @@ -157,4 +157,4 @@ public static <T> void removeMapping(Class<T> superType, Class<? extends T> subT

MAPPINGS.remove(superType, subType);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class MethodListLabelProvider extends AbstractChemClipseLabelProvider {

private final IProcessSupplierContext processTypeSupport;
private BiFunction<IProcessEntry, IProcessSupplierContext, IProcessorPreferences<?>> preferencesSupplier;
//

public static final String[] TITLES = {//
"", //
ExtensionMessages.name, //
Expand All @@ -44,7 +44,7 @@ public class MethodListLabelProvider extends AbstractChemClipseLabelProvider {
ExtensionMessages.settings, //
ExtensionMessages.id //
};
//

public static final int[] BOUNDS = {//
50, //
250, //
Expand All @@ -69,7 +69,7 @@ public Image getColumnImage(Object element, int columnIndex) {
* Validate
*/
IStatus status = validate(processEntry);
//

if(status.matches(IStatus.ERROR)) {
return ApplicationImageFactory.getInstance().getImage(IApplicationImage.IMAGE_STATUS_ERROR, IApplicationImageProvider.SIZE_16x16);
}
Expand Down Expand Up @@ -109,11 +109,11 @@ public String getColumnText(Object element, int columnIndex) {
if(columnIndex == 0) {
return "";
}
//

if(element instanceof IProcessEntry processEntry) {
IProcessSupplierContext supplierContext = IProcessEntry.getContext(processEntry, processTypeSupport);
IProcessSupplier<?> processSupplier = supplierContext.getSupplier(processEntry.getProcessorId());
//

switch(columnIndex) {
case 1:
return processEntry.getName();
Expand Down Expand Up @@ -159,7 +159,7 @@ public String getColumnText(Object element, int columnIndex) {
return "";
}
}
//

return "n/a";
}

Expand All @@ -177,11 +177,11 @@ private IStatus validate(IProcessEntry processEntry) {
if(processEntry == null) {
return ValidationStatus.error(ExtensionMessages.processorNotAvailable);
}
//

if(preferencesSupplier == null) {
return ValidationStatus.error(ExtensionMessages.preferenceSupplierNotAvailable);
}
//

if(processTypeSupport == null) {
return ValidationStatus.error(ExtensionMessages.processTypeSupportNotAvailable);
}
Expand All @@ -192,15 +192,15 @@ private IStatus validate(IProcessEntry processEntry) {
return ValidationStatus.info(MessageFormat.format(ExtensionMessages.processorSkipValidationOptionSet, processEntry.getName()));
}
IProcessorPreferences<?> processorPreferences = preferencesSupplier.apply(processEntry, processTypeSupport);
//

if(processorPreferences == null) {
return ValidationStatus.error(MessageFormat.format(ExtensionMessages.processorPreferencesNotAvailable, processEntry.getName()));
}
//

if(processorPreferences.getSupplier().getSettingsClass() == null) {
return ValidationStatus.warning(MessageFormat.format(ExtensionMessages.processorHasNoSettingsClass, processEntry.getName()));
}
//

if(processorPreferences.isUseSystemDefaults()) {
return ValidationStatus.info(MessageFormat.format(ExtensionMessages.processorUsesSystemDefaultSettings, processEntry.getName()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
public class MethodTreeViewer extends TreeViewer {

private final TreeViewerColumn[] columns = new TreeViewerColumn[MethodListLabelProvider.TITLES.length];
//

private IProcessSupplierContext processingSupport;
private BiFunction<IProcessEntry, IProcessSupplierContext, IProcessorPreferences<?>> preferencesSupplier;
private AtomicReference<ProcessMethodToolbar> toolbarButtons;
//

private IUpdateListener updateListener = null;

public MethodTreeViewer(Composite parent, int style) {
Expand All @@ -61,12 +61,12 @@ public void createControl(IProcessSupplierContext processingSupport, BiFunction<
this.processingSupport = processingSupport;
this.preferencesSupplier = preferencesSupplier;
this.toolbarButtons = toolbarButtons;
//

setUseHashlookup(true);
setExpandPreCheckFilters(true);
getTree().setLinesVisible(true);
getTree().setHeaderVisible(true);
//

enableTooltips(enableTooltips);
createTree();
}
Expand Down Expand Up @@ -112,11 +112,11 @@ public boolean hasChildren(Object element) {
return processEntryContainer.getNumberOfEntries() > 0;
}
}
//

if(element instanceof ProcessEntryContainer processEntryContainer) {
return processEntryContainer.getNumberOfEntries() > 0;
}
//

return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.chemclipse.xxd.filter.peaks;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -54,4 +55,10 @@ protected void resetPeakSelection(IChromatogramSelection chromatogramSelection)
chromatogramSelection.setSelectedPeak(null);
chromatogramSelection.getChromatogram().setDirty(true);
}

@Override
public List<String> getLegacyIDs() {

return new ArrayList<>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,12 @@ private void processPeak(TreatmentOption treatmentOption, IPeak peak, AreaPredic
throw new IllegalArgumentException("Unsupported Peak Filter Treatment Option!");
}
}

@Override
public List<String> getLegacyIDs() {

List<String> legacyIDs = new ArrayList<>();
legacyIDs.add("PeakFilter:filter:processor:class:org.eclipse.chemclipse.xxd.model.filter.peaks.AreaFilter");
return legacyIDs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,12 @@ private static void processPeak(TreatmentOption treatmentOption, IPeak peak, dou
throw new IllegalArgumentException("Unsupported Peak Filter Treatment Option!");
}
}

@Override
public List<String> getLegacyIDs() {

List<String> legacyIDs = new ArrayList<>();
legacyIDs.add("PeakFilter:filter:processor:class:org.eclipse.chemclipse.xxd.model.filter.peaks.AreaPercentFilter");
return legacyIDs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ public Class<AsymmetryFilterSettings> getConfigClass() {
public void filterPeaks(IChromatogramSelection chromatogramSelection, AsymmetryFilterSettings configuration, ProcessExecutionContext context) throws IllegalArgumentException {

Collection<IPeak> peaks = getReadOnlyPeaks(chromatogramSelection);
//

if(configuration == null) {
configuration = createConfiguration(peaks);
}
//

SubMonitor subMonitor = SubMonitor.convert(context.getProgressMonitor(), peaks.size());
FactorPredicate<?> predicate = getPredicate(configuration);
TreatmentOption treatmentOption = configuration.getFilterTreatmentOption();
Expand All @@ -93,7 +93,7 @@ public void filterPeaks(IChromatogramSelection chromatogramSelection, AsymmetryF
processPeak(treatmentOption, peak, predicate, peaksToDelete);
subMonitor.worked(1);
}
//

deletePeaks(peaksToDelete, chromatogramSelection);
resetPeakSelection(chromatogramSelection);
}
Expand Down Expand Up @@ -138,4 +138,12 @@ private void processPeak(TreatmentOption treatmentOption, IPeak peak, FactorPred
throw new IllegalArgumentException("Unsupported Peak Filter Treatment Option!");
}
}

@Override
public List<String> getLegacyIDs() {

List<String> legacyIDs = new ArrayList<>();
legacyIDs.add("PeakFilter:filter:processor:class:org.eclipse.chemclipse.xxd.model.filter.peaks.AsymmetryFilter");
return legacyIDs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
*******************************************************************************/
package org.eclipse.chemclipse.xxd.filter.peaks;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;

import org.eclipse.chemclipse.model.core.IPeak;
Expand Down Expand Up @@ -53,10 +55,10 @@ public void filterPeaks(IChromatogramSelection chromatogramSelection, Classified
if(configuration == null) {
configuration = createConfiguration(peaks);
}
//

Set<String> classifications = configuration.getClassificationSet();
boolean activeForAnalysis = configuration.isActiveForAnalysis();
//

SubMonitor subMonitor = SubMonitor.convert(context.getProgressMonitor(), peaks.size());
for(IPeak peak : peaks) {
Collection<String> classifier = peak.getClassifier();
Expand All @@ -70,4 +72,12 @@ public void filterPeaks(IChromatogramSelection chromatogramSelection, Classified
}
subMonitor.done();
}

@Override
public List<String> getLegacyIDs() {

List<String> legacyIDs = new ArrayList<>();
legacyIDs.add("PeakFilter:filter:processor:class:org.eclipse.chemclipse.xxd.model.filter.peaks.ClassifiedPeaksFilter");
return legacyIDs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
*******************************************************************************/
package org.eclipse.chemclipse.xxd.filter.peaks;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.eclipse.chemclipse.model.core.IPeak;
import org.eclipse.chemclipse.model.filter.IPeakFilter;
Expand Down Expand Up @@ -59,4 +61,12 @@ public void filterPeaks(IChromatogramSelection chromatogramSelection, DeleteInte
}
}
}

@Override
public List<String> getLegacyIDs() {

List<String> legacyIDs = new ArrayList<>();
legacyIDs.add("PeakFilter:filter:processor:class:org.eclipse.chemclipse.xxd.model.filter.peaks.DeleteIntegrationsFilter");
return legacyIDs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,12 @@ public void filterPeaks(IChromatogramSelection chromatogramSelection, DeletePeak
resetPeakSelection(chromatogramSelection);
}
}

@Override
public List<String> getLegacyIDs() {

List<String> legacyIDs = new ArrayList<>();
legacyIDs.add("PeakFilter:filter:processor:class:org.eclipse.chemclipse.xxd.model.filter.peaks.DeletePeaksByModelFilter");
return legacyIDs;
}
}
Loading