Package io.github.astrapi69.swing.tree
Class BaseTreeNodeFactory
- java.lang.Object
-
- io.github.astrapi69.swing.tree.BaseTreeNodeFactory
-
public class BaseTreeNodeFactory extends java.lang.Object
Factory class for generateDefaultMutableTreeNode
fromBaseTreeNode
-
-
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.gen.tree.BaseTreeNode<T,K>initializeBaseTreeNodeWithTreeElement(T treeElement, io.github.astrapi69.gen.tree.BaseTreeNode<T,K> parentTreeNode, @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)
Factory method that creates a newBaseTreeNode
object from the givenTreeElement
objectstatic <T,K>
io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.tree.GenericTreeElement<T>,K>initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.tree.GenericTreeElement<T> treeElement, io.github.astrapi69.gen.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 newBaseTreeNode
object from the givenTreeElement
objectstatic <K> io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.tree.JXTreeElement,K>
initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.tree.JXTreeElement treeElement, io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.tree.JXTreeElement,K> parentTreeNode, @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)
Factory method that creates a newBaseTreeNode
object from the givenTreeElement
objectstatic <K> io.github.astrapi69.gen.tree.BaseTreeNode<TreeElement,K>
initializeTreeNodeWithTreeElement(TreeElement treeElement, io.github.astrapi69.gen.tree.BaseTreeNode<TreeElement,K> parentTreeNode, @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)
Factory method that creates a newBaseTreeNode
object from the givenTreeElement
objectstatic <T,K>
javax.swing.tree.DefaultMutableTreeNodenewDefaultMutableTreeNode(@NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T,K> treeNode)
Creates a newDefaultMutableTreeNode
object from the givenBaseTreeNode
objectstatic <T,K>
javax.swing.tree.DefaultMutableTreeNodetraverseAndAdd(javax.swing.tree.DefaultMutableTreeNode rootDefaultMutableTreeNode, @NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T,K> treeNode)
Traverses through the givenBaseTreeNode
object and return the rootDefaultMutableTreeNode
object
-
-
-
Method Detail
-
newDefaultMutableTreeNode
public static <T,K> javax.swing.tree.DefaultMutableTreeNode newDefaultMutableTreeNode(@NonNull @NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T,K> treeNode)
Creates a newDefaultMutableTreeNode
object from the givenBaseTreeNode
object- Type Parameters:
T
- the generic type of the givenBaseTreeNode
objectK
- the generic type of the id of the givenBaseTreeNode
object- Parameters:
treeNode
- theBaseTreeNode
object- Returns:
- the new
DefaultMutableTreeNode
object generated from the givenBaseTreeNode
object
-
traverseAndAdd
public static <T,K> javax.swing.tree.DefaultMutableTreeNode traverseAndAdd(javax.swing.tree.DefaultMutableTreeNode rootDefaultMutableTreeNode, @NonNull @NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T,K> treeNode)
Traverses through the givenBaseTreeNode
object and return the rootDefaultMutableTreeNode
object- Type Parameters:
T
- the generic type of the givenBaseTreeNode
objectK
- the generic type of the id of the givenBaseTreeNode
object- Parameters:
rootDefaultMutableTreeNode
- theDefaultMutableTreeNode
objecttreeNode
- theBaseTreeNode
object- Returns:
- the root
DefaultMutableTreeNode
object
-
initializeTreeNodeWithTreeElement
public static <K> io.github.astrapi69.gen.tree.BaseTreeNode<TreeElement,K> initializeTreeNodeWithTreeElement(TreeElement treeElement, io.github.astrapi69.gen.tree.BaseTreeNode<TreeElement,K> parentTreeNode, @NonNull @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)
Factory method that creates a newBaseTreeNode
object from the givenTreeElement
object- Type Parameters:
K
- the generic type of the id of the givenBaseTreeNode
object- Parameters:
treeElement
- theTreeElement
objectparentTreeNode
- the parent objectidGenerator
- the id generator- Returns:
- the new
BaseTreeNode
object
-
initializeBaseTreeNodeWithTreeElement
public static <T,K> io.github.astrapi69.gen.tree.BaseTreeNode<T,K> initializeBaseTreeNodeWithTreeElement(T treeElement, io.github.astrapi69.gen.tree.BaseTreeNode<T,K> parentTreeNode, @NonNull @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)
Factory method that creates a newBaseTreeNode
object from the givenTreeElement
object- Type Parameters:
T
- the generic type of the givenBaseTreeNode
objectK
- the generic type of the id of the givenBaseTreeNode
object- Parameters:
treeElement
- theTreeElement
objectparentTreeNode
- the parent objectidGenerator
- the id generator- Returns:
- the new
BaseTreeNode
object
-
initializeTreeNodeWithTreeElement
public static <K> io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.tree.JXTreeElement,K> initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.tree.JXTreeElement treeElement, io.github.astrapi69.gen.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 newBaseTreeNode
object from the givenTreeElement
object- Type Parameters:
K
- the generic type of the id of the givenBaseTreeNode
object- Parameters:
treeElement
- theTreeElement
objectparentTreeNode
- the parent objectidGenerator
- the id generator- Returns:
- the new
BaseTreeNode
object
-
initializeTreeNodeWithTreeElement
public static <T,K> io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.tree.GenericTreeElement<T>,K> initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.tree.GenericTreeElement<T> treeElement, io.github.astrapi69.gen.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 newBaseTreeNode
object from the givenTreeElement
object- Type Parameters:
T
- the generic type of the givenBaseTreeNode
objectK
- the generic type of the id of the givenBaseTreeNode
object- Parameters:
treeElement
- theTreeElement
objectparentTreeNode
- the parent objectidGenerator
- the id generator- Returns:
- the new
BaseTreeNode
object
-
-