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


Java JXTree.addHighlighter方法代码示例

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


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

示例1: interactiveTreeTableStringValueComponent

import org.jdesktop.swingx.JXTree; //导入方法依赖的package包/类
/**
     * Issue ??-swingx: TreeTable doesn't return correct string value for hierarchical column.
     * 
     * This is probably a variant of not using the table's renderer (at least I expect it 
     * to be solved then at the latest). In the meantime, might want to do something special
     * for the hierarchical column?
     */
    public void interactiveTreeTableStringValueComponent() {
        TreeTableModel model = new ComponentTreeTableModel(new JXFrame());
        JXTreeTable treeTable = new JXTreeTable(model);
        treeTable.setRootVisible(true);
        treeTable.expandAll();
        LOG.info(treeTable.getStringAt(3, 0));
//        treeTable.setTreeCellRenderer(new DefaultTreeRenderer(sv));
        JXTree tree =  new JXTree(model);
//        tree.setCellRenderer(new DefaultTreeRenderer(sv));
        HighlightPredicate predicate = new PatternPredicate("null", 0, PatternPredicate.ALL);
        ColorHighlighter hl = new ColorHighlighter(predicate, null, Color.RED);
        treeTable.addHighlighter(hl);
        tree.addHighlighter(hl);
        JXFrame frame = wrapWithScrollingInFrame( treeTable, "string rep in hierarchical column");
        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:24,代码来源:ComponentAdapterIssues.java

示例2: interactiveTreeStringValueComponent

import org.jdesktop.swingx.JXTree; //导入方法依赖的package包/类
/**
     * Issue ??-swingx: TreeTable doesn't return correct string value for hierarchical column.
     * 
     * This is probably a variant of not using the table's renderer (at least I expect it 
     * to be solved then at the latest). In the meantime, might want to do something special
     * for the hierarchical column?
     */
    public void interactiveTreeStringValueComponent() {
        TreeTableModel model = new ComponentTreeTableModel(new JXFrame());
        JXTreeTable treeTable = new JXTreeTable(model);
        treeTable.setRootVisible(true);
        treeTable.expandAll();
        LOG.info(treeTable.getStringAt(3, 0));
//        treeTable.setTreeCellRenderer(new DefaultTreeRenderer(sv));
        JXTree tree =  new JXTree(model);
//        tree.setCellRenderer(new DefaultTreeRenderer(sv));
        HighlightPredicate predicate = new PatternPredicate("null", 0, PatternPredicate.ALL);
        ColorHighlighter hl = new ColorHighlighter(predicate, null, Color.RED);
        treeTable.addHighlighter(hl);
        tree.addHighlighter(hl);
        JXFrame frame = wrapWithScrollingInFrame( tree, "string rep in hierarchical column");
        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:24,代码来源:ComponentAdapterIssues.java

示例3: interactiveTreeRendererExtendsOpacity

import org.jdesktop.swingx.JXTree; //导入方法依赖的package包/类
/**
 * Issue swingx-1514: icon background always highlighted. <p>
 * Actually a problem introduced by #3789 version of JXPanel
 * Not special to the hierarchical nature, same for list
 * 
 * Not fixed (1.6.5) for Nimbus (and potentially other synth-based lafs)
 * 
 * @see org.jdesktop.swingx.renderer.RendererVisualCheck#interactiveIconTextAlignmentAndExtendsOpacity
 */
public void interactiveTreeRendererExtendsOpacity() {
    JXTree table = new JXTree();
    table.expandAll();
    final WrappingProvider wrapper = new WrappingProvider();
    table.setCellRenderer(new DefaultTreeRenderer(wrapper));
    table.addHighlighter(HighlighterFactory.createSimpleStriping());
    JXFrame frame = wrapWithScrollingInFrame(table, "background on icon?");
    addAction(frame, createToggleExtendsOpacityAction(wrapper, table));
    show(frame);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:20,代码来源:RendererVisualCheck.java

示例4: interactiveTreeFancyButton

import org.jdesktop.swingx.JXTree; //导入方法依赖的package包/类
/**
 * PENDING JW: really fancify or remove ;-)
 */
public void interactiveTreeFancyButton() {
    JXTree tree = new JXTree();
    tree.setRowHeight(30);
    MattePainter painter = new MattePainter(Color.YELLOW);
    Highlighter hl = new PainterHighlighter(HighlightPredicate.ROLLOVER_ROW, painter);
    tree.addHighlighter(hl);
    ComponentProvider<?> provider = new NormalButtonProvider(StringValues.TO_STRING, JLabel.LEADING);
    tree.setCellRenderer(new DefaultTreeRenderer(provider));
    tree.setRolloverEnabled(true);
    showWithScrollingInFrame(tree, "Fancy..");
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:15,代码来源:RendererIssues.java

示例5: interactiveAnimatedIconPainterHighlightTree

import org.jdesktop.swingx.JXTree; //导入方法依赖的package包/类
/**
 * Issue #862-swingx: SwingX rendering components should be PainterAware.
 * 
 * Currently this works only with a local version which has WrappingIconPanel
 * implement the PainterAware by delegating to its content delegate. 
 */
public void interactiveAnimatedIconPainterHighlightTree()  {
    TreeModel model = new FileSystemModel();
    JXTree tree = new JXTree(model);
    tree.setRolloverEnabled(true);
    
    tree.setCellRenderer(new DefaultTreeRenderer(StringValues.FILE_NAME));
    ImagePainter imagePainter = new ImagePainter(XTestUtils.loadDefaultImage("green-orb.png"));
    imagePainter.setHorizontalAlignment(HorizontalAlignment.RIGHT);
    final RelativePainter<?> painter = new RelativePainter<Component>(imagePainter);
    PainterHighlighter iconHighlighter = new PainterHighlighter();
    iconHighlighter.setHighlightPredicate(HighlightPredicate.ROLLOVER_ROW);
    iconHighlighter.setPainter(painter);
    ActionListener l = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            double fraction = painter.getXFactor();
            fraction = fraction > 1 ? 0.0 : fraction + 0.1;
            painter.setXFactor(fraction);
        }
        
    };
    tree.addHighlighter(iconHighlighter);
    showWithScrollingInFrame(tree, 
            "Animated highlighter: marching icon on rollover");
    Timer timer = new Timer(100, l);
    timer.start();
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:33,代码来源:PainterVisualCheck.java

示例6: interactiveTreeRolloverScroll

import org.jdesktop.swingx.JXTree; //导入方法依赖的package包/类
/**
 * Issue #1193-swingx: rollover state not updated on scrolling/mouseWheel
 * 
 * visualize behaviour on 
 * - scrolling (with mouse wheel)
 * - resizing (added custom actions)
 */
public void interactiveTreeRolloverScroll() {
    final JXTree table = new JXTree(new FileSystemModel());
    table.setCellRenderer(new DefaultTreeRenderer());
    table.setRolloverEnabled(true);
    table.addHighlighter(new ColorHighlighter(HighlightPredicate.ROLLOVER_ROW, Color.YELLOW, null));
    final JXFrame frame = getResizableFrame(table);
    show(frame);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:16,代码来源:RolloverVisualCheck.java

示例7: interactiveTreeGetStringUsedInFind

import org.jdesktop.swingx.JXTree; //导入方法依赖的package包/类
/**
 * Issue #767-swingx: consistent string representation.
 * 
 * used in find/highlight
 */
public void interactiveTreeGetStringUsedInFind() {
    JXTree table = new JXTree(AncientSwingTeam.createNamedColorTreeModel());
    table.setCellRenderer(new DefaultTreeRenderer(sv));
    HighlightPredicate predicate = new PatternPredicate("R/G/B: -2", 2, 2);
    table.addHighlighter(new ColorHighlighter(predicate, null, Color.RED));
    JXFrame frame = wrapWithScrollingInFrame(table, "Find/Highlight use adapter string value");
    addSearchModeToggle(frame);
    addMessage(frame, "Press ctrl-F to open search widget");
    show(frame);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:16,代码来源:ComponentAdapterClientTest.java

示例8: interactiveTreeTableStringValue

import org.jdesktop.swingx.JXTree; //导入方法依赖的package包/类
/**
     * Issue ??-swingx: TreeTable doesn't return correct string value for hierarchical column.
     * 
     * This is probably a variant of not using the table's renderer (at least I expect it 
     * to be solved then at the latest). In the meantime, might want to do something special
     * for the hierarchical column?
     */
    public void interactiveTreeTableStringValue() {
        TreeTableModel model = AncientSwingTeam.createNamedColorTreeTableModel();
        JXTreeTable treeTable = new JXTreeTable(model);
        treeTable.setRootVisible(true);
//        treeTable.setTreeCellRenderer(new DefaultTreeRenderer(sv));
        JXTree tree =  new JXTree(model);
//        tree.setCellRenderer(new DefaultTreeRenderer(sv));
        HighlightPredicate predicate = new PatternPredicate("R/G/B: -2", 0, PatternPredicate.ALL);
        ColorHighlighter hl = new ColorHighlighter(predicate, null, Color.RED);
        treeTable.addHighlighter(hl);
        tree.addHighlighter(hl);
        JXFrame frame = wrapWithScrollingInFrame(tree, treeTable, "string rep in hierarchical column");
        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:ComponentAdapterIssues.java


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