本文整理汇总了Java中org.jdesktop.swingx.JXTreeTable.addHighlighter方法的典型用法代码示例。如果您正苦于以下问题:Java JXTreeTable.addHighlighter方法的具体用法?Java JXTreeTable.addHighlighter怎么用?Java JXTreeTable.addHighlighter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.JXTreeTable
的用法示例。
在下文中一共展示了JXTreeTable.addHighlighter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: interactiveTreeTableStringValueComponent
import org.jdesktop.swingx.JXTreeTable; //导入方法依赖的package包/类
/**
* Issue ??-swingx: TreeTable doesn't return correct string value for hierarchical column.
*
* This is probably a variant of not using the table's renderer (at least I expect it
* to be solved then at the latest). In the meantime, might want to do something special
* for the hierarchical column?
*/
public void interactiveTreeTableStringValueComponent() {
TreeTableModel model = new ComponentTreeTableModel(new JXFrame());
JXTreeTable treeTable = new JXTreeTable(model);
treeTable.setRootVisible(true);
treeTable.expandAll();
LOG.info(treeTable.getStringAt(3, 0));
// treeTable.setTreeCellRenderer(new DefaultTreeRenderer(sv));
JXTree tree = new JXTree(model);
// tree.setCellRenderer(new DefaultTreeRenderer(sv));
HighlightPredicate predicate = new PatternPredicate("null", 0, PatternPredicate.ALL);
ColorHighlighter hl = new ColorHighlighter(predicate, null, Color.RED);
treeTable.addHighlighter(hl);
tree.addHighlighter(hl);
JXFrame frame = wrapWithScrollingInFrame( treeTable, "string rep in hierarchical column");
show(frame);
}
示例2: interactiveTreeStringValueComponent
import org.jdesktop.swingx.JXTreeTable; //导入方法依赖的package包/类
/**
* Issue ??-swingx: TreeTable doesn't return correct string value for hierarchical column.
*
* This is probably a variant of not using the table's renderer (at least I expect it
* to be solved then at the latest). In the meantime, might want to do something special
* for the hierarchical column?
*/
public void interactiveTreeStringValueComponent() {
TreeTableModel model = new ComponentTreeTableModel(new JXFrame());
JXTreeTable treeTable = new JXTreeTable(model);
treeTable.setRootVisible(true);
treeTable.expandAll();
LOG.info(treeTable.getStringAt(3, 0));
// treeTable.setTreeCellRenderer(new DefaultTreeRenderer(sv));
JXTree tree = new JXTree(model);
// tree.setCellRenderer(new DefaultTreeRenderer(sv));
HighlightPredicate predicate = new PatternPredicate("null", 0, PatternPredicate.ALL);
ColorHighlighter hl = new ColorHighlighter(predicate, null, Color.RED);
treeTable.addHighlighter(hl);
tree.addHighlighter(hl);
JXFrame frame = wrapWithScrollingInFrame( tree, "string rep in hierarchical column");
show(frame);
}
示例3: interactiveColumnShading
import org.jdesktop.swingx.JXTreeTable; //导入方法依赖的package包/类
/**
* columm shading (was: hierarchicalColumnHighlighter)
*
*/
public void interactiveColumnShading() {
JXTreeTable treeTable = new JXTreeTable(new FileSystemModel());
// simulate hierarchicalColumnHighlighter
int hierarchicalColumn = 0;
for (int i = 0; i < treeTable.getColumnCount(); i++) {
if (treeTable.isHierarchical(i)) {
hierarchicalColumn = i;
break;
}
}
treeTable.addHighlighter(new ShadingColorHighlighter(new ColumnHighlightPredicate(hierarchicalColumn)));
showWithScrollingInFrame(treeTable, "hierarchical column");
}
示例4: interactiveTreeTableSimpleStripingUI
import org.jdesktop.swingx.JXTreeTable; //导入方法依赖的package包/类
/**
* Simple ui-striping.
*
*/
public void interactiveTreeTableSimpleStripingUI() {
JXTreeTable table = new JXTreeTable(new FileSystemModel());
table.setVisibleRowCount(table.getRowCount() + 3);
table.addHighlighter(HighlighterFactory.createSimpleStriping());
showWithScrollingInFrame(table, "Simple ui striping");
}
示例5: interactiveTreeTableSimpleStriping
import org.jdesktop.swingx.JXTreeTable; //导入方法依赖的package包/类
/**
* shows the effect of a simple striping highlighter on a
* colored table.
*
*/
public void interactiveTreeTableSimpleStriping() {
JXTreeTable table = new JXTreeTable(new FileSystemModel());
table.setVisibleRowCount(table.getRowCount() + 3);
table.setBackground(new Color(0xC0FFC0));
table.addHighlighter(HighlighterFactory.createSimpleStriping());
showWithScrollingInFrame(table, "Simple gray striping");
}
示例6: interactiveTreeTableStringValue
import org.jdesktop.swingx.JXTreeTable; //导入方法依赖的package包/类
/**
* Issue ??-swingx: TreeTable doesn't return correct string value for hierarchical column.
*
* This is probably a variant of not using the table's renderer (at least I expect it
* to be solved then at the latest). In the meantime, might want to do something special
* for the hierarchical column?
*/
public void interactiveTreeTableStringValue() {
TreeTableModel model = AncientSwingTeam.createNamedColorTreeTableModel();
JXTreeTable treeTable = new JXTreeTable(model);
treeTable.setRootVisible(true);
// treeTable.setTreeCellRenderer(new DefaultTreeRenderer(sv));
JXTree tree = new JXTree(model);
// tree.setCellRenderer(new DefaultTreeRenderer(sv));
HighlightPredicate predicate = new PatternPredicate("R/G/B: -2", 0, PatternPredicate.ALL);
ColorHighlighter hl = new ColorHighlighter(predicate, null, Color.RED);
treeTable.addHighlighter(hl);
tree.addHighlighter(hl);
JXFrame frame = wrapWithScrollingInFrame(tree, treeTable, "string rep in hierarchical column");
show(frame);
}