Issue #3025 - Fix incorrect sort algorithm.
Change-Id: Ied1ec59a8703c1f7476793d3896a253ec6aa2707 Former-commit-id: 9c275288183b93ba5cac991dbbdf72bdf122ad0a
This commit is contained in:
parent
7afb1e66f5
commit
0b9f8ce7f1
1 changed files with 23 additions and 19 deletions
|
@ -104,7 +104,8 @@ import com.raytheon.viz.mpe.ui.dialogs.gagetable.xml.GageTableSortType;
|
||||||
* May 28, 2009 2476 mpduff Initial creation.
|
* May 28, 2009 2476 mpduff Initial creation.
|
||||||
* Mar 08, 2013 15725 snaples Updated to fix resort issues when editing value.
|
* Mar 08, 2013 15725 snaples Updated to fix resort issues when editing value.
|
||||||
* Jan 28, 2014 16994 snaples Updated populateGridCombo to get correct filename prefix for matching up selection.
|
* Jan 28, 2014 16994 snaples Updated populateGridCombo to get correct filename prefix for matching up selection.
|
||||||
* Feb 2, 2014 16201 snaples Added saved data flag support
|
* Feb 02, 2014 16201 snaples Added saved data flag support
|
||||||
|
* Apr 16, 2014 3025 mpduff Fix sort method.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -488,8 +489,8 @@ public class GageTableDlg extends JFrame implements IEditTimeChangedListener {
|
||||||
for (int i = 0; i < columnData.size(); i++) {
|
for (int i = 0; i < columnData.size(); i++) {
|
||||||
if (columnData.get(i).isDataColumn()) {
|
if (columnData.get(i).isDataColumn()) {
|
||||||
gridCombo.addItem(columnData.get(i).getName());
|
gridCombo.addItem(columnData.get(i).getName());
|
||||||
if (selectedGrid
|
if (selectedGrid.equalsIgnoreCase(columnData.get(i)
|
||||||
.equalsIgnoreCase(columnData.get(i).getProductDescriptor().getProductFilenamePrefix())) {
|
.getProductDescriptor().getProductFilenamePrefix())) {
|
||||||
gridComboSelection = gridSelectionIndex;
|
gridComboSelection = gridSelectionIndex;
|
||||||
}
|
}
|
||||||
gridSelectionIndex++;
|
gridSelectionIndex++;
|
||||||
|
@ -1137,20 +1138,24 @@ public class GageTableDlg extends JFrame implements IEditTimeChangedListener {
|
||||||
response = -1;
|
response = -1;
|
||||||
} else {
|
} else {
|
||||||
if (ascending) {
|
if (ascending) {
|
||||||
if (o1.toString().trim().equalsIgnoreCase("M")) {
|
// Check for equality first
|
||||||
response = -1;
|
response = o1.compareTo(o2);
|
||||||
} else if (o2.toString().trim().equalsIgnoreCase("M")) {
|
if (response != 0) {
|
||||||
response = 1;
|
if (o1.toString().trim().equalsIgnoreCase("M")) {
|
||||||
} else {
|
response = -1;
|
||||||
response = o1.compareTo(o2);
|
} else if (o2.toString().trim().equalsIgnoreCase("M")) {
|
||||||
|
response = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (o1.toString().trim().equalsIgnoreCase("M")) {
|
// Check for equality first
|
||||||
response = 1;
|
response = o1.compareTo(o2);
|
||||||
} else if (o2.toString().trim().equalsIgnoreCase("M")) {
|
if (response != 0) {
|
||||||
response = -1;
|
if (o1.toString().trim().equalsIgnoreCase("M")) {
|
||||||
} else {
|
response = 1;
|
||||||
response = o2.compareTo(o1);
|
} else if (o2.toString().trim().equalsIgnoreCase("M")) {
|
||||||
|
response = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1316,12 +1321,11 @@ public class GageTableDlg extends JFrame implements IEditTimeChangedListener {
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDataChanged(boolean dataChanged)
|
public void setDataChanged(boolean dataChanged) {
|
||||||
{
|
this.dataChanged = dataChanged;
|
||||||
this.dataChanged = dataChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the sort order of the columns.
|
* Set the sort order of the columns.
|
||||||
*
|
*
|
||||||
* @param settings
|
* @param settings
|
||||||
|
|
Loading…
Add table
Reference in a new issue