All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.basic.BasicTreeCellRenderer

java.lang.Object
    |
    +----java.awt.Component
            |
            +----java.awt.Container
                    |
                    +----java.awt.swing.JComponent
                            |
                            +----java.awt.swing.JLabel
                                    |
                                    +----java.awt.swing.basic.BasicTreeCellRenderer

public class BasicTreeCellRenderer
extends JLabel
implements TreeCellRenderer

Variable Index

 o backgroundNonSelectionColor
Color to use for the background when the node isn't selected.
 o backgroundSelectionColor
Color to use for the background when a node is selected.
 o borderSelectionColor
Color to use for the background when the node isn't selected.
 o closedIcon
Icon used to show non-leaf nodes that aren't expanded.
 o leafIcon
Icon used to show leaf nodes.
 o openIcon
Icon used to show non-leaf nodes that are expanded.
 o selected
Is the value currently selected.
 o textNonSelectionColor
Color to use for the foreground for non-selected nodes.
 o textSelectionColor
Color to use for the foreground for selected nodes.

Constructor Index

 o BasicTreeCellRenderer()
Returns a new instance of BasicTreeCellRenderer.

Method Index

 o getBackgroundNonSelectionColor()
Returns the background color to be used for non selected nodes.
 o getBackgroundSelectionColor()
Returns the color to use for the background if node is selected.
 o getBorderSelectionColor()
Returns the color the border is drawn.
 o getClosedIcon()
Returns the icon used to represent non-leaf nodes that are not expanded.
 o getDefaultClosedIcon()
Returns the default icon used to represent non-leaf nodes that are not expanded.
 o getDefaultLeafIcon()
Returns the default icon used to represent leaf nodes.
 o getDefaultOpenIcon()
Returns the default icon used to represent non-leaf nodes that are expanded.
 o getLeafIcon()
Returns the icon used to represent leaf nodes.
 o getOpenIcon()
Returns the icon used to represent non-leaf nodes that are expanded.
 o getPreferredSize()
If the preferredSize has been set to a non-null value just return it.
 o getTextNonSelectionColor()
Returns the color the text is drawn with when the node isn't selected.
 o getTextSelectionColor()
Returns the color the text is drawn with when the node is selected.
 o getTreeCellRendererComponent(JTree, Object, boolean, boolean, boolean, int, boolean)
Configures the renderer based on the passed in components.
 o paint(Graphics)
Paints the value.
 o setBackgroundNonSelectionColor(Color)
Sets the background color to be used for non selected nodes.
 o setBackgroundSelectionColor(Color)
Sets the color to use for the background if node is selected.
 o setBorderSelectionColor(Color)
Sets the color to use for the border.
 o setClosedIcon(Icon)
Sets the icon used to represent non-leaf nodes that are not expanded.
 o setLeafIcon(Icon)
Sets the icon used to represent leaf nodes.
 o setOpenIcon(Icon)
Sets the icon used to represent non-leaf nodes that are expanded.
 o setTextNonSelectionColor(Color)
Sets the color the text is drawn with when the node isn't selected.
 o setTextSelectionColor(Color)
Sets the color the text is drawn with when the node is selected.

Variables

 o selected
protected boolean selected
Is the value currently selected.

 o closedIcon
protected transient Icon closedIcon
Icon used to show non-leaf nodes that aren't expanded.

 o leafIcon
protected transient Icon leafIcon
Icon used to show leaf nodes.

 o openIcon
protected transient Icon openIcon
Icon used to show non-leaf nodes that are expanded.

 o textSelectionColor
protected Color textSelectionColor
Color to use for the foreground for selected nodes.

 o textNonSelectionColor
protected Color textNonSelectionColor
Color to use for the foreground for non-selected nodes.

 o backgroundSelectionColor
protected Color backgroundSelectionColor
Color to use for the background when a node is selected.

 o backgroundNonSelectionColor
protected Color backgroundNonSelectionColor
Color to use for the background when the node isn't selected.

 o borderSelectionColor
protected Color borderSelectionColor
Color to use for the background when the node isn't selected.

Constructors

 o BasicTreeCellRenderer
public BasicTreeCellRenderer()
Returns a new instance of BasicTreeCellRenderer. Alignment is set to left aligned.

Methods

 o getDefaultOpenIcon
public Icon getDefaultOpenIcon()
Returns the default icon used to represent non-leaf nodes that are expanded.

 o getDefaultClosedIcon
public Icon getDefaultClosedIcon()
Returns the default icon used to represent non-leaf nodes that are not expanded.

 o getDefaultLeafIcon
public Icon getDefaultLeafIcon()
Returns the default icon used to represent leaf nodes.

 o setOpenIcon
public void setOpenIcon(Icon newIcon)
Sets the icon used to represent non-leaf nodes that are expanded.

 o getOpenIcon
public Icon getOpenIcon()
Returns the icon used to represent non-leaf nodes that are expanded.

 o setClosedIcon
public void setClosedIcon(Icon newIcon)
Sets the icon used to represent non-leaf nodes that are not expanded.

 o getClosedIcon
public Icon getClosedIcon()
Returns the icon used to represent non-leaf nodes that are not expanded.

 o setLeafIcon
public void setLeafIcon(Icon newIcon)
Sets the icon used to represent leaf nodes.

 o getLeafIcon
public Icon getLeafIcon()
Returns the icon used to represent leaf nodes.

 o setTextSelectionColor
public void setTextSelectionColor(Color newColor)
Sets the color the text is drawn with when the node is selected.

 o getTextSelectionColor
public Color getTextSelectionColor()
Returns the color the text is drawn with when the node is selected.

 o setTextNonSelectionColor
public void setTextNonSelectionColor(Color newColor)
Sets the color the text is drawn with when the node isn't selected.

 o getTextNonSelectionColor
public Color getTextNonSelectionColor()
Returns the color the text is drawn with when the node isn't selected.

 o setBackgroundSelectionColor
public void setBackgroundSelectionColor(Color newColor)
Sets the color to use for the background if node is selected.

 o getBackgroundSelectionColor
public Color getBackgroundSelectionColor()
Returns the color to use for the background if node is selected.

 o setBackgroundNonSelectionColor
public void setBackgroundNonSelectionColor(Color newColor)
Sets the background color to be used for non selected nodes.

 o getBackgroundNonSelectionColor
public Color getBackgroundNonSelectionColor()
Returns the background color to be used for non selected nodes.

 o setBorderSelectionColor
public void setBorderSelectionColor(Color newColor)
Sets the color to use for the border.

 o getBorderSelectionColor
public Color getBorderSelectionColor()
Returns the color the border is drawn.

 o getTreeCellRendererComponent
public Component getTreeCellRendererComponent(JTree tree,
                                              Object value,
                                              boolean sel,
                                              boolean expanded,
                                              boolean leaf,
                                              int row,
                                              boolean hasFocus)
Configures the renderer based on the passed in components. The value is set from messaging value with toString(). The foreground color is set based on the selection and the icon is set based on on leaf and expanded.

 o paint
public void paint(Graphics g)
Paints the value. The background is filled based on selected.

Overrides:
paint in class JComponent
 o getPreferredSize
public Dimension getPreferredSize()
If the preferredSize has been set to a non-null value just return it.

Overrides:
getPreferredSize in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature