All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.basic.BasicTreeCellRenderer

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

public class BasicTreeCellRenderer
extends JLabel
implements TreeCellRenderer

Variable Index

 o backgroundColor
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 ClosedIcon
Default icon to use for a closed non-leaf node.
 o closedIcon
Icon used to show non-leaf nodes that aren't expanded.
 o defaultColor
Default non-selection color.
 o foregroundColor
Color to use for the foreground for non-selected nodes.
 o foregroundSelectionColor
Color to use for the foreground for selected nodes.
 o leafIcon
Icon used to show leaf nodes.
 o LeafIcon
Default icon to use for a leaf node.
 o openIcon
Icon used to show non-leaf nodes that are expanded.
 o OpenIcon
Default icon to use for an expanded non-leaf node.
 o selColor
Default selection color.
 o selected
Is the value currently selected.

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 getClosedIcon()
Returns the icon used to represent non-leaf nodes that are not expanded.
 o getForegroundNonSelectionColor()
Returns the color the text is drawn with when the node isn't selected.
 o getForegroundSelectionColor()
Returns the color the text is drawn with when the node is selected.
 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 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 setClosedIcon(Icon)
Sets the icon used to represent non-leaf nodes that are not expanded.
 o setForegroundNonSelectionColor(Color)
Sets the color the text is drawn with when the node isn't selected.
 o setForegroundSelectionColor(Color)
Sets the color the text is drawn with when the node is selected.
 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 updateUI()
Notification from the UIFactory that the L&F has changed.

Variables

 o OpenIcon
 protected static ImageIcon OpenIcon
Default icon to use for an expanded non-leaf node.

 o ClosedIcon
 protected static ImageIcon ClosedIcon
Default icon to use for a closed non-leaf node.

 o LeafIcon
 protected static ImageIcon LeafIcon
Default icon to use for a leaf node.

 o selColor
 protected static final Color selColor
Default selection color.

 o defaultColor
 protected static final Color defaultColor
Default non-selection color.

 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 foregroundSelectionColor
 protected Color foregroundSelectionColor
Color to use for the foreground for selected nodes.

 o foregroundColor
 protected Color foregroundColor
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 backgroundColor
 protected Color backgroundColor
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 updateUI
 public void updateUI()
Notification from the UIFactory that the L&F has changed.

Overrides:
updateUI in class JLabel
 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 setForegroundSelectionColor
 public void setForegroundSelectionColor(Color newColor)
Sets the color the text is drawn with when the node is selected.

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

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

 o getForegroundNonSelectionColor
 public Color getForegroundNonSelectionColor()
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 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