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> DefaultMutableTreeNode
newDefaultMutableTreeNode
(DefaultMutableTreeNode parent, T userObject) Factory method that creates a newDefaultMutableTreeNode
objectstatic <T> DefaultMutableTreeNode
newDefaultMutableTreeNode
(DefaultMutableTreeNode parent, T userObject, boolean addToParent) Factory method that creates a newDefaultMutableTreeNode
objectstatic <T> DefaultMutableTreeNode
newDefaultMutableTreeNode
(DefaultMutableTreeNode parent, T userObject, boolean allowsChildren, boolean addToParent) Factory method that creates a newDefaultMutableTreeNode
objectstatic <T> DefaultMutableTreeNode
newDefaultMutableTreeNode
(T userObject) Factory method that creates a newDefaultMutableTreeNode
objectstatic <T> DefaultMutableTreeNode
newDefaultMutableTreeNode
(T userObject, boolean allowsChildren) Factory method that creates a newDefaultMutableTreeNode
object
-
Method Details
-
newDefaultMutableTreeNode
public static <T> DefaultMutableTreeNode newDefaultMutableTreeNode(DefaultMutableTreeNode parent, T userObject) Factory method that creates a newDefaultMutableTreeNode
object- Type Parameters:
T
- the generic type of the given user object- Parameters:
parent
- the parentDefaultMutableTreeNode
objectuserObject
- the user object- Returns:
- the new
DefaultMutableTreeNode
object
-
newDefaultMutableTreeNode
public static <T> DefaultMutableTreeNode newDefaultMutableTreeNode(DefaultMutableTreeNode parent, T userObject, boolean addToParent) Factory method that creates a newDefaultMutableTreeNode
object- Type Parameters:
T
- the generic type of the given user object- Parameters:
parent
- the parentDefaultMutableTreeNode
objectuserObject
- the user objectaddToParent
- the flag that indicates if it should add to the parent- Returns:
- the new
DefaultMutableTreeNode
object
-
newDefaultMutableTreeNode
public static <T> DefaultMutableTreeNode newDefaultMutableTreeNode(DefaultMutableTreeNode parent, T userObject, boolean allowsChildren, boolean addToParent) Factory method that creates a newDefaultMutableTreeNode
object- Type Parameters:
T
- the generic type of the given user object- Parameters:
parent
- the parentDefaultMutableTreeNode
objectuserObject
- the user objectallowsChildren
- the flag if children is allowedaddToParent
- the flag that indicates if it should add to the parent- Returns:
- the new
DefaultMutableTreeNode
object
-
newDefaultMutableTreeNode
public static <T> DefaultMutableTreeNode newDefaultMutableTreeNode(T userObject, boolean allowsChildren) Factory method that creates a newDefaultMutableTreeNode
object- 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
DefaultMutableTreeNode
object
-
newDefaultMutableTreeNode
Factory method that creates a newDefaultMutableTreeNode
object- Type Parameters:
T
- the generic type of the given user object- Parameters:
userObject
- the user object- Returns:
- the new
DefaultMutableTreeNode
object
-