当前位置: 首页>>代码示例>>Java>>正文


Java SortOrder.DESCENDING属性代码示例

本文整理汇总了Java中javax.swing.SortOrder.DESCENDING属性的典型用法代码示例。如果您正苦于以下问题:Java SortOrder.DESCENDING属性的具体用法?Java SortOrder.DESCENDING怎么用?Java SortOrder.DESCENDING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.SortOrder的用法示例。


在下文中一共展示了SortOrder.DESCENDING属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: assertControlsSorterPropertiesFalse

/**
 * RowSorter properties not touched if getControlsSorterProperties false.
 */
private void assertControlsSorterPropertiesFalse(boolean setSorter) {
    table.setAutoCreateRowSorter(false);
    SortOrder[] cycle = new SortOrder[] {SortOrder.DESCENDING, SortOrder.UNSORTED};
    table.setSortOrderCycle(cycle);
    table.setSortsOnUpdates(!table.getSortsOnUpdates());
    table.setSortable(!table.isSortable());
    if (setSorter) {
        table.setRowSorter(new TableSortController<TableModel>(table.getModel()));
        assertFalse("StringValueProvider propagated to controller", 
                table.getStringValueRegistry().equals(getSortController(table).getStringValueProvider()));
    }
    assertEquals("sortsOnUpdates propagated to controller", 
            !table.getSortsOnUpdates(), getSortController(table).getSortsOnUpdates());
    assertEquals("sortable propagated to controller",
            !table.isSortable(), getSortController(table).isSortable());
    assertFalse("sortOrderCycle propagated to controller",
            Arrays.equals(table.getSortOrderCycle(), 
                    getSortController(table).getSortOrderCycle()));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:JXTableUnitTest.java

示例2: assertControlsSorterPropertiesTrue

/**
 * RowSorter properties updated on getControlsSorterProperties true.
 */
private void assertControlsSorterPropertiesTrue(boolean setSorter) {
    SortOrder[] cycle = new SortOrder[] {SortOrder.DESCENDING, SortOrder.UNSORTED};
    table.setSortOrderCycle(cycle);
    table.setSortsOnUpdates(!table.getSortsOnUpdates());
    table.setSortable(!table.isSortable());
    if (setSorter) {
        table.setRowSorter(new TableSortController<TableModel>(table.getModel()));
    }
    assertEquals("sortsOnUpdates propagated to controller", 
            table.getSortsOnUpdates(), getSortController(table).getSortsOnUpdates());
    assertEquals("sortable propagated to controller",
            table.isSortable(), getSortController(table).isSortable());
    assertTrue("sortOrderCycle propagated to controller",
            Arrays.equals(table.getSortOrderCycle(), 
                    getSortController(table).getSortOrderCycle()));
    assertEquals("StringValueProvider propagated to controller", 
            table.getStringValueRegistry(), getSortController(table).getStringValueProvider());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:JXTableUnitTest.java

示例3: setColumnSortOrder

protected final void setColumnSortOrder(final int modelColumnIndex, final SortOrder sortOrder)
{
	sortIndexes2Direction.remove(modelColumnIndex);
	if (sortOrder == SortOrder.ASCENDING)
	{
		sortIndexes2Direction.put(modelColumnIndex, true);
	}
	else if (sortOrder == SortOrder.DESCENDING)
	{
		sortIndexes2Direction.put(modelColumnIndex, false);
	}
	else if (sortOrder == SortOrder.UNSORTED)
	{
		// just removed it's fine
	}
	else
	{
		// shall not happen
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:20,代码来源:CTableModelRowSorter.java

示例4: getSortAscendingFlagOfSortOrder

private static final Boolean getSortAscendingFlagOfSortOrder(final SortOrder sortOrder)
{
	if (sortOrder == null)
	{
		return null;
	}
	else if (sortOrder == SortOrder.ASCENDING)
	{
		return true;
	}
	else if (sortOrder == SortOrder.DESCENDING)
	{
		return false;
	}
	else if (sortOrder == SortOrder.UNSORTED)
	{
		return null;
	}
	else
	{
		throw new IllegalArgumentException("Unknown sortOrder: " + sortOrder);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:23,代码来源:CTableModelRowSorter.java

示例5: getColumnSortIcon

/** @return column sort icon or null */
private final Icon getColumnSortIcon(final JTable table, final int viewColumnIndex)
{
	if (table instanceof CTable)
	{
		final CTable cTable = (CTable)table;
		final int modelColumnIndex = table.convertColumnIndexToModel(viewColumnIndex);
		final SortOrder sortOrder = cTable.getSortOrder(modelColumnIndex);
		if (sortOrder == SortOrder.ASCENDING)
		{
			return Images.getImageIcon2("uparrow");
		}
		else if (sortOrder == SortOrder.DESCENDING)
		{
			return Images.getImageIcon2("downarrow");
		}
		else
		{
			return null;
		}
	}
	else
	{
		return null;
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:26,代码来源:VHeaderRenderer.java

示例6: toggle

private SortKey toggle(final SortKey key) {
  switch (key.getSortOrder()) {
    case ASCENDING: {
      return new SortKey(key.getColumn(), SortOrder.DESCENDING);
    }
    case DESCENDING: {
      return new SortKey(key.getColumn(), SortOrder.UNSORTED);
    }
    case UNSORTED: {
      return new SortKey(key.getColumn(), SortOrder.ASCENDING);
    }
  }
  throw new UnreachableCodeReachedException();
}
 
开发者ID:AndreasWBartels,项目名称:libraries,代码行数:14,代码来源:ObjectTableRowSorter.java

示例7: rowSorterChanged

private void
rowSorterChanged() {
	List<? extends SortKey> list = getRowSorter().getSortKeys();
	if(list.isEmpty()) return;
	SortKey k = list.get(0);
	int i = k.getColumn() + 1;
	if(k.getSortOrder() == SortOrder.UNSORTED) return;
	if(k.getSortOrder() == SortOrder.DESCENDING) i *= -1;
	preferences().setIntProperty(tablePrefix + "sortOrder", i);
}
 
开发者ID:lxlxlo,项目名称:LS-jsampler,代码行数:10,代码来源:AbstractInstrumentsDbTable.java

示例8: testSortOrderCycle

/**
 * Setting table's sortable property updates controller.
 */
@Test
public void testSortOrderCycle() {
    JXList list = new JXList(true);
    SortOrder[] cycle = new SortOrder[] {SortOrder.DESCENDING, SortOrder.UNSORTED};
    PropertyChangeReport report = new PropertyChangeReport(list);
    list.setSortOrderCycle(cycle);
    TestUtils.assertPropertyChangeEvent(report, "sortOrderCycle", 
                DefaultSortController.getDefaultSortOrderCycle(), list.getSortOrderCycle());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:12,代码来源:JXListTest.java

示例9: testSortOrderCycleNotification

/**
 * Setting table's sortable property updates controller.
 */
@Test
public void testSortOrderCycleNotification() {
    SortOrder[] cycle = new SortOrder[] {SortOrder.DESCENDING, SortOrder.UNSORTED};
    PropertyChangeReport report = new PropertyChangeReport(table);
    table.setSortOrderCycle(cycle);
    TestUtils.assertPropertyChangeEvent(report, "sortOrderCycle", 
                DefaultSortController.getDefaultSortOrderCycle(), table.getSortOrderCycle());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:11,代码来源:JXTableUnitTest.java

示例10: getHeaderValue

/**
 * @inherited <p>
 */
@Override
public Object getHeaderValue() {
    Object header = super.getHeaderValue();
    Object sortOrder = getClientProperty(SORT_ORDER_KEY);
    if (SortOrder.ASCENDING == sortOrder) {
        header = header + ASCENDING_CHAR;
    } else if (SortOrder.DESCENDING == sortOrder){
        header = header + DESCENDING_CHAR;
    }
    return header;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:14,代码来源:JXTableVisualCheck.java

示例11: getSortingFromTable

/**
 * Returns the current sort keys of the given table encoded in a String.
 * 
 * <p>This is intended to be used together with
 * {@link setSortingForTable(JTable, String)}.</p>
 *
 * @param table
 * @return 
 */
public static String getSortingFromTable(JTable table) {
    List<? extends RowSorter.SortKey> keys = table.getRowSorter().getSortKeys();
    String result = "";
    for (RowSorter.SortKey key : keys) {
        int order = 0;
        if (key.getSortOrder() == SortOrder.ASCENDING) {
            order = 1;
        } else if (key.getSortOrder() == SortOrder.DESCENDING) {
            order = 2;
        }
        result += String.format("%s:%s;", key.getColumn(), order);
    }
    return result;
}
 
开发者ID:chatty,项目名称:chatty,代码行数:23,代码来源:GuiUtil.java

示例12: toggleSortOrder

/**
 * @inherited
 * <p>
 */
@Override
public void toggleSortOrder(int column) {
    List<? extends RowSorter.SortKey> sortKeys = getSortKeys();
    if (sortKeys.size() > 0) {
        if (sortKeys.get(0).getSortOrder() == SortOrder.DESCENDING) {
            setSortKeys(null);
            return;
        }
    }
    super.toggleSortOrder(column);
}
 
开发者ID:chatty,项目名称:chatty,代码行数:15,代码来源:RacesTable.java

示例13: getSortOrderOfBooleanAscendingFlag

private static final SortOrder getSortOrderOfBooleanAscendingFlag(final Boolean isSortAscending)
{
	if (isSortAscending == null)
	{
		return SortOrder.UNSORTED;
	}
	else if (isSortAscending)
	{
		return SortOrder.ASCENDING;
	}
	else
	{
		return SortOrder.DESCENDING;
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:15,代码来源:CTableModelRowSorter.java

示例14: getSortOrder

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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ProfilerRowSorter.java

示例15: toggle

private SortKey toggle(SortKey key) {
    if (key.getSortOrder() == SortOrder.ASCENDING) {
        return new SortKey(key.getColumn(), SortOrder.DESCENDING);
    }
    return new SortKey(key.getColumn(), SortOrder.ASCENDING);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:DefaultRowSorter.java


注:本文中的javax.swing.SortOrder.DESCENDING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。