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
backgroundNonSelectionColor- Color to use for the background when the node isn't selected.
backgroundSelectionColor- Color to use for the background when a node is selected.
borderSelectionColor- Color to use for the background when the node isn't selected.
closedIcon- Icon used to show non-leaf nodes that aren't expanded.
leafIcon- Icon used to show leaf nodes.
openIcon- Icon used to show non-leaf nodes that are expanded.
selected- Is the value currently selected.
textNonSelectionColor- Color to use for the foreground for non-selected nodes.
textSelectionColor- Color to use for the foreground for selected nodes.
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.
getBorderSelectionColor()
- Returns the color the border is drawn.
getClosedIcon()
- Returns the icon used to represent non-leaf nodes that are not
expanded.
getDefaultClosedIcon()
- Returns the default icon used to represent non-leaf nodes that are not
expanded.
getDefaultLeafIcon()
- Returns the default icon used to represent leaf nodes.
getDefaultOpenIcon()
- Returns the default icon used to represent non-leaf nodes that are expanded.
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.
getTextNonSelectionColor()
- Returns the color the text is drawn with when the node isn't selected.
getTextSelectionColor()
- Returns the color the text is drawn with when the node is selected.
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.
setBorderSelectionColor(Color)
- Sets the color to use for the border.
setClosedIcon(Icon)
- Sets the icon used to represent non-leaf nodes that are not expanded.
setLeafIcon(Icon)
- Sets the icon used to represent leaf nodes.
setOpenIcon(Icon)
- Sets the icon used to represent non-leaf nodes that are expanded.
setTextNonSelectionColor(Color)
- Sets the color the text is drawn with when the node isn't selected.
setTextSelectionColor(Color)
- Sets the color the text is drawn with when the node is selected.
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.
textSelectionColor
protected Color textSelectionColor
- Color to use for the foreground for selected nodes.
textNonSelectionColor
protected Color textNonSelectionColor
- 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.
backgroundNonSelectionColor
protected Color backgroundNonSelectionColor
- Color to use for the background when the node isn't selected.
borderSelectionColor
protected Color borderSelectionColor
- 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.
getDefaultOpenIcon
public Icon getDefaultOpenIcon()
- Returns the default icon used to represent non-leaf nodes that are expanded.
getDefaultClosedIcon
public Icon getDefaultClosedIcon()
- Returns the default icon used to represent non-leaf nodes that are not
expanded.
getDefaultLeafIcon
public Icon getDefaultLeafIcon()
- Returns the default icon used to represent leaf nodes.
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.
setTextSelectionColor
public void setTextSelectionColor(Color newColor)
- Sets the color the text is drawn with when the node is selected.
getTextSelectionColor
public Color getTextSelectionColor()
- Returns the color the text is drawn with when the node is selected.
setTextNonSelectionColor
public void setTextNonSelectionColor(Color newColor)
- Sets the color the text is drawn with when the node isn't selected.
getTextNonSelectionColor
public Color getTextNonSelectionColor()
- 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.
setBorderSelectionColor
public void setBorderSelectionColor(Color newColor)
- Sets the color to use for the border.
getBorderSelectionColor
public Color getBorderSelectionColor()
- Returns the color the border is drawn.
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
Submit a bug or feature