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


Java MattePainter.setFillPaint方法代码示例

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


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

示例1: testPainterHighlighterPainterPropertyChangeNotificatioon

import org.jdesktop.swingx.painter.MattePainter; //导入方法依赖的package包/类
/**
 * Issue #851-swingx: Highlighter must notify on painter property change
 */
@Test
public void testPainterHighlighterPainterPropertyChangeNotificatioon() {
    PainterHighlighter hl = new PainterHighlighter();
    Color red = Color.RED;
    MattePainter mattePainter = new MattePainter(red);
    assertEquals(red, mattePainter.getFillPaint());
    PropertyChangeReport p = new PropertyChangeReport();
    mattePainter.addPropertyChangeListener(p);
    hl.setPainter(mattePainter);
    assertEquals(mattePainter, hl.getPainter());
    ChangeReport report = new ChangeReport();
    hl.addChangeListener(report);
    mattePainter.setFillPaint(Color.BLUE);
    assertEquals(p.getEventCount(), report.getEventCount());
 }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:HighlighterTest.java

示例2: interactivePainterUpdate

import org.jdesktop.swingx.painter.MattePainter; //导入方法依赖的package包/类
/**
 * Issue #1199-swingx: JXPanel - must repaint on changes to background
 * painter.
 */
public void interactivePainterUpdate() {
    JXPanel panel = new JXPanel();
    final MattePainter painter = new MattePainter(Color.RED);
    panel.setBackgroundPainter(painter);
    JXFrame frame = wrapInFrame(panel, "background");
    Action toggleColor = new AbstractAction("toggle background") {

        @Override
        public void actionPerformed(ActionEvent e) {
            Paint old = painter.getFillPaint();
            painter.setFillPaint(old == Color.RED ? Color.YELLOW
                    : Color.RED);

        }
    };
    addAction(frame, toggleColor);
    show(frame, 200, 200);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:JXPanelVisualCheck.java


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