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


Java NotHighlightPredicate类代码示例

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


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

示例1: interactivePerRowImage

import org.jdesktop.swingx.decorator.HighlightPredicate.NotHighlightPredicate; //导入依赖的package包/类
/**
 * Use custom painter and highlighter for per-row image decoration.
 * 
 * @throws IOException
 */
public void interactivePerRowImage() throws IOException {
    
    JXTable table = new JXTable(new AncientSwingTeam());
    table.setForeground(Color.MAGENTA);
    table.setSelectionForeground(Color.BLUE);
    table.setColumnControlVisible(true);
    table.setRowHeight(25);
    final BufferedImage moon = XTestUtils.loadDefaultImage("moon.jpg");
    final BufferedImage rocket = XTestUtils.loadDefaultImage("500by500.png");
    HighlightPredicate rocketPredicate = new HighlightPredicate() {

        public boolean isHighlighted(Component renderer,
                ComponentAdapter adapter) {
            return ((Integer) adapter.getValue(3)).intValue() < 50;
        }
        
    };
    HighlightPredicate moonPredicate = new NotHighlightPredicate(rocketPredicate);
    table.setHighlighters(
            new SubImagePainterHighlighter(rocketPredicate, 
                    new SubImagePainter(rocket))
            ,
            new SubImagePainterHighlighter(moonPredicate, 
                    new SubImagePainter(moon))
    );
    JXFrame frame = wrapWithScrollingInFrame(table, "painter in renderer");
    show(frame);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:34,代码来源:PainterVisualCheck.java

示例2: testNotProperty

import org.jdesktop.swingx.decorator.HighlightPredicate.NotHighlightPredicate; //导入依赖的package包/类
/**
 * test access the contained predicates
 */
@Test
public void testNotProperty() {
    HighlightPredicate inputPredicates = new IdentifierHighlightPredicate("t");
    NotHighlightPredicate predicate = new NotHighlightPredicate(inputPredicates);
    HighlightPredicate predicates = predicate.getHighlightPredicate();
    assertSame(inputPredicates, predicates);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:11,代码来源:HighlightPredicateTest.java

示例3: testNot

import org.jdesktop.swingx.decorator.HighlightPredicate.NotHighlightPredicate; //导入依赖的package包/类
/**
 * test the NOT predicate.
 *
 */
@Test
public void testNot() {
    ComponentAdapter adapter = createComponentAdapter(allColored, true);
    HighlightPredicate notNever = new NotHighlightPredicate(HighlightPredicate.NEVER);
    assertTrue(notNever.isHighlighted(allColored, adapter));
    HighlightPredicate notAlways = new NotHighlightPredicate(HighlightPredicate.ALWAYS);
    assertFalse(notAlways.isHighlighted(allColored, adapter));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:13,代码来源:HighlightPredicateTest.java

示例4: createAlternateStriping

import org.jdesktop.swingx.decorator.HighlightPredicate.NotHighlightPredicate; //导入依赖的package包/类
/**
 * Creates and returns a Highlighter which highlights 
 * with alternate background. the first Color.WHITE, the second
 * with the color depending on LF. 
 * 
 * @param rowsPerGroup the number of rows in a group
 * @return a Highlighter striping every second row group background.
 */
public static Highlighter createAlternateStriping(int rowsPerGroup) {
    HighlightPredicate predicate = new RowGroupHighlightPredicate(rowsPerGroup);
    ColorHighlighter first = new ColorHighlighter(new NotHighlightPredicate(predicate), Color.WHITE, null);
    ColorHighlighter hl = new UIColorHighlighter(predicate);
    return new CompoundHighlighter(first, hl);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:15,代码来源:HighlighterFactory.java


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