本文整理汇总了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);
}