ilog.cpl.tree.renderer
Class IlpViewRenderer

java.lang.Object
  extended by ilog.cpl.tree.renderer.IlpAbstractTreeViewRenderer
      extended by ilog.cpl.tree.renderer.IlpViewRenderer

public class IlpViewRenderer
extends IlpAbstractTreeViewRenderer

This class gives control over an IlpTreeView.

This class shows all the properties that can be customized in the tree view using cascading style sheets.

The CSS configuration can be applied to the tree view, using IlpTreeView.setStyleSheets(java.lang.String[]).

To customize the tree view configuration programmatically, use IlpTreeView.

This class is a CSS stylable JavaBean. It can be configured as follows in a CSS file:

 View {
   selectionLookAndFeel : Highlight;
   background: white;
   scrollsOnExpand: false;
 }
 

Since:
JTGO 4.0

Constructor Summary
IlpViewRenderer()
           
 
Method Summary
 Color getBackground()
          Returns the view background color.
 TreeCellRenderer getCellRenderer()
          Returns the TreeCellRenderer that is used to draw each cell.
 String getCSSID()
          Returns the CSS identifier of this renderer.
 boolean getExpandsSelectedPaths()
          Returns the property that denotes whether the paths are automatically expanded when selected or not.
 int getRowHeight()
          Returns the height of each cell in pixels.
 boolean getScrollsOnExpand()
          Returns the scrollsOnExpand property that determines whether the tree scrolls to show previously hidden children.
 int getSelectionLookAndFeel()
          Returns the way the selection is rendered/manipulated by the end-user.
 boolean getShowsRootHandles()
          Returns the value of the showsRootHandles property that specifies whether the node handles should be displayed.
 int getToggleClickCount()
          Returns the click count to toggle the expand/collapse state of the tree nodes.
 IlpTreeView getView()
          Access to the tree view
 boolean isRootVisible()
          Returns true if the root node of the tree is displayed.
 void reset()
          Resets all the settings of this renderer.
 void setBackground(Color v)
          Sets the view background color.
 void setCellRenderer(TreeCellRenderer v)
          Sets the TreeCellRenderer that is used to draw each cell.
 void setExpandsSelectedPaths(boolean v)
          Configures the expandsSelectedPaths property.
 void setRootVisible(boolean v)
          Sets the property that denotes whether the root node of the tree is displayed or not.
 void setRowHeight(int v)
          Sets the height of each cell in pixels.
 void setScrollsOnExpand(boolean v)
          Sets the scrollsOnExpand property that determines whether the tree scrolls to show previously hidden children.
 void setSelectionLookAndFeel(int v)
          Sets the way the selection is rendered/manipulated by the end-user.
 void setShowsRootHandles(boolean v)
          Sets the value of the showsRootHandles property that specifies whether the node handles should be displayed.
 void setToggleClickCount(int v)
          Sets the click count to toggle the expand/collapse state of the tree nodes.
 
Methods inherited from class ilog.cpl.tree.renderer.IlpAbstractTreeViewRenderer
attach, detach, getContext, getViewSupport, isRendererEnabled, setRendererEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpViewRenderer

public IlpViewRenderer()
Method Detail

getView

public IlpTreeView getView()
Access to the tree view

Internal method or field: do not use!

getCSSID

public String getCSSID()
Returns the CSS identifier of this renderer.

Specified by:
getCSSID in class IlpAbstractTreeViewRenderer
Internal method or field: do not use!

isRootVisible

public boolean isRootVisible()
Returns true if the root node of the tree is displayed.

Returns:
true if the root node of the tree is displayed.

setRootVisible

public void setRootVisible(boolean v)
Sets the property that denotes whether the root node of the tree is displayed or not.

Parameters:
v - Root visibility.

getShowsRootHandles

public boolean getShowsRootHandles()
Returns the value of the showsRootHandles property that specifies whether the node handles should be displayed.

The default value of this property depends on the constructor used to create the tree view. Some look and feels do not support handles and ignore this property.


setShowsRootHandles

public void setShowsRootHandles(boolean v)
Sets the value of the showsRootHandles property that specifies whether the node handles should be displayed.

The default value of this property depends on the constructor used to create the tree view. Some look and feels do not support handles and ignore this property.

Parameters:
v - Root handle visibility.

getScrollsOnExpand

public boolean getScrollsOnExpand()
Returns the scrollsOnExpand property that determines whether the tree scrolls to show previously hidden children.


setScrollsOnExpand

public void setScrollsOnExpand(boolean v)
Sets the scrollsOnExpand property that determines whether the tree scrolls to show previously hidden children.

If this property is true, when a node is expanded the tree scrolls to make the maximum number of children visible. In some look and feels, trees do not need to scroll when expanded; those look and feels ignore this property.

By default this property is true.

Parameters:
v - Indicates whether the tree should scroll to show hidden children.

getSelectionLookAndFeel

public int getSelectionLookAndFeel()
Returns the way the selection is rendered/manipulated by the end-user.

Returns:
selection mode. One of: IlpTreeView.HIGHLIGHT_SELECTION_LOOK_AND_FEEL, IlpTreeView.CHECKBOX_SELECTION_LOOK_AND_FEEL.

setSelectionLookAndFeel

public void setSelectionLookAndFeel(int v)
Sets the way the selection is rendered/manipulated by the end-user.

This method is provided as a convenient way to set the selection rendering properties.

Parameters:
v - One of: IlpTreeView.HIGHLIGHT_SELECTION_LOOK_AND_FEEL, IlpTreeView.CHECKBOX_SELECTION_LOOK_AND_FEEL.

getCellRenderer

public TreeCellRenderer getCellRenderer()
Returns the TreeCellRenderer that is used to draw each cell.


setCellRenderer

public void setCellRenderer(TreeCellRenderer v)
Sets the TreeCellRenderer that is used to draw each cell.


getExpandsSelectedPaths

public boolean getExpandsSelectedPaths()
Returns the property that denotes whether the paths are automatically expanded when selected or not.


setExpandsSelectedPaths

public void setExpandsSelectedPaths(boolean v)
Configures the expandsSelectedPaths property.

When true, any time the selection is changed, the tree path parents are expanded to make them visible.

When false, when the selection changes the nodes parents are not made visible. This is useful to maintain paths that are not always visible in the selection model.

Note: A node is said to be visible when all its parent nodes are expanded. This does not mean that the node is currently in the visible area of the tree.


getRowHeight

public int getRowHeight()
Returns the height of each cell in pixels.

If the specified value is less than or equal to zero, the current cell renderer is queried for the height of each row.


setRowHeight

public void setRowHeight(int v)
Sets the height of each cell in pixels.

If the specified value is less than or equal to zero, the current cell renderer is queried for the height of each row.

Parameters:
v - Height of the tree row.

getBackground

public Color getBackground()
Returns the view background color.


setBackground

public void setBackground(Color v)
Sets the view background color.

Parameters:
v - Background color.

getToggleClickCount

public int getToggleClickCount()
Returns the click count to toggle the expand/collapse state of the tree nodes.


setToggleClickCount

public void setToggleClickCount(int v)
Sets the click count to toggle the expand/collapse state of the tree nodes.

Parameters:
v - Number of click counts to toggle the expand/collapse state of tree nodes.

reset

public void reset()
Resets all the settings of this renderer.

Specified by:
reset in class IlpAbstractTreeViewRenderer
Internal method or field: do not use!


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