Liking cljdoc? Tell your friends :D

javax.swing.tree.DefaultTreeCellRenderer

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.
raw docstring

->default-tree-cell-rendererclj

(->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.
raw docstring

fire-property-changeclj

(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`
raw docstring

get-background-non-selection-colorclj

(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`
raw docstring

get-background-selection-colorclj

(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`
raw docstring

get-border-selection-colorclj

(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`
raw docstring

get-closed-iconclj

(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`
raw docstring

get-default-closed-iconclj

(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`
raw docstring

get-default-leaf-iconclj

(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`
raw docstring

get-default-open-iconclj

(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`
raw docstring

get-fontclj

(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`
raw docstring

get-leaf-iconclj

(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`
raw docstring

get-open-iconclj

(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`
raw docstring

get-preferred-sizeclj

(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`
raw docstring

get-text-non-selection-colorclj

(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`
raw docstring

get-text-selection-colorclj

(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`
raw docstring

get-tree-cell-renderer-componentclj

(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`
raw docstring

invalidateclj

(invalidate this)

Overridden for performance reasons. See the Implementation Note for more information.

Overridden for performance reasons.
See the Implementation Note
for more information.
raw docstring

paintclj

(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`
raw docstring

repaintclj

(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`
raw docstring

revalidateclj

(revalidate this)

Overridden for performance reasons. See the Implementation Note for more information.

Overridden for performance reasons.
See the Implementation Note
for more information.
raw docstring

set-backgroundclj

(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`
raw docstring

set-background-non-selection-colorclj

(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`
raw docstring

set-background-selection-colorclj

(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`
raw docstring

set-border-selection-colorclj

(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`
raw docstring

set-closed-iconclj

(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`
raw docstring

set-fontclj

(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`
raw docstring

set-leaf-iconclj

(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`
raw docstring

set-open-iconclj

(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`
raw docstring

set-text-non-selection-colorclj

(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`
raw docstring

set-text-selection-colorclj

(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`
raw docstring

update-uiclj

(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.
raw docstring

validateclj

(validate this)

Overridden for performance reasons. See the Implementation Note for more information.

Overridden for performance reasons.
See the Implementation Note
for more information.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close