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


Java ComponentAdapter.convertRowIndexToModel方法代码示例

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


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

示例1: interactiveAnimatedBusyPainterHighlight

import org.jdesktop.swingx.decorator.ComponentAdapter; //导入方法依赖的package包/类
/**
     * Use highlighter with BusyPainter.
     */
    public void interactiveAnimatedBusyPainterHighlight()  {
        TableModel model = new AncientSwingTeam();
        JXTable table = new JXTable(model);
        table.getColumn(0).setCellRenderer(new DefaultTableRenderer(
                new HyperlinkProvider()));
        final BusyPainter busyPainter = new BusyPainter() {
            /**
             * Overridden to fix Issue #861-swingx: must notify on change
             * @param frame
             */
//            @Override
//            public void setFrame(int frame) {
//                int old = getFrame();
//                super.setFrame(frame);
//                firePropertyChange("frame", old, getFrame());
//            }
            
        };
        // JW: how do we ask for the height of the painter?
        table.setRowHeight(26);
        PainterHighlighter iconHighlighter = new PainterHighlighter();
        HighlightPredicate predicate = new HighlightPredicate() {

            @Override
            public boolean isHighlighted(Component renderer,
                    ComponentAdapter adapter) {
                
                return 
                   adapter.convertRowIndexToModel(adapter.row) == 1;
            }
            
        };
        iconHighlighter.setHighlightPredicate(predicate); //HighlightPredicate.ROLLOVER_ROW);
        iconHighlighter.setPainter(busyPainter);
        ActionListener l = new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                int frame = busyPainter.getFrame();
                frame = (frame+1)%busyPainter.getPoints();
                busyPainter.setFrame(frame);
            }
            
        };
        table.getColumnExt(1).addHighlighter(iconHighlighter);
        showWithScrollingInFrame(table, 
                "Animated highlighter: BusyPainter on Rollover");
        Timer timer = new Timer(100, l);
        timer.start();
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:52,代码来源:PainterVisualCheck.java


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