org.openbp.swing.components.tree
Class TreeExpander

java.lang.Object
  extended by org.openbp.swing.components.tree.TreeExpander

public class TreeExpander
extends java.lang.Object

Expander that automatically expands a tree control so that the available drawing area of the tree is filled to the maximum extend without the need of displaying a scrollbar.

Author:
Baumgartner Michael

Nested Class Summary
static class TreeExpander.TreeRow
          Wrapper for nodes that can be expanded.
 
Constructor Summary
TreeExpander(javax.swing.JTree tree)
          Contructor.
 
Method Summary
 void expandLevel(int level)
          Expand all nodes till a level.
 void intelliExpand(int level)
          Expand the tree in a way that no scroll bar is needed.
 void simpleExpand(int level)
          Expand the levels of a tree only if the children of the level can be displayed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeExpander

public TreeExpander(javax.swing.JTree tree)
Contructor.

Parameters:
tree - The tree to expand
Method Detail

simpleExpand

public void simpleExpand(int level)
Expand the levels of a tree only if the children of the level can be displayed.

Parameters:
level - The level of the expansion

intelliExpand

public void intelliExpand(int level)
Expand the tree in a way that no scroll bar is needed. But the display of the tree is as full as possible.

Parameters:
level - The level of the expansion. Level 0 expands only the children of the root node. Level 1 the children of the children of the root.

expandLevel

public void expandLevel(int level)
Expand all nodes till a level. The level 0 means all children of the root node are visible. Level 1 means all children of the children of the root are visible and so on.

Parameters:
level - The level to expand to


Copyright © 2011. All Rights Reserved.