Displays an entry in a tree. DefaultTreeCellRenderer is not opaque and unless you subclass paint you should not change this. See How to Use Trees in The Java Tutorial for examples of customizing node display using this class.
The set of icons and colors used by DefaultTreeCellRenderer can be configured using the various setter methods. The value for each property is initialized from the defaults table. When the look and feel changes (updateUI is invoked), any properties that have a value of type UIResource are refreshed from the defaults table. The following table lists the mapping between DefaultTreeCellRenderer property and defaults table key:
Property:
Key:
"leafIcon""Tree.leafIcon" "closedIcon""Tree.closedIcon" "openIcon""Tree.openIcon" "textSelectionColor""Tree.selectionForeground" "textNonSelectionColor""Tree.textForeground" "backgroundSelectionColor""Tree.selectionBackground" "backgroundNonSelectionColor""Tree.textBackground" "borderSelectionColor""Tree.selectionBorderColor"
Implementation Note: This class overrides invalidate, validate, revalidate, repaint, and firePropertyChange solely to improve performance. If not overridden, these frequently called methods would execute code paths that are unnecessary for the default tree cell renderer. If you write your own renderer, take care to weigh the benefits and drawbacks of overriding these methods.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
Displays an entry in a tree. DefaultTreeCellRenderer is not opaque and unless you subclass paint you should not change this. See How to Use Trees in The Java Tutorial for examples of customizing node display using this class. The set of icons and colors used by DefaultTreeCellRenderer can be configured using the various setter methods. The value for each property is initialized from the defaults table. When the look and feel changes (updateUI is invoked), any properties that have a value of type UIResource are refreshed from the defaults table. The following table lists the mapping between DefaultTreeCellRenderer property and defaults table key: Property: Key: "leafIcon""Tree.leafIcon" "closedIcon""Tree.closedIcon" "openIcon""Tree.openIcon" "textSelectionColor""Tree.selectionForeground" "textNonSelectionColor""Tree.textForeground" "backgroundSelectionColor""Tree.selectionBackground" "backgroundNonSelectionColor""Tree.textBackground" "borderSelectionColor""Tree.selectionBorderColor" Implementation Note: This class overrides invalidate, validate, revalidate, repaint, and firePropertyChange solely to improve performance. If not overridden, these frequently called methods would execute code paths that are unnecessary for the default tree cell renderer. If you write your own renderer, take care to weigh the benefits and drawbacks of overriding these methods. Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
(->default-tree-cell-renderer)
Constructor.
Creates a DefaultTreeCellRenderer. Icons and text color are determined from the UIManager.
Constructor. Creates a DefaultTreeCellRenderer. Icons and text color are determined from the UIManager.
(fire-property-change this property-name old-value new-value)
Overridden for performance reasons. See the Implementation Note for more information.
property-name - the programmatic name of the property that was changed - java.lang.String
old-value - the old value of the property (as a byte) - byte
new-value - the new value of the property (as a byte) - byte
Overridden for performance reasons. See the Implementation Note for more information. property-name - the programmatic name of the property that was changed - `java.lang.String` old-value - the old value of the property (as a byte) - `byte` new-value - the new value of the property (as a byte) - `byte`
(get-background-non-selection-color this)
Returns the background color to be used for non selected nodes.
returns: java.awt.Color
Returns the background color to be used for non selected nodes. returns: `java.awt.Color`
(get-background-selection-color this)
Returns the color to use for the background if node is selected.
returns: java.awt.Color
Returns the color to use for the background if node is selected. returns: `java.awt.Color`
(get-border-selection-color this)
Returns the color the border is drawn.
returns: java.awt.Color
Returns the color the border is drawn. returns: `java.awt.Color`
(get-closed-icon this)
Returns the icon used to represent non-leaf nodes that are not expanded.
returns: javax.swing.Icon
Returns the icon used to represent non-leaf nodes that are not expanded. returns: `javax.swing.Icon`
(get-default-closed-icon this)
Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are not expanded.
returns: javax.swing.Icon
Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are not expanded. returns: `javax.swing.Icon`
(get-default-leaf-icon this)
Returns the default icon, for the current laf, that is used to represent leaf nodes.
returns: javax.swing.Icon
Returns the default icon, for the current laf, that is used to represent leaf nodes. returns: `javax.swing.Icon`
(get-default-open-icon this)
Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are expanded.
returns: javax.swing.Icon
Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are expanded. returns: `javax.swing.Icon`
(get-font this)
Gets the font of this component.
returns: this component's font; if a font has not been set
for this component, the font of its parent is returned - java.awt.Font
Gets the font of this component. returns: this component's font; if a font has not been set for this component, the font of its parent is returned - `java.awt.Font`
(get-leaf-icon this)
Returns the icon used to represent leaf nodes.
returns: javax.swing.Icon
Returns the icon used to represent leaf nodes. returns: `javax.swing.Icon`
(get-open-icon this)
Returns the icon used to represent non-leaf nodes that are expanded.
returns: javax.swing.Icon
Returns the icon used to represent non-leaf nodes that are expanded. returns: `javax.swing.Icon`
(get-preferred-size this)
Overrides JComponent.getPreferredSize to return slightly wider preferred size value.
returns: the value of the preferredSize property - java.awt.Dimension
Overrides JComponent.getPreferredSize to return slightly wider preferred size value. returns: the value of the preferredSize property - `java.awt.Dimension`
(get-text-non-selection-color this)
Returns the color the text is drawn with when the node isn't selected.
returns: java.awt.Color
Returns the color the text is drawn with when the node isn't selected. returns: `java.awt.Color`
(get-text-selection-color this)
Returns the color the text is drawn with when the node is selected.
returns: java.awt.Color
Returns the color the text is drawn with when the node is selected. returns: `java.awt.Color`
(get-tree-cell-renderer-component this
tree
value
sel
expanded
leaf
row
has-focus)
Configures the renderer based on the passed in components. The value is set from messaging the tree with convertValueToText, which ultimately invokes toString on value. The foreground color is set based on the selection and the icon is set based on the leaf and expanded parameters.
tree - javax.swing.JTree
value - java.lang.Object
sel - boolean
expanded - boolean
leaf - boolean
row - int
has-focus - boolean
returns: the Component that the renderer uses to draw the value - java.awt.Component
Configures the renderer based on the passed in components. The value is set from messaging the tree with convertValueToText, which ultimately invokes toString on value. The foreground color is set based on the selection and the icon is set based on the leaf and expanded parameters. tree - `javax.swing.JTree` value - `java.lang.Object` sel - `boolean` expanded - `boolean` leaf - `boolean` row - `int` has-focus - `boolean` returns: the Component that the renderer uses to draw the value - `java.awt.Component`
(invalidate this)
Overridden for performance reasons. See the Implementation Note for more information.
Overridden for performance reasons. See the Implementation Note for more information.
(paint this g)
Paints the value. The background is filled based on selected.
g - the Graphics context in which to paint - java.awt.Graphics
Paints the value. The background is filled based on selected. g - the Graphics context in which to paint - `java.awt.Graphics`
(repaint this)
(repaint this r)
(repaint this tm x y width height)
Overridden for performance reasons. See the Implementation Note for more information.
tm - this parameter is not used - long
x - the x value of the dirty region - int
y - the y value of the dirty region - int
width - the width of the dirty region - int
height - the height of the dirty region - int
Overridden for performance reasons. See the Implementation Note for more information. tm - this parameter is not used - `long` x - the x value of the dirty region - `int` y - the y value of the dirty region - `int` width - the width of the dirty region - `int` height - the height of the dirty region - `int`
(revalidate this)
Overridden for performance reasons. See the Implementation Note for more information.
Overridden for performance reasons. See the Implementation Note for more information.
(set-background this color)
Subclassed to map ColorUIResources to null. If color is null, or a ColorUIResource, this has the effect of letting the background color of the JTree show through. On the other hand, if color is non-null, and not a ColorUIResource, the background becomes color.
color - the desired background Color - java.awt.Color
Subclassed to map ColorUIResources to null. If color is null, or a ColorUIResource, this has the effect of letting the background color of the JTree show through. On the other hand, if color is non-null, and not a ColorUIResource, the background becomes color. color - the desired background Color - `java.awt.Color`
(set-background-non-selection-color this new-color)
Sets the background color to be used for non selected nodes.
new-color - java.awt.Color
Sets the background color to be used for non selected nodes. new-color - `java.awt.Color`
(set-background-selection-color this new-color)
Sets the color to use for the background if node is selected.
new-color - java.awt.Color
Sets the color to use for the background if node is selected. new-color - `java.awt.Color`
(set-border-selection-color this new-color)
Sets the color to use for the border.
new-color - java.awt.Color
Sets the color to use for the border. new-color - `java.awt.Color`
(set-closed-icon this new-icon)
Sets the icon used to represent non-leaf nodes that are not expanded.
new-icon - javax.swing.Icon
Sets the icon used to represent non-leaf nodes that are not expanded. new-icon - `javax.swing.Icon`
(set-font this font)
Subclassed to map FontUIResources to null. If font is null, or a FontUIResource, this has the effect of letting the font of the JTree show through. On the other hand, if font is non-null, and not a FontUIResource, the font becomes font.
font - the desired Font for this component - java.awt.Font
Subclassed to map FontUIResources to null. If font is null, or a FontUIResource, this has the effect of letting the font of the JTree show through. On the other hand, if font is non-null, and not a FontUIResource, the font becomes font. font - the desired Font for this component - `java.awt.Font`
(set-leaf-icon this new-icon)
Sets the icon used to represent leaf nodes.
new-icon - javax.swing.Icon
Sets the icon used to represent leaf nodes. new-icon - `javax.swing.Icon`
(set-open-icon this new-icon)
Sets the icon used to represent non-leaf nodes that are expanded.
new-icon - javax.swing.Icon
Sets the icon used to represent non-leaf nodes that are expanded. new-icon - `javax.swing.Icon`
(set-text-non-selection-color this new-color)
Sets the color the text is drawn with when the node isn't selected.
new-color - java.awt.Color
Sets the color the text is drawn with when the node isn't selected. new-color - `java.awt.Color`
(set-text-selection-color this new-color)
Sets the color the text is drawn with when the node is selected.
new-color - java.awt.Color
Sets the color the text is drawn with when the node is selected. new-color - `java.awt.Color`
(update-ui this)
Resets the UI property to a value from the current look and feel.
Resets the UI property to a value from the current look and feel.
(validate this)
Overridden for performance reasons. See the Implementation Note for more information.
Overridden for performance reasons. See the Implementation Note for more information.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close