當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。