本文整理汇总了Java中org.jdesktop.swingx.decorator.HighlightPredicate.RowGroupHighlightPredicate类的典型用法代码示例。如果您正苦于以下问题:Java RowGroupHighlightPredicate类的具体用法?Java RowGroupHighlightPredicate怎么用?Java RowGroupHighlightPredicate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RowGroupHighlightPredicate类属于org.jdesktop.swingx.decorator.HighlightPredicate包,在下文中一共展示了RowGroupHighlightPredicate类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRowGroupConstructor
import org.jdesktop.swingx.decorator.HighlightPredicate.RowGroupHighlightPredicate; //导入依赖的package包/类
/**
* test doc'ed behaviour
*/
@Test
public void testRowGroupConstructor() {
try {
new RowGroupHighlightPredicate(0);
fail("RowGroupHighlight must throw IllegalArgumentException for lines < 1");
} catch (IllegalArgumentException ex) {
// expected behaviour
}
}
示例2: testRowGroupProperty
import org.jdesktop.swingx.decorator.HighlightPredicate.RowGroupHighlightPredicate; //导入依赖的package包/类
@Test
public void testRowGroupProperty() {
int lines = 5;
RowGroupHighlightPredicate predicate = new RowGroupHighlightPredicate(5);
assertEquals(lines, predicate.getLinesPerGroup());
}
示例3: createSimpleStriping
import org.jdesktop.swingx.decorator.HighlightPredicate.RowGroupHighlightPredicate; //导入依赖的package包/类
/**
* Creates and returns a Highlighter which highlights every second row group
* background with the given color. The row groups between are not
* highlighted, that is they typically will show the container's background.
*
* @param stripeBackground the background color for the striping.
* @param rowsPerGroup the number of rows in a group
* @return a Highlighter striping every second row group background.
*/
public static Highlighter createSimpleStriping(Color stripeBackground,
int rowsPerGroup) {
HighlightPredicate predicate = new RowGroupHighlightPredicate(
rowsPerGroup);
ColorHighlighter hl = new ColorHighlighter(predicate, stripeBackground,
null);
return hl;
}
示例4: createAlternateStriping
import org.jdesktop.swingx.decorator.HighlightPredicate.RowGroupHighlightPredicate; //导入依赖的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);
}