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


Java DefaultXTreeCellRenderer类代码示例

本文整理汇总了Java中org.jdesktop.swingx.tree.DefaultXTreeCellRenderer的典型用法代码示例。如果您正苦于以下问题:Java DefaultXTreeCellRenderer类的具体用法?Java DefaultXTreeCellRenderer怎么用?Java DefaultXTreeCellRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testDelegatingRendererUseDefault

import org.jdesktop.swingx.tree.DefaultXTreeCellRenderer; //导入依赖的package包/类
/**
 * Issue #817-swingx: Delegating renderer must create list's default.
 * Delegating has default from list initially, here: default default.
 * 
 * Note: this test has to be changed once we switch to default to DefaultTreeRenderer.
 */
@Test
public void testDelegatingRendererUseDefault() {
    JXTree list = new JXTree();
    TreeCellRenderer defaultRenderer = list.createDefaultCellRenderer();
    assertEquals("sanity: creates default", DefaultXTreeCellRenderer.class, 
            defaultRenderer.getClass());
    DelegatingRenderer renderer = (DelegatingRenderer) list.getCellRenderer();
    assertEquals(defaultRenderer.getClass(), renderer.getDelegateRenderer().getClass());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:16,代码来源:JXTreeUnitTest.java

示例2: interactiveUpdateUIXTreeDefaultRenderer

import org.jdesktop.swingx.tree.DefaultXTreeCellRenderer; //导入依赖的package包/类
/**
 * Issue #1060-swingx: JXTree must update renderer
 * 
 * tree renderer not updated if set on the tree (as opposed to using the 
 * default set by the ui-delegate)
 */
public void interactiveUpdateUIXTreeDefaultRenderer() {
    JXTree tree = new JXTree();
    tree.getModel().valueForPathChanged(tree.getPathForRow(0), "x with ui provided renderer");
    tree.setEditable(true);
    JXTree treeSetRenderer = new JXTree();
    treeSetRenderer.getModel().valueForPathChanged(treeSetRenderer.getPathForRow(0), "x with renderer set");
    treeSetRenderer.setCellRenderer(new DefaultXTreeCellRenderer());
    treeSetRenderer.setEditable(true);
    JXFrame frame = wrapWithScrollingInFrame(tree, treeSetRenderer, "JXTree/core renderer: updateUI must update renderer");
    addComponentOrientationToggle(frame);
    show(frame);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:JXTreeIssues.java

示例3: createDefaultCellRenderer

import org.jdesktop.swingx.tree.DefaultXTreeCellRenderer; //导入依赖的package包/类
/**
     * Creates and returns the default cell renderer to use. Subclasses may
     * override to use a different type.
     * <p>
     * 
     * This implementation returns a renderer of type
     * <code>DefaultTreeCellRenderer</code>. <b>Note:</b> Will be changed to
     * return a renderer of type <code>DefaultTreeRenderer</code>,
     * once WrappingProvider is reasonably stable.
     * 
     * @return the default cell renderer to use with this tree.
     */
    protected TreeCellRenderer createDefaultCellRenderer() {
//        return new DefaultTreeCellRenderer();
        return new DefaultXTreeCellRenderer();
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:17,代码来源:JXTree.java


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