javax.swing.tree
public class DefaultTreeCellRenderer extends JLabel implements TreeCellRenderer
Field Summary | |
---|---|
protected Color | backgroundNonSelectionColor
The background color for non-selected cells.
|
protected Color | backgroundSelectionColor
The background color for selected cells.
|
protected Color | borderSelectionColor
The border color for selected tree cells.
|
protected Icon | closedIcon
The icon used to represent non-leaf nodes that are closed.
|
protected boolean | hasFocus
A flag indicating the current focus status. |
protected Icon | leafIcon
The icon used to represent leaf nodes.
|
protected Icon | openIcon
The icon used to represent non-leaf nodes that are open.
|
protected boolean | selected
A flag indicating the current selection status. |
protected Color | textNonSelectionColor
The color used for text in non-selected cells.
|
protected Color | textSelectionColor
The color used for text in selected cells.
|
Constructor Summary | |
---|---|
DefaultTreeCellRenderer()
Creates a new tree cell renderer with defaults appropriate for the
current {@link LookAndFeel}. |
Method Summary | |
---|---|
protected void | firePropertyChange(String name, Object oldValue, Object newValue)
For performance reasons, this method is overridden to do nothing.
|
void | firePropertyChange(String name, byte oldValue, byte newValue)
For performance reasons, this method is overridden to do nothing.
|
void | firePropertyChange(String name, char oldValue, char newValue)
For performance reasons, this method is overridden to do nothing.
|
void | firePropertyChange(String name, short oldValue, short newValue)
For performance reasons, this method is overridden to do nothing.
|
void | firePropertyChange(String name, int oldValue, int newValue)
For performance reasons, this method is overridden to do nothing.
|
void | firePropertyChange(String name, long oldValue, long newValue)
For performance reasons, this method is overridden to do nothing.
|
void | firePropertyChange(String name, float oldValue, float newValue)
For performance reasons, this method is overridden to do nothing.
|
void | firePropertyChange(String name, double oldValue, double newValue)
For performance reasons, this method is overridden to do nothing.
|
void | firePropertyChange(String name, boolean oldValue, boolean newValue)
For performance reasons, this method is overridden to do nothing.
|
Color | getBackgroundNonSelectionColor()
Returns the background color for tree cells that are not selected.
|
Color | getBackgroundSelectionColor()
Returns the background color for tree cells that are selected.
|
Color | getBorderSelectionColor()
Returns the border color for tree cells that are selected.
|
Icon | getClosedIcon()
Returns the icon displayed for non-leaf nodes that are closed. |
Icon | getDefaultClosedIcon()
Returns the default icon for non-leaf tree cells that are closed (not
expanded). |
Icon | getDefaultLeafIcon()
Returns the default icon for leaf tree cells. |
Icon | getDefaultOpenIcon()
Returns the default icon for non-leaf tree cells that are open (expanded).
|
Font | getFont()
Returns the current font.
|
Icon | getLeafIcon()
Returns the icon displayed for leaf nodes. |
Icon | getOpenIcon()
Returns the icon displayed for non-leaf nodes that are open (expanded).
|
Dimension | getPreferredSize()
Returns the preferred size of the cell.
|
Color | getTextNonSelectionColor()
Returns the text color for tree cells that are not selected.
|
Color | getTextSelectionColor()
Returns the text color for tree cells that are selected.
|
Component | getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
Returns a component (in fact this ) that can be used to
render a tree cell with the specified state.
|
void | paint(Graphics g)
Paints the value. |
void | repaint(long tm, int x, int y, int width, int height)
For performance reasons, this method is overridden to do nothing.
|
void | repaint(Rectangle area)
For performance reasons, this method is overridden to do nothing.
|
void | revalidate()
For performance reasons, this method is overridden to do nothing. |
void | setBackground(Color c)
Sets the background color.
|
void | setBackgroundNonSelectionColor(Color c)
Sets the background color for tree cells that are not selected.
|
void | setBackgroundSelectionColor(Color c)
Sets the background color for tree cells that are selected.
|
void | setBorderSelectionColor(Color c)
Sets the border color for tree cells that are selected.
|
void | setClosedIcon(Icon icon)
Sets the icon to be displayed for non-leaf nodes that are closed. |
void | setFont(Font f)
Sets the font.
|
void | setLeafIcon(Icon icon)
Sets the icon to be displayed for leaf nodes. |
void | setOpenIcon(Icon icon)
Sets the icon to be displayed for non-leaf nodes that are open (expanded).
|
void | setTextNonSelectionColor(Color c)
Sets the text color for tree cells that are not selected.
|
void | setTextSelectionColor(Color c)
Sets the text color for tree cells that are selected.
|
void | validate()
For performance reasons, this method is overridden to do nothing. |
See Also: setBackgroundNonSelectionColor
See Also: setBackgroundSelectionColor
See Also: setBorderSelectionColor
See Also: setClosedIcon
See Also: setLeafIcon
See Also: setOpenIcon
See Also: setTextNonSelectionColor
See Also: setTextSelectionColor
Parameters: name the property name. oldValue the old value. newValue the new value.
Parameters: name the property name. oldValue the old value. newValue the new value.
Parameters: name the property name. oldValue the old value. newValue the new value.
Parameters: name the property name. oldValue the old value. newValue the new value.
Parameters: name the property name. oldValue the old value. newValue the new value.
Parameters: name the property name. oldValue the old value. newValue the new value.
Parameters: name the property name. oldValue the old value. newValue the new value.
Parameters: name the property name. oldValue the old value. newValue the new value.
Parameters: name the property name. oldValue the old value. newValue the new value.
Tree.textBackground
.
Returns: The background color for tree cells that are not selected.
See Also: setBackgroundNonSelectionColor
Tree.selectionBackground
.
Returns: The background color for tree cells that are selected.
See Also: setBackgroundSelectionColor
Tree.selectionBorderColor
.
Returns: The border color for tree cells that are selected.
See Also: setBorderSelectionColor
Returns: The closed icon (possibly null
).
See Also: setClosedIcon
Tree.closedIcon
.
Returns: The default icon.
Tree.leafIcon
.
Returns: The default icon.
Tree.openIcon
.
Returns: The default icon.
Returns: The current font.
See Also: setFont
Returns: The leaf icon (possibly null
).
See Also: setLeafIcon
Returns: The open icon (possibly null
).
See Also: setOpenIcon
Returns: The preferred size of the cell.
Tree.selectionForeground
.
Returns: The background color for tree cells that are not selected.
See Also: DefaultTreeCellRenderer
Tree.selectionForeground
.
Returns: The text color for tree cells that are selected.
See Also: setTextSelectionColor
this
) that can be used to
render a tree cell with the specified state.
Parameters: tree the tree that the cell belongs to. val the cell value. selected indicates whether or not the cell is selected. expanded indicates whether or not the cell is expanded. leaf indicates whether or not the cell is a leaf in the tree. row the row index. hasFocus indicates whether or not the cell has the focus.
Returns: this
.
Parameters: g the graphics device.
Parameters: tm ignored x coordinate of the region to mark as dirty y coordinate of the region to mark as dirty width dimension of the region to mark as dirty height dimension of the region to mark as dirty
Parameters: area the area to repaint.
Parameters: c the color.
Parameters: c the color (null
permitted).
See Also: getBackgroundNonSelectionColor
Parameters: c the color (null
permitted).
See Also: getBackgroundSelectionColor
Parameters: c the color (null
permitted).
See Also: getBorderSelectionColor
null
if no icon is required.
Parameters: icon the icon (null
permitted).
See Also: getClosedIcon
Parameters: f the font.
See Also: getFont
null
if no icon is required.
Parameters: icon the icon (null
permitted).
See Also: getLeafIcon
null
if no icon is required.
Parameters: icon the icon (null
permitted).
See Also: getOpenIcon
Parameters: c the color (null
permitted).
See Also: getTextNonSelectionColor
Parameters: c the color (null
permitted).
See Also: getTextSelectionColor