當前位置: 首頁>>代碼示例>>Java>>正文


Java SortOrder類代碼示例

本文整理匯總了Java中org.jdesktop.swingx.decorator.SortOrder的典型用法代碼示例。如果您正苦於以下問題:Java SortOrder類的具體用法?Java SortOrder怎麽用?Java SortOrder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SortOrder類屬於org.jdesktop.swingx.decorator包,在下文中一共展示了SortOrder類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTableCellRendererComponent

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus, int rowIndex, int columnIndex) {
        Component comp = configureDelegate(table, value, isSelected, hasFocus, rowIndex,
                columnIndex);
        if ((table instanceof JXTable) && (comp instanceof JComponent)) {
            // work-around core issues
            hackBorder((JComponent) comp);
            SortOrder sortOrder = ((JXTable) table).getSortOrder(columnIndex);
//            Border border = UIManager.getBorder("TableHeader.cellBorder");
//            LOG.info("in renderer: " + UIManager.getBorder("TableHeader.cellBorder"));
            if (sortOrder.isSorted()) {
                iconBorder.setIcon(sortOrder.isAscending() ? upIcon : downIcon);
                Border origBorder = ((JComponent) comp).getBorder();
                Border border = new CompoundBorder(origBorder, iconBorder);
                ((JComponent) comp).setBorder(border);
            }
        }
        adjustComponentOrientation(comp);
        return comp;
    }
 
開發者ID:sing-group,項目名稱:aibench-project,代碼行數:21,代碼來源:ColumnHeaderRenderer.java

示例2: toggleSortOrder

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
@Override
public void toggleSortOrder(Object identifier) {
    super.toggleSortOrder(identifier);
    
    TableColumnExt columnExt = getColumnExt(identifier);
    int index = columnExt.getModelIndex();
    
    SortOrder so = SortOrder.UNSORTED;
    SortController sortController = getSortController();
    if (sortController != null)
    {
        so = sortController.getSortOrder(index);
    }
    
    fireSortChangedListenerSortChanged(new SortChangedEvent(this, index, so ) );
}
 
開發者ID:JockiHendry,項目名稱:ireport-fork,代碼行數:17,代碼來源:JDragTable.java

示例3: setSortOrder

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
@Override
public void setSortOrder(Object identifier, SortOrder arg1) {
    super.setSortOrder(identifier, arg1);
    
    TableColumnExt columnExt = getColumnExt(identifier);
    int index = columnExt.getModelIndex();
    
    SortOrder so = SortOrder.UNSORTED;
    SortController sortController = getSortController();
    if (sortController != null)
    {
        so = sortController.getSortOrder(index);
    }
    
    fireSortChangedListenerSortChanged(new SortChangedEvent(this, index, so ) );
}
 
開發者ID:JockiHendry,項目名稱:ireport-fork,代碼行數:17,代碼來源:JDragTable.java

示例4: getSortOrder

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
/**
 * Returns the SortOrder. 
 * 
 * @return the interactive sorter's SortOrder  
 *  or SortOrder.UNSORTED 
 */
public SortOrder getSortOrder() {
    SortController sortController = getSortController();
    if (sortController == null) return SortOrder.UNSORTED;
    SortKey sortKey = SortKey.getFirstSortKeyForColumn(sortController.getSortKeys(), 
            0);
    return sortKey != null ? sortKey.getSortOrder() : SortOrder.UNSORTED;
}
 
開發者ID:sing-group,項目名稱:aibench-project,代碼行數:14,代碼來源:JXList.java

示例5: getSortOrder

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
/**
 * Returns the SortOrder of the given column. 
 * 
 * @param columnIndex the column index in view coordinates.
 * @return the interactive sorter's SortOrder if matches the column 
 *  or SortOrder.UNSORTED 
 */
public SortOrder getSortOrder(int columnIndex) {
    SortController sortController = getSortController();
    if (sortController == null) return SortOrder.UNSORTED;
    SortKey sortKey = SortKey.getFirstSortKeyForColumn(sortController.getSortKeys(), 
            convertColumnIndexToModel(columnIndex));
    return sortKey != null ? sortKey.getSortOrder() : SortOrder.UNSORTED;
}
 
開發者ID:sing-group,項目名稱:aibench-project,代碼行數:15,代碼來源:JXTable.java

示例6: SortChangedEvent

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
/** Creates a new instance of ValueChangedEvent 
 * @param source 
 * @param sortColumn 
 * @param sortType 
 */
public SortChangedEvent(Object source, int sortColumn, SortOrder sortType) {
    
    this.source = source;
    this.sortColumn = sortColumn;
    this.sortType = sortType;
}
 
開發者ID:JockiHendry,項目名稱:ireport-fork,代碼行數:12,代碼來源:SortChangedEvent.java

示例7: setSortOrder

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
/**
 * Sorts the table by the given column using SortOrder. 
 * 
 * 
 * Respects the tableColumnExt's sortable and comparator 
 * properties: routes the column's comparator to the SortController
 * and does nothing if !isSortable(column). 
 * <p>
 * 
 * PRE: 0 <= columnIndex < getColumnCount() 
 * <p>
 * 
 * 
 * @param columnIndex the column index in view coordinates.
 * @param sortOrder the sort order to use. If null or SortOrder.UNSORTED, 
 *   this method has the same effect as resetSortOrder();
 *    
 */
public void setSortOrder(int columnIndex, SortOrder sortOrder) {
    if ((sortOrder == null) || !sortOrder.isSorted()) {
        resetSortOrder();
        return;
    }
    if (!isSortable(columnIndex)) return;
    SortController sortController = getSortController();
    if (sortController != null) {
        TableColumnExt columnExt = getColumnExt(columnIndex);
        SortKey sortKey = new SortKey(sortOrder, 
                convertColumnIndexToModel(columnIndex),
                columnExt != null ? columnExt.getComparator() : null);
        sortController.setSortKeys(Collections.singletonList(sortKey));
    }
}
 
開發者ID:sing-group,項目名稱:aibench-project,代碼行數:34,代碼來源:JXTable.java

示例8: resetSortOrder

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
@Override
public void resetSortOrder() {
    super.resetSortOrder();
    
    fireSortChangedListenerSortChanged(new SortChangedEvent(this, -1, SortOrder.UNSORTED ) );
}
 
開發者ID:JockiHendry,項目名稱:ireport-fork,代碼行數:7,代碼來源:JDragTable.java

示例9: setSortOrder

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
/**
 * Sorts the list using SortOrder. 
 * 
 * 
 * Respects the JXList's sortable and comparator 
 * properties: routes the comparator to the SortController
 * and does nothing if !isFilterEnabled(). 
 * <p>
 * 
 * @param sortOrder the sort order to use. If null or SortOrder.UNSORTED, 
 *   this method has the same effect as resetSortOrder();
 *    
 */
public void setSortOrder(SortOrder sortOrder) {
    if ((sortOrder == null) || !sortOrder.isSorted()) {
        resetSortOrder();
        return;
    }
    SortController sortController = getSortController();
    if (sortController != null) {
        SortKey sortKey = new SortKey(sortOrder, 
                0, getComparator());    
        sortController.setSortKeys(Collections.singletonList(sortKey));
    }
}
 
開發者ID:sing-group,項目名稱:aibench-project,代碼行數:26,代碼來源:JXList.java

示例10: getSortType

import org.jdesktop.swingx.decorator.SortOrder; //導入依賴的package包/類
/**
 * Sort type can be 
 * UP, DOWN or UNSORTED
 * @return the sort type
 */ 
public SortOrder getSortType() {
    return sortType;
}
 
開發者ID:JockiHendry,項目名稱:ireport-fork,代碼行數:9,代碼來源:SortChangedEvent.java


注:本文中的org.jdesktop.swingx.decorator.SortOrder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。