Package docking.dnd

# Class DragDropTreeTransferable

java.lang.Object
docking.dnd.DragDropTreeTransferable

All Implemented Interfaces:
  `ClipboardOwner`, `Transferable`

public class DragDropTreeTransferable extends Object implements Transferable, ClipboardOwner
Defines data that is available for drag/drop and clipboard transfers. The data is an ArrayList of DragDropNode objects.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static DataFlavor`
  `localTreeNodeFlavor`
  A static instance of the local tree node flavor that is an ArrayList of DragDropNode objects.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DragDropTreeTransferable(DragDropNode[] nodes)`
  Constructs a new Transferable from the array of DragDropNodes

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getTransferData(DataFlavor f)`
  Return the transfer data with the given data flavor.
  `DataFlavor[]`
  `getTransferDataFlavors()`
  Return all data flavors that this class supports.
  `boolean`
  `isDataFlavorSupported(DataFlavor f)`
  Return whether the specifed data flavor is supported.
  `void`
  `lostOwnership(Clipboard clipboard, Transferable contents)`
  Notification we have lost ownership of the clipboard because something else was put on the clipboard.
  `String`
  `toString()`
  Get the string representation for this transferable.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### localTreeNodeFlavor

    public static DataFlavor localTreeNodeFlavor
    A static instance of the local tree node flavor that is an ArrayList of DragDropNode objects.

- ## Constructor Details

  - ### DragDropTreeTransferable

    public DragDropTreeTransferable(DragDropNode[] nodes)
    Constructs a new Transferable from the array of DragDropNodes
    Parameters:
      `nodes` - the array of DragDropNodes being transfered.

- ## Method Details

  - ### getTransferDataFlavors

    public DataFlavor[] getTransferDataFlavors()
    Return all data flavors that this class supports.
    Specified by:
      `getTransferDataFlavors` in interface `Transferable`

  - ### isDataFlavorSupported

    public boolean isDataFlavorSupported(DataFlavor f)
    Return whether the specifed data flavor is supported.
    Specified by:
      `isDataFlavorSupported` in interface `Transferable`
    Parameters:
      `f` - the DataFlavor to check if supported.

  - ### getTransferData

    public Object getTransferData(DataFlavor f) throws UnsupportedFlavorException, IOException
    Return the transfer data with the given data flavor.
    Specified by:
      `getTransferData` in interface `Transferable`
    Parameters:
      `f` - the DataFlavor for which to get a Transferable.
    Throws:
      `UnsupportedFlavorException`
      `IOException`

  - ### toString

    public String toString()
    Get the string representation for this transferable.
    Overrides:
      `toString` in class `Object`

  - ### lostOwnership

    public void lostOwnership(Clipboard clipboard, Transferable contents)
    Notification we have lost ownership of the clipboard because something else was put on the clipboard.
    Specified by:
      `lostOwnership` in interface `ClipboardOwner`
    Parameters:
      `clipboard` - the system clipboard.
      `contents` - the Transferable lost in the clipboard.