All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.netobjects.nfx.sitebrowser.SiteTreeCellRenderer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JLabel
                                   |
                                   +----com.netobjects.nfx.sitebrowser.SiteTreeCellRenderer

public class SiteTreeCellRenderer
extends JLabel
implements TreeCellRenderer

Variable Index

 o defaultFont
 o dmSiteBrowser
 o selected
 o SelectedBackgroundColor

Constructor Index

 o SiteTreeCellRenderer(SiteBrowser)
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)
The paint method is overridden to draw the background correctly.

Variables

 o dmSiteBrowser
 static SiteBrowser dmSiteBrowser
 o defaultFont
 protected static Font defaultFont
 o selected
 protected boolean selected
 o SelectedBackgroundColor
 protected static final Color SelectedBackgroundColor

Constructors

 o SiteTreeCellRenderer
 public SiteTreeCellRenderer(SiteBrowser browser)
Constructor.

Methods

 o getTreeCellRendererComponent
 public Component getTreeCellRendererComponent(JTree tree,
                                               Object value,
                                               boolean selected,
                                               boolean expanded,
                                               boolean leaf,
                                               int row,
                                               boolean hasFocus)
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 g)
The paint method is overridden to draw the background correctly. JLabel currently does not allow backgrounds other than white, and it will also fill behind the icon, something that isn't desirable.

Overrides:
paint in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index