Class DragAndDropTreeNodeCollection<N extends BaseTreeNode>

    • Constructor Detail

      • DragAndDropTreeNodeCollection

        public DragAndDropTreeNodeCollection​(N[] nodes)
        Initializes the collection with all the nodes.
        Parameters:
        nodes - the nodes for the collection
    • Method Detail

      • size

        public int size()
        Returns the size of the collection.
        Specified by:
        size in interface Collection<N extends BaseTreeNode>
        Returns:
        the number of nodes stored
      • isEmpty

        public boolean isEmpty()
        Returns whether the collection is empty.
        Specified by:
        isEmpty in interface Collection<N extends BaseTreeNode>
        Returns:
        true if no nodes stored
      • contains

        public boolean contains​(Object o)
        Checks whether the object is stored among the nodes.
        Specified by:
        contains in interface Collection<N extends BaseTreeNode>
        Parameters:
        o - the object to look for
        Returns:
        true if the object can be located
      • toArray

        public <N> N[] toArray​(N[] a)
        Returns the nodes as array.
        Specified by:
        toArray in interface Collection<N extends BaseTreeNode>
        Parameters:
        a - the array to use
        Returns:
        the nodes
      • add

        public boolean add​(N e)
        Adds the node.
        Specified by:
        add in interface Collection<N extends BaseTreeNode>
        Parameters:
        e - the node to add
        Returns:
        true if the collection was modified
      • remove

        public boolean remove​(Object o)
        Removes the object from the collection.
        Specified by:
        remove in interface Collection<N extends BaseTreeNode>
        Parameters:
        o - the object to remove
        Returns:
        true if the collection was modified
      • containsAll

        public boolean containsAll​(Collection<?> c)
        Checks whether all the elements of the specified collection are available in this one.
        Specified by:
        containsAll in interface Collection<N extends BaseTreeNode>
        Parameters:
        c - the collection to use for checking
      • addAll

        public boolean addAll​(Collection<? extends N> c)
        Adds all the elements of the collection to this one.
        Specified by:
        addAll in interface Collection<N extends BaseTreeNode>
        Parameters:
        c - the collection to add
        Returns:
        true if the collection was modified
      • removeAll

        public boolean removeAll​(Collection<?> c)
        Removes all the elements from the collection that are also in this one.
        Specified by:
        removeAll in interface Collection<N extends BaseTreeNode>
        Parameters:
        c - the collection to remove
        Returns:
        true if the collection was modified
      • retainAll

        public boolean retainAll​(Collection<?> c)
        Removes all elements but the ones from the specified collection from this one.
        Specified by:
        retainAll in interface Collection<N extends BaseTreeNode>
        Parameters:
        c - the collection to retain
        Returns:
        true if the collection was modified
      • isDataFlavorSupported

        public boolean isDataFlavorSupported​(DataFlavor flavor)
        Returns whether the flavor is supported (only stringFlavor supported).
        Specified by:
        isDataFlavorSupported in interface Transferable
        Parameters:
        flavor - the flavor to check
        Returns:
        true if supported
      • toTransferable

        public Transferable toTransferable()
        Turns the node/userObject into a transferable string. One node per line, separated by "\n", string representation obtained via the node's toString() method.
        Returns:
        the generated string