Class TreeControl.TreeNodeTransferable<V>

  • Type Parameters:
    V - The type of value contained in the tree node.
    All Implemented Interfaces:
    Transferable<Component>
    Enclosing class:
    TreeControl

    protected static class TreeControl.TreeNodeTransferable<V>
    extends AbstractObjectTransferable<Component>
    The transferable object for a tree node. This transferable is able to transfer either the tree node itself or the object stored in the tree node.
    Author:
    Garret Wilson
    • Constructor Detail

      • TreeNodeTransferable

        public TreeNodeTransferable​(TreeControl source,
                                    TreeNodeModel<V> treeNode)
        Source and tree node constructor.
        Parameters:
        source - The source of the transferable data.
        treeNode - The tree node representing the transferred data.
        Throws:
        java.lang.NullPointerException - if the provided source and/or tree node is null.
    • Method Detail

      • transfer

        public <T> T transfer​(java.lang.Class<T> objectClass)
        Transfers data of the given class.

        This implementation returns subclasses.

        Type Parameters:
        T - The type of object to be transferred.
        Parameters:
        objectClass - The class of object to return.
        Returns:
        The transferred data object, which may be null.