Skip to content

Commit

Permalink
Put area percent and best target in front.
Browse files Browse the repository at this point in the history
Adjust space so there is more room for substance name.
  • Loading branch information
Mailaender committed Jan 24, 2025
1 parent fb32b76 commit b76802b
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2024 Lablicate GmbH.
* Copyright (c) 2018, 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 @@ -76,6 +76,8 @@ public class PeakScanListLabelProvider extends AbstractChemClipseLabelProvider {
ACTIVE_FOR_ANALYSIS, //
TYPE, //
RETENTION_TIME, //
AREA_PERCENT, //
BEST_TARGET, //
RELATIVE_RETENTION_TIME, //
RETENTION_INDEX, //
AREA_TOTAL, //
Expand All @@ -90,21 +92,19 @@ public class PeakScanListLabelProvider extends AbstractChemClipseLabelProvider {
DETECTOR, //
INTEGRATOR, //
SUGGESTED_COMPONENTS, //
BEST_TARGET, //
AREA_PERCENT, //
QUANTIFIER, //
CLASSIFIER, //
PEAK_MODEL //
};
//
public static final int[] BOUNDS = { //
30, //
80, //
100, //
100, //
60, //
60, //
60, //
180, //
100, //
100, //
60, //
100, //
100, //
100, //
Expand Down Expand Up @@ -197,35 +197,47 @@ private String getPeakText(IPeak peak, int columnIndex) {
text = decimalFormat.format(peakModel.getRetentionTimeAtPeakMaximum() / IChromatogramOverview.MINUTE_CORRELATION_FACTOR);
break;
case 3:
text = decimalFormat.format(peakModel.getPeakMaximum().getRelativeRetentionTime() / IChromatogramOverview.MINUTE_CORRELATION_FACTOR);
if(chromatogramPeakArea > 0) {
DecimalFormat decimalFormatPercent = ValueFormat.getDecimalFormatEnglish("0.000");
double peakAreaPercent = (100.0d / chromatogramPeakArea) * peak.getIntegratedArea();
text = decimalFormatPercent.format(peakAreaPercent);
} else {
text = NO_VALUE;
}
break;
case 4:
text = TargetSupport.getBestTargetLibraryField(peak);
break;
case 5:
text = decimalFormat.format(peakModel.getPeakMaximum().getRelativeRetentionTime() / IChromatogramOverview.MINUTE_CORRELATION_FACTOR);
break;
case 6:
if(PreferenceSupplierModel.showRetentionIndexWithoutDecimals()) {
DecimalFormat integerFormat = getIntegerDecimalFormatInstance();
text = integerFormat.format(peakModel.getPeakMaximum().getRetentionIndex());
} else {
text = decimalFormat.format(peakModel.getPeakMaximum().getRetentionIndex());
}
break;
case 5:
case 7:
if(PreferenceSupplierModel.showAreaWithoutDecimals()) {
DecimalFormat integerFormat = getIntegerDecimalFormatInstance();
text = integerFormat.format(peak.getIntegratedArea());
} else {
text = decimalFormat.format(peak.getIntegratedArea());
}
break;
case 6:
case 8:
text = decimalFormat.format(peakModel.getStartRetentionTime() / IChromatogramOverview.MINUTE_CORRELATION_FACTOR);
break;
case 7:
case 9:
text = decimalFormat.format(peakModel.getStopRetentionTime() / IChromatogramOverview.MINUTE_CORRELATION_FACTOR);
break;
case 8:
case 10:
text = decimalFormat.format(peakModel.getWidthByInflectionPoints() / IChromatogramOverview.MINUTE_CORRELATION_FACTOR);
break;
case 9:
case 10:
case 11:
case 12:
if(peak instanceof IChromatogramPeakMSD chromatogramPeak) {
switch(columnIndex) {
case 9:
Expand Down Expand Up @@ -256,35 +268,23 @@ private String getPeakText(IPeak peak, int columnIndex) {
}
}
break;
case 11:
text = decimalFormat.format(peakModel.getLeading());
break;
case 12:
text = decimalFormat.format(peakModel.getTailing());
break;
case 13:
text = peak.getModelDescription();
text = decimalFormat.format(peakModel.getLeading());
break;
case 14:
text = peak.getDetectorDescription();
text = decimalFormat.format(peakModel.getTailing());
break;
case 15:
text = peak.getIntegratorDescription();
text = peak.getModelDescription();
break;
case 16:
text = Integer.toString(peak.getSuggestedNumberOfComponents());
text = peak.getDetectorDescription();
break;
case 17:
text = TargetSupport.getBestTargetLibraryField(peak);
text = peak.getIntegratorDescription();
break;
case 18:
if(chromatogramPeakArea > 0) {
DecimalFormat decimalFormatPercent = ValueFormat.getDecimalFormatEnglish("0.000");
double peakAreaPercent = (100.0d / chromatogramPeakArea) * peak.getIntegratedArea();
text = decimalFormatPercent.format(peakAreaPercent);
} else {
text = NO_VALUE;
}
text = Integer.toString(peak.getSuggestedNumberOfComponents());
break;
case 19:
text = (!peak.getInternalStandards().isEmpty()) ? ISTD : BLANK;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2024 Lablicate GmbH.
* Copyright (c) 2018, 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 @@ -74,25 +74,39 @@ private int getSortOrder(Object object1, Object object2) {
sortOrder = Integer.compare(getRetentionTime(object2), getRetentionTime(object1));
break;
case 3:
sortOrder = Integer.compare(getRelativeRetentionTime(object2), getRelativeRetentionTime(object1));
if(chromatogramPeakArea > 0) {
double factor = 100.0d / chromatogramPeakArea;
double peakAreaPercent1 = factor * getIntegratedArea(object1);
double peakAreaPercent2 = factor * getIntegratedArea(object2);
return Double.compare(peakAreaPercent2, peakAreaPercent1);
}
sortOrder = 0;
break;
case 4:
sortOrder = Float.compare(getRetentionIndex(object2), getRetentionIndex(object1));
String name1 = TargetSupport.getBestTargetLibraryField(object1);
String name2 = TargetSupport.getBestTargetLibraryField(object2);
sortOrder = PreferenceSupplierModel.isSortCaseSensitive() ? name2.compareTo(name1) : name2.compareToIgnoreCase(name1);
break;
case 5:
sortOrder = Double.compare(getIntegratedArea(object2), getIntegratedArea(object1));
sortOrder = Integer.compare(getRelativeRetentionTime(object2), getRelativeRetentionTime(object1));
break;
case 6:
sortOrder = Integer.compare(getStartRetentionTime(object2), getStartRetentionTime(object1));
sortOrder = Float.compare(getRetentionIndex(object2), getRetentionIndex(object1));
break;
case 7:
sortOrder = Integer.compare(getStopRetentionTime(object2), getStopRetentionTime(object1));
sortOrder = Double.compare(getIntegratedArea(object2), getIntegratedArea(object1));
break;
case 8:
sortOrder = Integer.compare(getWidth(object2), getWidth(object1));
sortOrder = Integer.compare(getStartRetentionTime(object2), getStartRetentionTime(object1));
break;
case 9:
sortOrder = Integer.compare(getStopRetentionTime(object2), getStopRetentionTime(object1));
break;
case 10:
sortOrder = Integer.compare(getWidth(object2), getWidth(object1));
break;
case 11:
case 12:
if(object1 instanceof IChromatogramPeakMSD chromatogramPeak1 && object2 instanceof IChromatogramPeakMSD chromatogramPeak2) {
switch(getPropertyIndex()) {
case 9:
Expand Down Expand Up @@ -122,37 +136,23 @@ private int getSortOrder(Object object1, Object object2) {
}
}
break;
case 11:
sortOrder = Float.compare(getLeading(object2), getLeading(object1));
break;
case 12:
sortOrder = Float.compare(getTailing(object2), getTailing(object1));
break;
case 13:
sortOrder = getModelDescription(object2).compareTo(getModelDescription(object1));
sortOrder = Float.compare(getLeading(object2), getLeading(object1));
break;
case 14:
sortOrder = getDetectorDescription(object2).compareTo(getDetectorDescription(object1));
sortOrder = Float.compare(getTailing(object2), getTailing(object1));
break;
case 15:
sortOrder = getIntegratorDescription(object2).compareTo(getIntegratorDescription(object1));
sortOrder = getModelDescription(object2).compareTo(getModelDescription(object1));
break;
case 16:
sortOrder = Integer.compare(getSuggestedNumberOfComponents(object2), getSuggestedNumberOfComponents(object1));
sortOrder = getDetectorDescription(object2).compareTo(getDetectorDescription(object1));
break;
case 17:
String name1 = TargetSupport.getBestTargetLibraryField(object1);
String name2 = TargetSupport.getBestTargetLibraryField(object2);
sortOrder = PreferenceSupplierModel.isSortCaseSensitive() ? name2.compareTo(name1) : name2.compareToIgnoreCase(name1);
sortOrder = getIntegratorDescription(object2).compareTo(getIntegratorDescription(object1));
break;
case 18:
if(chromatogramPeakArea > 0) {
double factor = 100.0d / chromatogramPeakArea;
double peakAreaPercent1 = factor * getIntegratedArea(object1);
double peakAreaPercent2 = factor * getIntegratedArea(object2);
return Double.compare(peakAreaPercent2, peakAreaPercent1);
}
sortOrder = 0;
sortOrder = Integer.compare(getSuggestedNumberOfComponents(object2), getSuggestedNumberOfComponents(object1));
break;
case 19:
sortOrder = Integer.compare(getInternalStandards(object2), getInternalStandards(object1));
Expand Down

0 comments on commit b76802b

Please sign in to comment.