Class GTreeNodeTransferable

  • All Implemented Interfaces:
    java.awt.datatransfer.Transferable
    Direct Known Subclasses:
    DataTreeNodeTransferable

    public class GTreeNodeTransferable
    extends java.lang.Object
    implements java.awt.datatransfer.Transferable
    A transferable for sharing data via drag/drop and clipboard operations for GTrees.
    • Constructor Summary

      Constructors 
      Constructor Description
      GTreeNodeTransferable​(GTreeTransferHandler handler, java.util.List<GTreeNode> selectedData)
      Creates this transferable based upon the selected data and uses the given transfer handler to perform Transferable operations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<GTreeNode> getAllData()
      Returns all of the original selected data contained by this transferable.
      java.lang.Object getTransferData​(java.awt.datatransfer.DataFlavor flavor)
      Gets the transfer data from the selection based upon the given flavor.
      java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
      Returns the DataFlavors for the types of data that this transferable supports, based upon the given selection.
      boolean isDataFlavorSupported​(java.awt.datatransfer.DataFlavor flavor)
      A convenience method to determine if this transferable supports the given flavor.
      • Methods inherited from class java.lang.Object

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

      • GTreeNodeTransferable

        public GTreeNodeTransferable​(GTreeTransferHandler handler,
                                     java.util.List<GTreeNode> selectedData)
        Creates this transferable based upon the selected data and uses the given transfer handler to perform Transferable operations.
        Parameters:
        handler - the handler used to perform transfer operations.
        selectedData - The
    • Method Detail

      • getAllData

        public java.util.List<GTreeNode> getAllData()
        Returns all of the original selected data contained by this transferable.
        Returns:
        all of the original selected data contained by this transferable
      • getTransferData

        public java.lang.Object getTransferData​(java.awt.datatransfer.DataFlavor flavor)
                                         throws java.awt.datatransfer.UnsupportedFlavorException,
                                                java.io.IOException
        Gets the transfer data from the selection based upon the given flavor.
        Specified by:
        getTransferData in interface java.awt.datatransfer.Transferable
        Parameters:
        transferNodes - The nodes from which to get the data.
        flavor - The flavor of data to retreive from the given selection.
        Returns:
        the transfer data from the selection based upon the given flavor.
        Throws:
        java.awt.datatransfer.UnsupportedFlavorException - if the given flavor is not one of the supported flavors returned by #getSupportedDataFlavors(List).
        java.io.IOException
      • getTransferDataFlavors

        public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
        Returns the DataFlavors for the types of data that this transferable supports, based upon the given selection.
        Specified by:
        getTransferDataFlavors in interface java.awt.datatransfer.Transferable
        Parameters:
        transferNodes - The nodes to base the DataFlavor selection upon.
        Returns:
        the DataFlavors for the types of data that this transferable supports, based upon the given selection.
      • isDataFlavorSupported

        public boolean isDataFlavorSupported​(java.awt.datatransfer.DataFlavor flavor)
        A convenience method to determine if this transferable supports the given flavor.
        Specified by:
        isDataFlavorSupported in interface java.awt.datatransfer.Transferable
        Returns:
        true if this transferable supports the given flavor.