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
-
backgroundColor
- Color to use for the background when the node isn't selected.
-
backgroundSelectionColor
- Color to use for the background when a node is selected.
-
ClosedIcon
- Default icon to use for a closed non-leaf node.
-
closedIcon
- Icon used to show non-leaf nodes that aren't expanded.
-
defaultColor
- Default non-selection color.
-
foregroundColor
- Color to use for the foreground for non-selected nodes.
-
foregroundSelectionColor
- Color to use for the foreground for selected nodes.
-
leafIcon
- Icon used to show leaf nodes.
-
LeafIcon
- Default icon to use for a leaf node.
-
openIcon
- Icon used to show non-leaf nodes that are expanded.
-
OpenIcon
- Default icon to use for an expanded non-leaf node.
-
selColor
- Default selection color.
-
selected
- Is the value currently selected.
-
BasicTreeCellRenderer()
- Returns a new instance of BasicTreeCellRenderer.
-
getBackgroundNonSelectionColor()
- Returns the background color to be used for non selected nodes.
-
getBackgroundSelectionColor()
- Returns the color to use for the background if node is selected.
-
getClosedIcon()
- Returns the icon used to represent non-leaf nodes that are not
expanded.
-
getForegroundNonSelectionColor()
- Returns the color the text is drawn with when the node isn't selected.
-
getForegroundSelectionColor()
- Returns the color the text is drawn with when the node is selected.
-
getLeafIcon()
- Returns the icon used to represent leaf nodes.
-
getOpenIcon()
- Returns the icon used to represent non-leaf nodes that are expanded.
-
getPreferredSize()
- If the preferredSize has been set to a non-null value
just return it.
-
getTreeCellRendererComponent(JTree, Object, boolean, boolean, boolean, int, boolean)
- Configures the renderer based on the passed in components.
-
paint(Graphics)
- Paints the value.
-
setBackgroundNonSelectionColor(Color)
- Sets the background color to be used for non selected nodes.
-
setBackgroundSelectionColor(Color)
- Sets the color to use for the background if node is selected.
-
setClosedIcon(Icon)
- Sets the icon used to represent non-leaf nodes that are not expanded.
-
setForegroundNonSelectionColor(Color)
- Sets the color the text is drawn with when the node isn't selected.
-
setForegroundSelectionColor(Color)
- Sets the color the text is drawn with when the node is selected.
-
setLeafIcon(Icon)
- Sets the icon used to represent leaf nodes.
-
setOpenIcon(Icon)
- Sets the icon used to represent non-leaf nodes that are expanded.
-
updateUI()
- Notification from the UIFactory that the L&F
has changed.
OpenIcon
protected static ImageIcon OpenIcon
- Default icon to use for an expanded non-leaf node.
ClosedIcon
protected static ImageIcon ClosedIcon
- Default icon to use for a closed non-leaf node.
LeafIcon
protected static ImageIcon LeafIcon
- Default icon to use for a leaf node.
selColor
protected static final Color selColor
- Default selection color.
defaultColor
protected static final Color defaultColor
- Default non-selection color.
selected
protected boolean selected
- Is the value currently selected.
closedIcon
protected transient Icon closedIcon
- Icon used to show non-leaf nodes that aren't expanded.
leafIcon
protected transient Icon leafIcon
- Icon used to show leaf nodes.
openIcon
protected transient Icon openIcon
- Icon used to show non-leaf nodes that are expanded.
foregroundSelectionColor
protected Color foregroundSelectionColor
- Color to use for the foreground for selected nodes.
foregroundColor
protected Color foregroundColor
- Color to use for the foreground for non-selected nodes.
backgroundSelectionColor
protected Color backgroundSelectionColor
- Color to use for the background when a node is selected.
backgroundColor
protected Color backgroundColor
- Color to use for the background when the node isn't selected.
BasicTreeCellRenderer
public BasicTreeCellRenderer()
- Returns a new instance of BasicTreeCellRenderer. Alignment is
set to left aligned.
updateUI
public void updateUI()
- Notification from the UIFactory that the L&F
has changed.
- Overrides:
- updateUI in class JLabel
setOpenIcon
public void setOpenIcon(Icon newIcon)
- Sets the icon used to represent non-leaf nodes that are expanded.
getOpenIcon
public Icon getOpenIcon()
- Returns the icon used to represent non-leaf nodes that are expanded.
setClosedIcon
public void setClosedIcon(Icon newIcon)
- Sets the icon used to represent non-leaf nodes that are not expanded.
getClosedIcon
public Icon getClosedIcon()
- Returns the icon used to represent non-leaf nodes that are not
expanded.
setLeafIcon
public void setLeafIcon(Icon newIcon)
- Sets the icon used to represent leaf nodes.
getLeafIcon
public Icon getLeafIcon()
- Returns the icon used to represent leaf nodes.
setForegroundSelectionColor
public void setForegroundSelectionColor(Color newColor)
- Sets the color the text is drawn with when the node is selected.
getForegroundSelectionColor
public Color getForegroundSelectionColor()
- Returns the color the text is drawn with when the node is selected.
setForegroundNonSelectionColor
public void setForegroundNonSelectionColor(Color newColor)
- Sets the color the text is drawn with when the node isn't selected.
getForegroundNonSelectionColor
public Color getForegroundNonSelectionColor()
- Returns the color the text is drawn with when the node isn't selected.
setBackgroundSelectionColor
public void setBackgroundSelectionColor(Color newColor)
- Sets the color to use for the background if node is selected.
getBackgroundSelectionColor
public Color getBackgroundSelectionColor()
- Returns the color to use for the background if node is selected.
setBackgroundNonSelectionColor
public void setBackgroundNonSelectionColor(Color newColor)
- Sets the background color to be used for non selected nodes.
getBackgroundNonSelectionColor
public Color getBackgroundNonSelectionColor()
- Returns the background color to be used for non selected nodes.
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.
paint
public void paint(Graphics g)
- Paints the value. The background is filled based on selected.
- Overrides:
- paint in class JComponent
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