com.sas.swing.visuals
Class HierarchyListCellRenderer

com.sas.swing.visuals.HierarchyListCellRenderer
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.ListCellRenderer, javax.swing.SwingConstants

public class HierarchyListCellRenderer

A ListCellRenderer which displays an item indented by its depth in a tree structure.

See Also:
Serialized Form

Field Summary
protected  com.sas.models.TreeInterface _treeHierarchy
          TreeInterface by which to determine the depth of an item.
 
Constructor Summary
HierarchyListCellRenderer()
           
 
Method Summary
 java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)
           
 void setHierarchy(com.sas.models.TreeInterface hierarchy)
          Sets the hierarchy from which to determine the depth of an item.
 void setIndent(int indent)
          Sets the number of pixels to indent the item for each depth value.
 

Field Detail

_treeHierarchy

protected com.sas.models.TreeInterface _treeHierarchy
TreeInterface by which to determine the depth of an item.

Constructor Detail

HierarchyListCellRenderer

public HierarchyListCellRenderer()
Method Detail

getListCellRendererComponent

public java.awt.Component getListCellRendererComponent(javax.swing.JList list,
                                                       java.lang.Object value,
                                                       int index,
                                                       boolean isSelected,
                                                       boolean cellHasFocus)
Specified by:
getListCellRendererComponent in interface javax.swing.ListCellRenderer
Overrides:
getListCellRendererComponent in class javax.swing.DefaultListCellRenderer

setHierarchy

public void setHierarchy(com.sas.models.TreeInterface hierarchy)
Sets the hierarchy from which to determine the depth of an item.

Parameters:
hierarchy - the hierarchy from which to determine the depth of an item

setIndent

public void setIndent(int indent)
Sets the number of pixels to indent the item for each depth value. For example, if the indent is 10 and the depth is 3, the item will be indented 30 pixels (3 x 10).

Parameters:
indent - the amount of pixels for each depth value to indent the item
Throws:
java.lang.IllegalArgumentException - if indent <= 0.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.