Package io.github.astrapi69.swing.tree
Class BaseTreeNodeFactory
- java.lang.Object
-
- io.github.astrapi69.swing.tree.BaseTreeNodeFactory
-
public class BaseTreeNodeFactory extends java.lang.ObjectFactory class for generateDefaultMutableTreeNodefromBaseTreeNode
-
-
Constructor Summary
Constructors Constructor Description BaseTreeNodeFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,K>
io.github.astrapi69.tree.BaseTreeNode<T,K>initializeBaseTreeNodeWithTreeElement(T treeElement, io.github.astrapi69.tree.BaseTreeNode<T,K> parentTreeNode, @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)Factory method that creates a newBaseTreeNodeobject from the givenTreeElementobjectstatic <T,K>
io.github.astrapi69.tree.BaseTreeNode<io.github.astrapi69.swing.tree.GenericTreeElement<T>,K>initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.tree.GenericTreeElement<T> treeElement, io.github.astrapi69.tree.BaseTreeNode<io.github.astrapi69.swing.tree.GenericTreeElement<T>,K> parentTreeNode, @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)Factory method that creates a newBaseTreeNodeobject from the givenTreeElementobjectstatic <K> io.github.astrapi69.tree.BaseTreeNode<io.github.astrapi69.swing.tree.JXTreeElement,K>initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.tree.JXTreeElement treeElement, io.github.astrapi69.tree.BaseTreeNode<io.github.astrapi69.swing.tree.JXTreeElement,K> parentTreeNode, @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)Factory method that creates a newBaseTreeNodeobject from the givenTreeElementobjectstatic <K> io.github.astrapi69.tree.BaseTreeNode<TreeElement,K>initializeTreeNodeWithTreeElement(TreeElement treeElement, io.github.astrapi69.tree.BaseTreeNode<TreeElement,K> parentTreeNode, @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)Factory method that creates a newBaseTreeNodeobject from the givenTreeElementobjectstatic <T,K>
javax.swing.tree.DefaultMutableTreeNodenewDefaultMutableTreeNode(@NonNull io.github.astrapi69.tree.BaseTreeNode<T,K> treeNode)Creates a newDefaultMutableTreeNodeobject from the givenBaseTreeNodeobjectstatic <T,K>
javax.swing.tree.DefaultMutableTreeNodetraverseAndAdd(javax.swing.tree.DefaultMutableTreeNode rootDefaultMutableTreeNode, @NonNull io.github.astrapi69.tree.BaseTreeNode<T,K> treeNode)Traverses through the givenBaseTreeNodeobject and return the rootDefaultMutableTreeNodeobject
-
-
-
Method Detail
-
newDefaultMutableTreeNode
public static <T,K> javax.swing.tree.DefaultMutableTreeNode newDefaultMutableTreeNode(@NonNull @NonNull io.github.astrapi69.tree.BaseTreeNode<T,K> treeNode)Creates a newDefaultMutableTreeNodeobject from the givenBaseTreeNodeobject- Type Parameters:
T- the generic type of the givenBaseTreeNodeobjectK- the generic type of the id of the givenBaseTreeNodeobject- Parameters:
treeNode- theBaseTreeNodeobject- Returns:
- the new
DefaultMutableTreeNodeobject generated from the givenBaseTreeNodeobject
-
traverseAndAdd
public static <T,K> javax.swing.tree.DefaultMutableTreeNode traverseAndAdd(javax.swing.tree.DefaultMutableTreeNode rootDefaultMutableTreeNode, @NonNull @NonNull io.github.astrapi69.tree.BaseTreeNode<T,K> treeNode)Traverses through the givenBaseTreeNodeobject and return the rootDefaultMutableTreeNodeobject- Type Parameters:
T- the generic type of the givenBaseTreeNodeobjectK- the generic type of the id of the givenBaseTreeNodeobject- Parameters:
rootDefaultMutableTreeNode- theDefaultMutableTreeNodeobjecttreeNode- theBaseTreeNodeobject- Returns:
- the root
DefaultMutableTreeNodeobject
-
initializeTreeNodeWithTreeElement
public static <K> io.github.astrapi69.tree.BaseTreeNode<TreeElement,K> initializeTreeNodeWithTreeElement(TreeElement treeElement, io.github.astrapi69.tree.BaseTreeNode<TreeElement,K> parentTreeNode, @NonNull @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)
Factory method that creates a newBaseTreeNodeobject from the givenTreeElementobject- Type Parameters:
K- the generic type of the id of the givenBaseTreeNodeobject- Parameters:
treeElement- theTreeElementobjectparentTreeNode- the parent objectidGenerator- the id generator- Returns:
- the new
BaseTreeNodeobject
-
initializeBaseTreeNodeWithTreeElement
public static <T,K> io.github.astrapi69.tree.BaseTreeNode<T,K> initializeBaseTreeNodeWithTreeElement(T treeElement, io.github.astrapi69.tree.BaseTreeNode<T,K> parentTreeNode, @NonNull @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)Factory method that creates a newBaseTreeNodeobject from the givenTreeElementobject- Type Parameters:
T- the generic type of the givenBaseTreeNodeobjectK- the generic type of the id of the givenBaseTreeNodeobject- Parameters:
treeElement- theTreeElementobjectparentTreeNode- the parent objectidGenerator- the id generator- Returns:
- the new
BaseTreeNodeobject
-
initializeTreeNodeWithTreeElement
public static <K> io.github.astrapi69.tree.BaseTreeNode<io.github.astrapi69.swing.tree.JXTreeElement,K> initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.tree.JXTreeElement treeElement, io.github.astrapi69.tree.BaseTreeNode<io.github.astrapi69.swing.tree.JXTreeElement,K> parentTreeNode, @NonNull @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)Factory method that creates a newBaseTreeNodeobject from the givenTreeElementobject- Type Parameters:
K- the generic type of the id of the givenBaseTreeNodeobject- Parameters:
treeElement- theTreeElementobjectparentTreeNode- the parent objectidGenerator- the id generator- Returns:
- the new
BaseTreeNodeobject
-
initializeTreeNodeWithTreeElement
public static <T,K> io.github.astrapi69.tree.BaseTreeNode<io.github.astrapi69.swing.tree.GenericTreeElement<T>,K> initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.tree.GenericTreeElement<T> treeElement, io.github.astrapi69.tree.BaseTreeNode<io.github.astrapi69.swing.tree.GenericTreeElement<T>,K> parentTreeNode, @NonNull @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)Factory method that creates a newBaseTreeNodeobject from the givenTreeElementobject- Type Parameters:
T- the generic type of the givenBaseTreeNodeobjectK- the generic type of the id of the givenBaseTreeNodeobject- Parameters:
treeElement- theTreeElementobjectparentTreeNode- the parent objectidGenerator- the id generator- Returns:
- the new
BaseTreeNodeobject
-
-