Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
javax.swing.tree.DefaultTreeCellRenderer
TreeCellRenderer
interface.
Nested Class Summary |
Nested classes/interfaces inherited from class javax.swing.JLabel | |
JLabel.AccessibleJLabel |
Nested classes/interfaces inherited from class javax.swing.JComponent | |
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container | |
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component | |
Component.AccessibleAWTComponent , Component.BltBufferStrategy , Component.FlipBufferStrategy |
Field Summary | |
protected Color |
|
protected Color |
|
protected Color |
|
protected Icon |
|
protected boolean |
|
protected Icon |
|
protected Icon |
|
protected boolean |
|
protected Color |
|
protected Color |
|
Fields inherited from class javax.swing.JComponent | |
TOOL_TIP_TEXT_KEY , UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW , accessibleContext , listenerList , ui |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver | |
ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
Fields inherited from interface javax.swing.SwingConstants | |
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
protected void |
|
void |
|
void |
|
Color |
|
Color |
|
Color |
|
Icon |
|
Icon |
|
Icon |
|
Icon |
|
Font |
|
Icon |
|
Icon |
|
Dimension |
|
Color |
|
Color |
|
Component |
|
void | |
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected Color backgroundNonSelectionColor
The background color for non-selected cells.
protected Color backgroundSelectionColor
The background color for selected cells.
- See Also:
setBackgroundSelectionColor(Color)
protected Color borderSelectionColor
The border color for selected tree cells.
- See Also:
setBorderSelectionColor(Color)
protected Icon closedIcon
The icon used to represent non-leaf nodes that are closed.
- See Also:
setClosedIcon(Icon)
protected Icon openIcon
The icon used to represent non-leaf nodes that are open.
- See Also:
setOpenIcon(Icon)
protected Color textNonSelectionColor
The color used for text in non-selected cells.
- See Also:
setTextNonSelectionColor(Color)
protected Color textSelectionColor
The color used for text in selected cells.
- See Also:
setTextSelectionColor(Color)
public DefaultTreeCellRenderer()
Creates a new tree cell renderer with defaults appropriate for the currentLookAndFeel
.
public void firePropertyChange(String name, boolean oldValue, boolean newValue)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- firePropertyChange in interface JComponent
- Parameters:
name
- the property name.oldValue
- the old value.newValue
- the new value.
public void firePropertyChange(String name, byte oldValue, byte newValue)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- firePropertyChange in interface Component
- Parameters:
name
- the property name.oldValue
- the old value.newValue
- the new value.
public void firePropertyChange(String name, char oldValue, char newValue)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- firePropertyChange in interface Component
- Parameters:
name
- the property name.oldValue
- the old value.newValue
- the new value.
public void firePropertyChange(String name, double oldValue, double newValue)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- firePropertyChange in interface Component
- Parameters:
name
- the property name.oldValue
- the old value.newValue
- the new value.
public void firePropertyChange(String name, float oldValue, float newValue)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- firePropertyChange in interface Component
- Parameters:
name
- the property name.oldValue
- the old value.newValue
- the new value.
public void firePropertyChange(String name, int oldValue, int newValue)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- firePropertyChange in interface JComponent
- Parameters:
name
- the property name.oldValue
- the old value.newValue
- the new value.
protected void firePropertyChange(String name, Object oldValue, Object newValue)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- firePropertyChange in interface Component
- Parameters:
name
- the property name.oldValue
- the old value.newValue
- the new value.
public void firePropertyChange(String name, long oldValue, long newValue)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- firePropertyChange in interface Component
- Parameters:
name
- the property name.oldValue
- the old value.newValue
- the new value.
public void firePropertyChange(String name, short oldValue, short newValue)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- firePropertyChange in interface Component
- Parameters:
name
- the property name.oldValue
- the old value.newValue
- the new value.
public Color getBackgroundNonSelectionColor()
Returns the background color for tree cells that are not selected. The default value is obtained from theLookAndFeel
defaults table using the keyTree.textBackground
.
- Returns:
- The background color for tree cells that are not selected.
public Color getBackgroundSelectionColor()
Returns the background color for tree cells that are selected. The default value is obtained from theLookAndFeel
defaults table using the keyTree.selectionBackground
.
- Returns:
- The background color for tree cells that are selected.
- See Also:
setBackgroundSelectionColor(Color)
public Color getBorderSelectionColor()
Returns the border color for tree cells that are selected. The default value is obtained from theLookAndFeel
defaults table using the keyTree.selectionBorderColor
.
- Returns:
- The border color for tree cells that are selected.
- See Also:
setBorderSelectionColor(Color)
public Icon getClosedIcon()
Returns the icon displayed for non-leaf nodes that are closed. The default value is initialised from theLookAndFeel
.
- Returns:
- The closed icon (possibly
null
).
- See Also:
setClosedIcon(Icon)
public Icon getDefaultClosedIcon()
Returns the default icon for non-leaf tree cells that are closed (not expanded). The icon is fetched from the defaults table for the currentLookAndFeel
using the keyTree.closedIcon
.
- Returns:
- The default icon.
public Icon getDefaultLeafIcon()
Returns the default icon for leaf tree cells. The icon is fetched from the defaults table for the currentLookAndFeel
using the keyTree.leafIcon
.
- Returns:
- The default icon.
public Icon getDefaultOpenIcon()
Returns the default icon for non-leaf tree cells that are open (expanded). The icon is fetched from the defaults table for the currentLookAndFeel
using the keyTree.openIcon
.
- Returns:
- The default icon.
public Font getFont()
Returns the current font.
- Specified by:
- getFont in interface MenuContainer
- Returns:
- The current font.
- See Also:
setFont(Font)
public Icon getLeafIcon()
Returns the icon displayed for leaf nodes. The default value is initialised from theLookAndFeel
.
- Returns:
- The leaf icon (possibly
null
).
- See Also:
setLeafIcon(Icon)
public Icon getOpenIcon()
Returns the icon displayed for non-leaf nodes that are open (expanded). The default value is initialised from theLookAndFeel
.
- Returns:
- The open icon (possibly
null
).
- See Also:
setOpenIcon(Icon)
public Dimension getPreferredSize()
Returns the preferred size of the cell.
- Overrides:
- getPreferredSize in interface JComponent
- Returns:
- The preferred size of the cell.
public Color getTextNonSelectionColor()
Returns the text color for tree cells that are not selected. The default value is obtained from theLookAndFeel
defaults table using the keyTree.selectionForeground
.
- Returns:
- The background color for tree cells that are not selected.
- See Also:
setTextgroundNonSelectionColor(Color)
public Color getTextSelectionColor()
Returns the text color for tree cells that are selected. The default value is obtained from theLookAndFeel
defaults table using the keyTree.selectionForeground
.
- Returns:
- The text color for tree cells that are selected.
- See Also:
setTextSelectionColor(Color)
public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
Returns a component (in factthis
) that can be used to render a tree cell with the specified state.
- Specified by:
- getTreeCellRendererComponent in interface TreeCellRenderer
- 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
.
public void paint(Graphics g)
Paints the value. The background is filled based on selected.
- Overrides:
- paint in interface JComponent
- Parameters:
g
- the graphics device.
public void repaint(Rectangle area)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- repaint in interface JComponent
- Parameters:
area
- the area to repaint.
public void repaint(long tm, int x, int y, int width, int height)
For performance reasons, this method is overridden to do nothing.
- Overrides:
- repaint in interface JComponent
- Parameters:
tm
- ignoredx
- coordinate of the region to mark as dirtyy
- coordinate of the region to mark as dirtywidth
- dimension of the region to mark as dirtyheight
- dimension of the region to mark as dirty
public void revalidate()
For performance reasons, this method is overridden to do nothing.
- Overrides:
- revalidate in interface JComponent
public void setBackground(Color c)
Sets the background color.
- Overrides:
- setBackground in interface JComponent
- Parameters:
c
- the color.
public void setBackgroundNonSelectionColor(Color c)
Sets the background color for tree cells that are not selected.
- Parameters:
c
- the color (null
permitted).
- See Also:
getBackgroundNonSelectionColor()
public void setBackgroundSelectionColor(Color c)
Sets the background color for tree cells that are selected.
- Parameters:
c
- the color (null
permitted).
- See Also:
getBackgroundSelectionColor()
public void setBorderSelectionColor(Color c)
Sets the border color for tree cells that are selected.
- Parameters:
c
- the color (null
permitted).
- See Also:
getBorderSelectionColor()
public void setClosedIcon(Icon icon)
Sets the icon to be displayed for non-leaf nodes that are closed. Set this tonull
if no icon is required.
- Parameters:
icon
- the icon (null
permitted).
- See Also:
getClosedIcon()
public void setLeafIcon(Icon icon)
Sets the icon to be displayed for leaf nodes. Set this tonull
if no icon is required.
- Parameters:
icon
- the icon (null
permitted).
- See Also:
getLeafIcon()
public void setOpenIcon(Icon icon)
Sets the icon to be displayed for non-leaf nodes that are open (expanded). Set this tonull
if no icon is required.
- Parameters:
icon
- the icon (null
permitted).
- See Also:
getOpenIcon()
public void setTextNonSelectionColor(Color c)
Sets the text color for tree cells that are not selected.
- Parameters:
c
- the color (null
permitted).
- See Also:
getTextNonSelectionColor()
public void setTextSelectionColor(Color c)
Sets the text color for tree cells that are selected.
- Parameters:
c
- the color (null
permitted).
- See Also:
getTextSelectionColor()