All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xt.xt_TreeCellRenderer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JLabel
                                   |
                                   +----xt.xt_TreeCellRenderer

public class xt_TreeCellRenderer
extends JLabel
implements TreeCellRenderer
xt_TreeCellRenderer draws an XML node within a tree.


Variable Index

 o CollapsedIcon
Icon to use when the item is collapsed.
 o DefaultFont
Font used if the string to be displayed isn't a font.
 o ExpandedIcon
Icon to use when the item is expanded.
 o SelectedBackgroundColor
Colour to use for the background when selected.
 o SelectedFlag
Whether or not the item that was last configured is selected.

Constructor Index

 o xt_TreeCellRenderer()
Constructor.

Method Index

 o getTreeCellRendererComponent(JTree, Object, boolean, boolean, boolean, int, boolean)
This is messaged from JTree whenever it needs to get the size of the component or it wants to draw it.
 o paint(Graphics)
paint is subclassed to draw the background correctly.

Variables

 o SelectedFlag
 protected boolean SelectedFlag
Whether or not the item that was last configured is selected.

 o DefaultFont
 protected static Font DefaultFont
Font used if the string to be displayed isn't a font.

 o CollapsedIcon
 protected static ImageIcon CollapsedIcon
Icon to use when the item is collapsed.

 o ExpandedIcon
 protected static ImageIcon ExpandedIcon
Icon to use when the item is expanded.

 o SelectedBackgroundColor
 protected static final Color SelectedBackgroundColor
Colour to use for the background when selected.

Constructors

 o xt_TreeCellRenderer
 public xt_TreeCellRenderer()
Constructor.

Methods

 o getTreeCellRendererComponent
 public Component getTreeCellRendererComponent(JTree InputTree,
                                               Object InputNode,
                                               boolean InputSelectedFlag,
                                               boolean InputExpandedFlag,
                                               boolean InputLeafFlag,
                                               int InputRowNum,
                                               boolean InputHasFocusFlag)
This is messaged from JTree whenever it needs to get the size of the component or it wants to draw it. This attempts to set the font based on value, which will be a TreeNode.

 o paint
 public void paint(Graphics InputGraphics)
paint is subclassed to draw the background correctly. JLabel currently does not allow backgrounds other than white, and it also fills behind the icon (which isn't desirable).

Overrides:
paint in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index