本文整理匯總了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);
}
示例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);
}
示例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));
}
示例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);
}