Java Code Examples for javax.swing.SortOrder#DESCENDING
The following examples show how to use
javax.swing.SortOrder#DESCENDING .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultRowSorter.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private SortKey toggle(SortKey key) { if (key.getSortOrder() == SortOrder.ASCENDING) { return new SortKey(key.getColumn(), SortOrder.DESCENDING); } return new SortKey(key.getColumn(), SortOrder.ASCENDING); }
Example 2
Source File: DefaultRowSorter.java From Java8CN with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") private int compare(int model1, int model2) { int column; SortOrder sortOrder; Object v1, v2; int result; for (int counter = 0; counter < cachedSortKeys.length; counter++) { column = cachedSortKeys[counter].getColumn(); sortOrder = cachedSortKeys[counter].getSortOrder(); if (sortOrder == SortOrder.UNSORTED) { result = model1 - model2; } else { // v1 != null && v2 != null if (useToString[column]) { v1 = getModelWrapper().getStringValueAt(model1, column); v2 = getModelWrapper().getStringValueAt(model2, column); } else { v1 = getModelWrapper().getValueAt(model1, column); v2 = getModelWrapper().getValueAt(model2, column); } // Treat nulls as < then non-null if (v1 == null) { if (v2 == null) { result = 0; } else { result = -1; } } else if (v2 == null) { result = 1; } else { result = sortComparators[counter].compare(v1, v2); } if (sortOrder == SortOrder.DESCENDING) { result *= -1; } } if (result != 0) { return result; } } // If we get here, they're equal. Fallback to model order. return model1 - model2; }
Example 3
Source File: DefaultRowSorter.java From Java8CN with Apache License 2.0 | 4 votes |
private SortKey toggle(SortKey key) { if (key.getSortOrder() == SortOrder.ASCENDING) { return new SortKey(key.getColumn(), SortOrder.DESCENDING); } return new SortKey(key.getColumn(), SortOrder.ASCENDING); }
Example 4
Source File: DefaultRowSorter.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@SuppressWarnings("unchecked") private int compare(int model1, int model2) { int column; SortOrder sortOrder; Object v1, v2; int result; for (int counter = 0; counter < cachedSortKeys.length; counter++) { column = cachedSortKeys[counter].getColumn(); sortOrder = cachedSortKeys[counter].getSortOrder(); if (sortOrder == SortOrder.UNSORTED) { result = model1 - model2; } else { // v1 != null && v2 != null if (useToString[column]) { v1 = getModelWrapper().getStringValueAt(model1, column); v2 = getModelWrapper().getStringValueAt(model2, column); } else { v1 = getModelWrapper().getValueAt(model1, column); v2 = getModelWrapper().getValueAt(model2, column); } // Treat nulls as < then non-null if (v1 == null) { if (v2 == null) { result = 0; } else { result = -1; } } else if (v2 == null) { result = 1; } else { result = sortComparators[counter].compare(v1, v2); } if (sortOrder == SortOrder.DESCENDING) { result *= -1; } } if (result != 0) { return result; } } // If we get here, they're equal. Fallback to model order. return model1 - model2; }
Example 5
Source File: DefaultRowSorter.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
private SortKey toggle(SortKey key) { if (key.getSortOrder() == SortOrder.ASCENDING) { return new SortKey(key.getColumn(), SortOrder.DESCENDING); } return new SortKey(key.getColumn(), SortOrder.ASCENDING); }
Example 6
Source File: DefaultRowSorter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
@SuppressWarnings("unchecked") private int compare(int model1, int model2) { int column; SortOrder sortOrder; Object v1, v2; int result; for (int counter = 0; counter < cachedSortKeys.length; counter++) { column = cachedSortKeys[counter].getColumn(); sortOrder = cachedSortKeys[counter].getSortOrder(); if (sortOrder == SortOrder.UNSORTED) { result = model1 - model2; } else { // v1 != null && v2 != null if (useToString[column]) { v1 = getModelWrapper().getStringValueAt(model1, column); v2 = getModelWrapper().getStringValueAt(model2, column); } else { v1 = getModelWrapper().getValueAt(model1, column); v2 = getModelWrapper().getValueAt(model2, column); } // Treat nulls as < then non-null if (v1 == null) { if (v2 == null) { result = 0; } else { result = -1; } } else if (v2 == null) { result = 1; } else { result = sortComparators[counter].compare(v1, v2); } if (sortOrder == SortOrder.DESCENDING) { result *= -1; } } if (result != 0) { return result; } } // If we get here, they're equal. Fallback to model order. return model1 - model2; }
Example 7
Source File: DefaultRowSorter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private SortKey toggle(SortKey key) { if (key.getSortOrder() == SortOrder.ASCENDING) { return new SortKey(key.getColumn(), SortOrder.DESCENDING); } return new SortKey(key.getColumn(), SortOrder.ASCENDING); }
Example 8
Source File: ProfilerRowSorter.java From netbeans with Apache License 2.0 | 4 votes |
private SortOrder getSortOrder(String sortOrder) { if (SortOrder.ASCENDING.toString().equals(sortOrder)) return SortOrder.ASCENDING; else if (SortOrder.DESCENDING.toString().equals(sortOrder)) return SortOrder.DESCENDING; else return SortOrder.UNSORTED; }
Example 9
Source File: DefaultRowSorter.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
@SuppressWarnings("unchecked") private int compare(int model1, int model2) { int column; SortOrder sortOrder; Object v1, v2; int result; for (int counter = 0; counter < cachedSortKeys.length; counter++) { column = cachedSortKeys[counter].getColumn(); sortOrder = cachedSortKeys[counter].getSortOrder(); if (sortOrder == SortOrder.UNSORTED) { result = model1 - model2; } else { // v1 != null && v2 != null if (useToString[column]) { v1 = getModelWrapper().getStringValueAt(model1, column); v2 = getModelWrapper().getStringValueAt(model2, column); } else { v1 = getModelWrapper().getValueAt(model1, column); v2 = getModelWrapper().getValueAt(model2, column); } // Treat nulls as < then non-null if (v1 == null) { if (v2 == null) { result = 0; } else { result = -1; } } else if (v2 == null) { result = 1; } else { result = sortComparators[counter].compare(v1, v2); } if (sortOrder == SortOrder.DESCENDING) { result *= -1; } } if (result != 0) { return result; } } // If we get here, they're equal. Fallback to model order. return model1 - model2; }
Example 10
Source File: DefaultRowSorter.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@SuppressWarnings("unchecked") private int compare(int model1, int model2) { int column; SortOrder sortOrder; Object v1, v2; int result; for (int counter = 0; counter < cachedSortKeys.length; counter++) { column = cachedSortKeys[counter].getColumn(); sortOrder = cachedSortKeys[counter].getSortOrder(); if (sortOrder == SortOrder.UNSORTED) { result = model1 - model2; } else { // v1 != null && v2 != null if (useToString[column]) { v1 = getModelWrapper().getStringValueAt(model1, column); v2 = getModelWrapper().getStringValueAt(model2, column); } else { v1 = getModelWrapper().getValueAt(model1, column); v2 = getModelWrapper().getValueAt(model2, column); } // Treat nulls as < then non-null if (v1 == null) { if (v2 == null) { result = 0; } else { result = -1; } } else if (v2 == null) { result = 1; } else { result = sortComparators[counter].compare(v1, v2); } if (sortOrder == SortOrder.DESCENDING) { result *= -1; } } if (result != 0) { return result; } } // If we get here, they're equal. Fallback to model order. return model1 - model2; }
Example 11
Source File: DefaultRowSorter.java From hottub with GNU General Public License v2.0 | 4 votes |
@SuppressWarnings("unchecked") private int compare(int model1, int model2) { int column; SortOrder sortOrder; Object v1, v2; int result; for (int counter = 0; counter < cachedSortKeys.length; counter++) { column = cachedSortKeys[counter].getColumn(); sortOrder = cachedSortKeys[counter].getSortOrder(); if (sortOrder == SortOrder.UNSORTED) { result = model1 - model2; } else { // v1 != null && v2 != null if (useToString[column]) { v1 = getModelWrapper().getStringValueAt(model1, column); v2 = getModelWrapper().getStringValueAt(model2, column); } else { v1 = getModelWrapper().getValueAt(model1, column); v2 = getModelWrapper().getValueAt(model2, column); } // Treat nulls as < then non-null if (v1 == null) { if (v2 == null) { result = 0; } else { result = -1; } } else if (v2 == null) { result = 1; } else { result = sortComparators[counter].compare(v1, v2); } if (sortOrder == SortOrder.DESCENDING) { result *= -1; } } if (result != 0) { return result; } } // If we get here, they're equal. Fallback to model order. return model1 - model2; }
Example 12
Source File: DefaultRowSorter.java From JDKSourceCode1.8 with MIT License | 4 votes |
@SuppressWarnings("unchecked") private int compare(int model1, int model2) { int column; SortOrder sortOrder; Object v1, v2; int result; for (int counter = 0; counter < cachedSortKeys.length; counter++) { column = cachedSortKeys[counter].getColumn(); sortOrder = cachedSortKeys[counter].getSortOrder(); if (sortOrder == SortOrder.UNSORTED) { result = model1 - model2; } else { // v1 != null && v2 != null if (useToString[column]) { v1 = getModelWrapper().getStringValueAt(model1, column); v2 = getModelWrapper().getStringValueAt(model2, column); } else { v1 = getModelWrapper().getValueAt(model1, column); v2 = getModelWrapper().getValueAt(model2, column); } // Treat nulls as < then non-null if (v1 == null) { if (v2 == null) { result = 0; } else { result = -1; } } else if (v2 == null) { result = 1; } else { result = sortComparators[counter].compare(v1, v2); } if (sortOrder == SortOrder.DESCENDING) { result *= -1; } } if (result != 0) { return result; } } // If we get here, they're equal. Fallback to model order. return model1 - model2; }
Example 13
Source File: DefaultRowSorter.java From JDKSourceCode1.8 with MIT License | 4 votes |
private SortKey toggle(SortKey key) { if (key.getSortOrder() == SortOrder.ASCENDING) { return new SortKey(key.getColumn(), SortOrder.DESCENDING); } return new SortKey(key.getColumn(), SortOrder.ASCENDING); }
Example 14
Source File: DefaultRowSorter.java From hottub with GNU General Public License v2.0 | 4 votes |
private SortKey toggle(SortKey key) { if (key.getSortOrder() == SortOrder.ASCENDING) { return new SortKey(key.getColumn(), SortOrder.DESCENDING); } return new SortKey(key.getColumn(), SortOrder.ASCENDING); }
Example 15
Source File: DefaultRowSorter.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private SortKey toggle(SortKey key) { if (key.getSortOrder() == SortOrder.ASCENDING) { return new SortKey(key.getColumn(), SortOrder.DESCENDING); } return new SortKey(key.getColumn(), SortOrder.ASCENDING); }
Example 16
Source File: DefaultRowSorter.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@SuppressWarnings("unchecked") private int compare(int model1, int model2) { int column; SortOrder sortOrder; Object v1, v2; int result; for (int counter = 0; counter < cachedSortKeys.length; counter++) { column = cachedSortKeys[counter].getColumn(); sortOrder = cachedSortKeys[counter].getSortOrder(); if (sortOrder == SortOrder.UNSORTED) { result = model1 - model2; } else { // v1 != null && v2 != null if (useToString[column]) { v1 = getModelWrapper().getStringValueAt(model1, column); v2 = getModelWrapper().getStringValueAt(model2, column); } else { v1 = getModelWrapper().getValueAt(model1, column); v2 = getModelWrapper().getValueAt(model2, column); } // Treat nulls as < then non-null if (v1 == null) { if (v2 == null) { result = 0; } else { result = -1; } } else if (v2 == null) { result = 1; } else { result = sortComparators[counter].compare(v1, v2); } if (sortOrder == SortOrder.DESCENDING) { result *= -1; } } if (result != 0) { return result; } } // If we get here, they're equal. Fallback to model order. return model1 - model2; }
Example 17
Source File: DefaultRowSorter.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private SortKey toggle(SortKey key) { if (key.getSortOrder() == SortOrder.ASCENDING) { return new SortKey(key.getColumn(), SortOrder.DESCENDING); } return new SortKey(key.getColumn(), SortOrder.ASCENDING); }
Example 18
Source File: DefaultRowSorter.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
private SortKey toggle(SortKey key) { if (key.getSortOrder() == SortOrder.ASCENDING) { return new SortKey(key.getColumn(), SortOrder.DESCENDING); } return new SortKey(key.getColumn(), SortOrder.ASCENDING); }
Example 19
Source File: ProfilerRowSorter.java From visualvm with GNU General Public License v2.0 | 4 votes |
private SortOrder getSortOrder(String sortOrder) { if (SortOrder.ASCENDING.toString().equals(sortOrder)) return SortOrder.ASCENDING; else if (SortOrder.DESCENDING.toString().equals(sortOrder)) return SortOrder.DESCENDING; else return SortOrder.UNSORTED; }
Example 20
Source File: DefaultRowSorter.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") private int compare(int model1, int model2) { int column; SortOrder sortOrder; Object v1, v2; int result; for (int counter = 0; counter < cachedSortKeys.length; counter++) { column = cachedSortKeys[counter].getColumn(); sortOrder = cachedSortKeys[counter].getSortOrder(); if (sortOrder == SortOrder.UNSORTED) { result = model1 - model2; } else { // v1 != null && v2 != null if (useToString[column]) { v1 = getModelWrapper().getStringValueAt(model1, column); v2 = getModelWrapper().getStringValueAt(model2, column); } else { v1 = getModelWrapper().getValueAt(model1, column); v2 = getModelWrapper().getValueAt(model2, column); } // Treat nulls as < then non-null if (v1 == null) { if (v2 == null) { result = 0; } else { result = -1; } } else if (v2 == null) { result = 1; } else { result = sortComparators[counter].compare(v1, v2); } if (sortOrder == SortOrder.DESCENDING) { result *= -1; } } if (result != 0) { return result; } } // If we get here, they're equal. Fallback to model order. return model1 - model2; }