java.lang.Object
io.github.astrapi69.swing.tree.BaseTreeNodeFactory
Factory class for generate
DefaultMutableTreeNode from BaseTreeNode-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <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 newBaseTreeNodeobject from the givenTreeElementobjectstatic <T,K> io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.renderer.tree.GenericTreeElement<T>, K> initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.renderer.tree.GenericTreeElement<T> treeElement, io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.renderer.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.gen.tree.BaseTreeNode<io.github.astrapi69.swing.renderer.tree.JTreeElement,K> initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.renderer.tree.JTreeElement treeElement, io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.renderer.tree.JTreeElement, K> parentTreeNode, @NonNull io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator) Factory method that creates a newBaseTreeNodeobject from the givenTreeElementobjectstatic <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 newBaseTreeNodeobject from the givenTreeElementobjectstatic <T,K> DefaultMutableTreeNode newDefaultMutableTreeNode(@NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T, K> treeNode) Creates a newDefaultMutableTreeNodeobject from the givenBaseTreeNodeobjectstatic <T,K> DefaultMutableTreeNode newDefaultMutableTreeNode(@NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T, K> treeNode, DefaultMutableTreeNode parent, boolean onlyRoot) Creates a newDefaultMutableTreeNodeobject from the givenBaseTreeNodeobjectstatic <T,K> DefaultMutableTreeNode traverseAndAdd(DefaultMutableTreeNode rootDefaultMutableTreeNode, @NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T, K> treeNode) Traverses through the givenBaseTreeNodeobject and return the rootDefaultMutableTreeNodeobjectstatic <T,K> DefaultMutableTreeNode traverseAndAdd(DefaultMutableTreeNode rootDefaultMutableTreeNode, @NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T, K> treeNode, boolean root) Traverses through the givenBaseTreeNodeobject and return the rootDefaultMutableTreeNodeobject
-
Constructor Details
-
BaseTreeNodeFactory
public BaseTreeNodeFactory()
-
-
Method Details
-
newDefaultMutableTreeNode
public static <T,K> DefaultMutableTreeNode newDefaultMutableTreeNode(@NonNull @NonNull io.github.astrapi69.gen.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> DefaultMutableTreeNode traverseAndAdd(DefaultMutableTreeNode rootDefaultMutableTreeNode, @NonNull @NonNull io.github.astrapi69.gen.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
-
newDefaultMutableTreeNode
public static <T,K> DefaultMutableTreeNode newDefaultMutableTreeNode(@NonNull @NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T, K> treeNode, DefaultMutableTreeNode parent, boolean onlyRoot) 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- theBaseTreeNodeobjectparent- the parentDefaultMutableTreeNodeobjectonlyRoot- the flag if only root tree node will be chosen, otherwise the given tree node will be traversed and added- Returns:
- the new
DefaultMutableTreeNodeobject generated from the givenBaseTreeNodeobject
-
traverseAndAdd
public static <T,K> DefaultMutableTreeNode traverseAndAdd(DefaultMutableTreeNode rootDefaultMutableTreeNode, @NonNull @NonNull io.github.astrapi69.gen.tree.BaseTreeNode<T, K> treeNode, boolean root) 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- theBaseTreeNodeobjectroot- the flag if the given root tree node will be used for creation of the parent object- Returns:
- the root
DefaultMutableTreeNodeobject
-
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 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.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 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.gen.tree.BaseTreeNode<io.github.astrapi69.swing.renderer.tree.JTreeElement,K> initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.renderer.tree.JTreeElement treeElement, io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.renderer.tree.JTreeElement, 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.gen.tree.BaseTreeNode<io.github.astrapi69.swing.renderer.tree.GenericTreeElement<T>,K> initializeTreeNodeWithTreeElement(io.github.astrapi69.swing.renderer.tree.GenericTreeElement<T> treeElement, io.github.astrapi69.gen.tree.BaseTreeNode<io.github.astrapi69.swing.renderer.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
-