Class BaseTreeNodeFactory


  • public class BaseTreeNodeFactory
    extends java.lang.Object
    Factory class for generate DefaultMutableTreeNode from BaseTreeNode
    • 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 new BaseTreeNode object from the given TreeElement object
      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 io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)
      Factory method that creates a new BaseTreeNode object from the given TreeElement object
      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 io.github.astrapi69.data.identifiable.IdGenerator<K> idGenerator)
      Factory method that creates a new BaseTreeNode object from the given TreeElement object
      static <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 new BaseTreeNode object from the given TreeElement object
      static <T,​K>
      javax.swing.tree.DefaultMutableTreeNode
      newDefaultMutableTreeNode​(@NonNull io.github.astrapi69.tree.BaseTreeNode<T,​K> treeNode)
      Creates a new DefaultMutableTreeNode object from the given BaseTreeNode object
      static <T,​K>
      javax.swing.tree.DefaultMutableTreeNode
      traverseAndAdd​(javax.swing.tree.DefaultMutableTreeNode rootDefaultMutableTreeNode, @NonNull io.github.astrapi69.tree.BaseTreeNode<T,​K> treeNode)
      Traverses through the given BaseTreeNode object and return the root DefaultMutableTreeNode object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BaseTreeNodeFactory

        public BaseTreeNodeFactory()
    • Method Detail

      • newDefaultMutableTreeNode

        public static <T,​K> javax.swing.tree.DefaultMutableTreeNode newDefaultMutableTreeNode​(@NonNull
                                                                                                    @NonNull io.github.astrapi69.tree.BaseTreeNode<T,​K> treeNode)
        Creates a new DefaultMutableTreeNode object from the given BaseTreeNode object
        Type Parameters:
        T - the generic type of the given BaseTreeNode object
        K - the generic type of the id of the given BaseTreeNode object
        Parameters:
        treeNode - the BaseTreeNode object
        Returns:
        the new DefaultMutableTreeNode object generated from the given BaseTreeNode object
      • 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 given BaseTreeNode object and return the root DefaultMutableTreeNode object
        Type Parameters:
        T - the generic type of the given BaseTreeNode object
        K - the generic type of the id of the given BaseTreeNode object
        Parameters:
        rootDefaultMutableTreeNode - the DefaultMutableTreeNode object
        treeNode - the BaseTreeNode object
        Returns:
        the root DefaultMutableTreeNode object
      • 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 new BaseTreeNode object from the given TreeElement object
        Type Parameters:
        K - the generic type of the id of the given BaseTreeNode object
        Parameters:
        treeElement - the TreeElement object
        parentTreeNode - the parent object
        idGenerator - the id generator
        Returns:
        the new BaseTreeNode object
      • 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 new BaseTreeNode object from the given TreeElement object
        Type Parameters:
        T - the generic type of the given BaseTreeNode object
        K - the generic type of the id of the given BaseTreeNode object
        Parameters:
        treeElement - the TreeElement object
        parentTreeNode - the parent object
        idGenerator - the id generator
        Returns:
        the new BaseTreeNode object
      • 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 new BaseTreeNode object from the given TreeElement object
        Type Parameters:
        K - the generic type of the id of the given BaseTreeNode object
        Parameters:
        treeElement - the TreeElement object
        parentTreeNode - the parent object
        idGenerator - the id generator
        Returns:
        the new BaseTreeNode object
      • 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 new BaseTreeNode object from the given TreeElement object
        Type Parameters:
        T - the generic type of the given BaseTreeNode object
        K - the generic type of the id of the given BaseTreeNode object
        Parameters:
        treeElement - the TreeElement object
        parentTreeNode - the parent object
        idGenerator - the id generator
        Returns:
        the new BaseTreeNode object