public class CheckBoxTreeCellRenderer extends Object implements TreeCellRenderer
Modifier and Type | Class and Description |
---|---|
protected class |
CheckBoxTreeCellRenderer.MouseHandler |
Modifier and Type | Field and Description |
---|---|
static int |
FULLCHECKED |
static int |
PARTIALCHECKED |
static int |
UNCHECKABLE |
static int |
UNCHECKED |
Constructor and Description |
---|
CheckBoxTreeCellRenderer(JTree tree,
TreeCellRenderer original)
Create a per-tree instance of the checkbox renderer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addMouseHandler(CheckBoxTreeCellRenderer.MouseHandler handler) |
TreePath[] |
getCheckedPaths()
Returns all checked paths.
|
int[] |
getCheckedRows()
Returns all checked rows.
|
protected TreePath |
getPathForRow(int row) |
protected int |
getRow(Point p) |
protected Rectangle |
getRowBounds(int row) |
protected int |
getRowForPath(TreePath path) |
Component |
getTreeCellRendererComponent(JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) |
protected void |
installMouseHandler() |
boolean |
isChecked(TreePath path)
Returns whether the given path is currently checked.
|
boolean |
isExplicitlyChecked(TreePath path) |
boolean |
isPartiallyChecked(TreePath path) |
boolean |
isSelectable(TreePath path)
Returns whether selecting the given path is allowed.
|
static void |
main(String[] args) |
protected void |
repaint() |
protected void |
repaint(Rectangle r) |
void |
toggleChecked(int row) |
public static final int UNCHECKABLE
public static final int FULLCHECKED
public static final int UNCHECKED
public static final int PARTIALCHECKED
public CheckBoxTreeCellRenderer(JTree tree, TreeCellRenderer original)
protected void installMouseHandler()
protected void addMouseHandler(CheckBoxTreeCellRenderer.MouseHandler handler)
protected int getRow(Point p)
protected Rectangle getRowBounds(int row)
protected TreePath getPathForRow(int row)
protected int getRowForPath(TreePath path)
protected void repaint(Rectangle r)
protected void repaint()
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
getTreeCellRendererComponent
in interface TreeCellRenderer
public boolean isExplicitlyChecked(TreePath path)
public boolean isSelectable(TreePath path)
public boolean isChecked(TreePath path)
public boolean isPartiallyChecked(TreePath path)
public void toggleChecked(int row)
public int[] getCheckedRows()
public TreePath[] getCheckedPaths()
public static void main(String[] args)
Copyright © 2023. All rights reserved.