com.sas.dataselectors.calculateditems
Class DataSourceTreeCellRenderer

com.sas.dataselectors.calculateditems.DataSourceTreeCellRenderer
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants, javax.swing.tree.TreeCellRenderer

public class DataSourceTreeCellRenderer

Description: Copyright: Copyright (c) 2002 Company: SAS

See Also:
Serialized Form

Field Summary
protected static java.awt.Font m_boldDefaultFont
           
protected static javax.swing.ImageIcon m_dataSourceIcon
           
protected static java.awt.Font m_defaultFont
          Font used if the string to be displayed isn't a font.
 
Constructor Summary
DataSourceTreeCellRenderer(javax.swing.JTree source)
           
 
Method Summary
 java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree, java.lang.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.
 void paint(java.awt.Graphics g)
          paint is subclassed to draw the background correctly.
 

Field Detail

m_defaultFont

protected static java.awt.Font m_defaultFont
Font used if the string to be displayed isn't a font.


m_boldDefaultFont

protected static java.awt.Font m_boldDefaultFont

m_dataSourceIcon

protected static javax.swing.ImageIcon m_dataSourceIcon
Constructor Detail

DataSourceTreeCellRenderer

public DataSourceTreeCellRenderer(javax.swing.JTree source)
Method Detail

getTreeCellRendererComponent

public java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree,
                                                       java.lang.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.

Specified by:
getTreeCellRendererComponent in interface javax.swing.tree.TreeCellRenderer
Overrides:
getTreeCellRendererComponent in class javax.swing.tree.DefaultTreeCellRenderer

paint

public void paint(java.awt.Graphics g)
paint is subclassed 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 javax.swing.tree.DefaultTreeCellRenderer



Copyright © 2009 SAS Institute Inc. All Rights Reserved.