ilog.cpl.tree
Class IlpTreeCellRenderer

java.lang.Object
  extended by ilog.cpl.tree.IlpTreeCellRenderer
All Implemented Interfaces:
TreeCellRenderer

public class IlpTreeCellRenderer
extends Object
implements TreeCellRenderer

Tree cell renderer dispatcher for an IlpTreeNode object. This tree cell renderer uses the following property:

When the class property is not defined, the rendering is done by a default renderer, that depends on the business object being represented.

Predefined business objects have a list of properties that can be used to customize their graphic representation in the Tree Component. Please refer to the User's Documentation for the list of properties of each predefined business object.

User-defined business objects are represented using a default renderer, that creates a Swing JLabel customized with the following properties:

The default tree cell renderer is also able to render the object selection and focus state according to the value of property selectionFocusMode. The possible values for this property are:

Since:
JTGO 3.0

Field Summary
static boolean OPTIMIZE
          Indicates this cell renderer to optimize the rendering of a tree node by checking if it is still needed or not, for instance, if the node has been already removed from the tree model.
 
Constructor Summary
IlpTreeCellRenderer()
          Creates a default tree cell renderer.
 
Method Summary
 Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
          Calculates the representation of a tree node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTIMIZE

public static boolean OPTIMIZE
Indicates this cell renderer to optimize the rendering of a tree node by checking if it is still needed or not, for instance, if the node has been already removed from the tree model.

Constructor Detail

IlpTreeCellRenderer

public IlpTreeCellRenderer()
Creates a default tree cell renderer.

Method Detail

getTreeCellRendererComponent

public Component getTreeCellRendererComponent(JTree tree,
                                              Object value,
                                              boolean selected,
                                              boolean expanded,
                                              boolean leaf,
                                              int row,
                                              boolean hasFocus)
Calculates the representation of a tree node. Using the associated tree style sheets, it gets the different graphic elements and returns a component based on them.

Specified by:
getTreeCellRendererComponent in interface TreeCellRenderer
Parameters:
tree - The tree in which the cell is drawn.
value - The TreeNode object that will be represented in the cell.
selected - true if the node is selected, false if the node is not selected.
expanded - true if the node is expanded, false if the node is collapsed.
leaf - true if the node is a leaf node, false if the node is an interior node between root and leaf.
row - The number of the line where the tree cell is, when the tree is seen as a list with one cell on each line.
hasFocus - true if the node has focus, false if the node does not have focus.
Returns:
The rendering component.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.