info.aduna.swing
Class JTreeUtil

java.lang.Object
  extended by info.aduna.swing.JTreeUtil

public class JTreeUtil
extends Object


Constructor Summary
JTreeUtil()
           
 
Method Summary
static DefaultMutableTreeNode[] getChildArray(DefaultMutableTreeNode node)
          Returns all DefaultMutableTreeNode children of the specified DefaultMutableTreeNode as an array.
static DefaultMutableTreeNode[] getSiblingArray(DefaultMutableTreeNode node)
          Returns an array holding all siblings of the specified DefaultMutableTreeNode.
static void updateChildOrder(DefaultMutableTreeNode parent, DefaultMutableTreeNode[] children, DefaultTreeModel model)
          Updates the order of the children of the specified DefaultMutableTreeNode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTreeUtil

public JTreeUtil()
Method Detail

getChildArray

public static DefaultMutableTreeNode[] getChildArray(DefaultMutableTreeNode node)
Returns all DefaultMutableTreeNode children of the specified DefaultMutableTreeNode as an array. The Tree must consist entirely of DefaultMutableTreeNodes.


getSiblingArray

public static DefaultMutableTreeNode[] getSiblingArray(DefaultMutableTreeNode node)
Returns an array holding all siblings of the specified DefaultMutableTreeNode. this includes the specified DefaultMutableTreeNode, i.e. the resulting array has a length greater than or equal to 1. The tree must consist entirely of DefaultMutableTreeNodes.


updateChildOrder

public static void updateChildOrder(DefaultMutableTreeNode parent,
                                    DefaultMutableTreeNode[] children,
                                    DefaultTreeModel model)
Updates the order of the children of the specified DefaultMutableTreeNode. All the children should be specified in the desired order in the specified array. They are subsequently inserted and the model is informed.



Copyright © 1997-2008 Aduna. All Rights Reserved.