Module swing.tree.component.main
Class DefaultMutableTreeNodeFactory
java.lang.Object
io.github.astrapi69.swing.tree.factory.DefaultMutableTreeNodeFactory
The factory class
DefaultMutableTreeNodeFactory holds methods for creating
DefaultMutableTreeNode objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> DefaultMutableTreeNodenewDefaultMutableTreeNode(DefaultMutableTreeNode parent, T userObject) Factory method that creates a newDefaultMutableTreeNodeobjectstatic <T> DefaultMutableTreeNodenewDefaultMutableTreeNode(DefaultMutableTreeNode parent, T userObject, boolean addToParent) Factory method that creates a newDefaultMutableTreeNodeobjectstatic <T> DefaultMutableTreeNodenewDefaultMutableTreeNode(DefaultMutableTreeNode parent, T userObject, boolean allowsChildren, boolean addToParent) Factory method that creates a newDefaultMutableTreeNodeobjectstatic <T> DefaultMutableTreeNodenewDefaultMutableTreeNode(T userObject) Factory method that creates a newDefaultMutableTreeNodeobjectstatic <T> DefaultMutableTreeNodenewDefaultMutableTreeNode(T userObject, boolean allowsChildren) Factory method that creates a newDefaultMutableTreeNodeobject
-
Method Details
-
newDefaultMutableTreeNode
public static <T> DefaultMutableTreeNode newDefaultMutableTreeNode(DefaultMutableTreeNode parent, T userObject) Factory method that creates a newDefaultMutableTreeNodeobject- Type Parameters:
T- the generic type of the given user object- Parameters:
parent- the parentDefaultMutableTreeNodeobjectuserObject- the user object- Returns:
- the new
DefaultMutableTreeNodeobject
-
newDefaultMutableTreeNode
public static <T> DefaultMutableTreeNode newDefaultMutableTreeNode(DefaultMutableTreeNode parent, T userObject, boolean addToParent) Factory method that creates a newDefaultMutableTreeNodeobject- Type Parameters:
T- the generic type of the given user object- Parameters:
parent- the parentDefaultMutableTreeNodeobjectuserObject- the user objectaddToParent- the flag that indicates if it should add to the parent- Returns:
- the new
DefaultMutableTreeNodeobject
-
newDefaultMutableTreeNode
public static <T> DefaultMutableTreeNode newDefaultMutableTreeNode(DefaultMutableTreeNode parent, T userObject, boolean allowsChildren, boolean addToParent) Factory method that creates a newDefaultMutableTreeNodeobject- Type Parameters:
T- the generic type of the given user object- Parameters:
parent- the parentDefaultMutableTreeNodeobjectuserObject- the user objectallowsChildren- the flag if children is allowedaddToParent- the flag that indicates if it should add to the parent- Returns:
- the new
DefaultMutableTreeNodeobject
-
newDefaultMutableTreeNode
public static <T> DefaultMutableTreeNode newDefaultMutableTreeNode(T userObject, boolean allowsChildren) Factory method that creates a newDefaultMutableTreeNodeobject- Type Parameters:
T- the generic type of the given user object- Parameters:
userObject- the user objectallowsChildren- if true, the node is allowed to have child nodes -- otherwise, it is always a leaf node- Returns:
- the new
DefaultMutableTreeNodeobject
-
newDefaultMutableTreeNode
Factory method that creates a newDefaultMutableTreeNodeobject- Type Parameters:
T- the generic type of the given user object- Parameters:
userObject- the user object- Returns:
- the new
DefaultMutableTreeNodeobject
-