Holger's
Java API

com.antelmann.util.gui
Class CategoryNode<T>

java.lang.Object
  extended by com.antelmann.util.gui.CategoryNode<T>
All Implemented Interfaces:
Wrapped<Category<T>>, TreeNode

public class CategoryNode<T>
extends Object
implements Wrapped<Category<T>>, TreeNode

provides a model for organizing categories in a tree.

Since:
21.06.2011, 14:34:59
Author:
Holger Antelmann
See Also:
createRootNode(Collection, String, Object), JCategoryField

Constructor Summary
CategoryNode(Category<T> category, T context)
           
CategoryNode(Category<T> category, ValueRetriever<T> contextRetriever)
           
 
Method Summary
 Enumeration<Category<T>> children()
           
static CategoryNode<?> createNode(Category<?> category, Object context)
           
static TreePath createPath(TreeModel model, Category<?> category, Object context)
           
static TreeNode createRootNode(Collection<? extends Category<?>> topLevelCategories, String title, Object context)
           
 boolean equals(Object obj)
           
 boolean getAllowsChildren()
           
 TreeNode getChildAt(int childIndex)
           
 int getChildCount()
           
 int getIndex(TreeNode node)
           
 TreeNode getParent()
           
 int hashCode()
           
protected  void initChildren()
           
 boolean isLeaf()
           
 void refreshChildren()
           
static Category<?> selectCategory(TreeNode categoryRoot, Object context, Category<?> defaultCategory, String title, Component parent, Filter<? super Category<?>> filter, TreeCellRenderer renderer)
           
 String toString()
           
 Category<T> unwrap()
          returns the embedded instance that this wrapper encloses
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CategoryNode

public CategoryNode(Category<T> category,
                    T context)

CategoryNode

public CategoryNode(Category<T> category,
                    ValueRetriever<T> contextRetriever)
Method Detail

refreshChildren

public void refreshChildren()

initChildren

protected void initChildren()

getChildAt

public TreeNode getChildAt(int childIndex)
Specified by:
getChildAt in interface TreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface TreeNode

getParent

public TreeNode getParent()
Specified by:
getParent in interface TreeNode

getIndex

public int getIndex(TreeNode node)
Specified by:
getIndex in interface TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface TreeNode

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface TreeNode

children

public Enumeration<Category<T>> children()
Specified by:
children in interface TreeNode

toString

public String toString()
Overrides:
toString in class Object

unwrap

public final Category<T> unwrap()
Description copied from interface: Wrapped
returns the embedded instance that this wrapper encloses

Specified by:
unwrap in interface Wrapped<Category<T>>

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

createNode

public static CategoryNode<?> createNode(Category<?> category,
                                         Object context)

selectCategory

public static Category<?> selectCategory(TreeNode categoryRoot,
                                         Object context,
                                         Category<?> defaultCategory,
                                         String title,
                                         Component parent,
                                         Filter<? super Category<?>> filter,
                                         TreeCellRenderer renderer)
See Also:
JSearchTree, TreeUtils.createTreePathTipRenderer(String)

createRootNode

public static TreeNode createRootNode(Collection<? extends Category<?>> topLevelCategories,
                                      String title,
                                      Object context)

createPath

public static TreePath createPath(TreeModel model,
                                  Category<?> category,
                                  Object context)


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads