Class SimpleDndPanel<T>

    • Constructor Detail

      • SimpleDndPanel

        public SimpleDndPanel(DataFlavor flavor,
                              T data,
                              boolean isSource,
                              boolean isDestination)
        Create an instance of the simple DndPanel that only supports a single data flavor.
        Parameters:
        flavor - the flavor to support.
        data - the data to show initially.
        isSource - whether this panel can be used as a source for dragging.
        isDestination - whether this panel can be used as a destination for dragging.
    • Method Detail

      • getSupportedFlavors

        public List<DataFlavor> getSupportedFlavors()
        Description copied from class: DndPanel
        Override this method to provide the list of supported DataFlavors. The order within this list is important and represents the priority of the DataFlavors. Lower indices get used first.
        Specified by:
        getSupportedFlavors in class  DndPanel<T>
        Returns:
        the list of supported DataFlavors.
      • getTransferData

        public Object getTransferData(DataFlavor requestedFlavor,
                                      T t)
        Description copied from class: DndPanel
        Override this method to provide the TransferData for the represented instance.
        Specified by:
        getTransferData in class  DndPanel<T>
        Parameters:
        requestedFlavor - the flavor to retrieve a TransferData instance for.
        t - the data to retrieve a representation for.
        Returns:
        transferable object.
      • importData

        public boolean importData(TransferHandler.TransferSupport ts)
        Description copied from class: DndPanel
        Override this method to handle the import of data.
        Specified by:
        importData in class  DndPanel<T>
        Parameters:
        ts - the TransferSupport involved.
        Returns:
        whether the transfer succeeded.
      • getTransferData

        public abstract Object getTransferData(T t)
        Override this to provide the transferable data for the denoted instance.
        Parameters:
        t - the instance to retrieve a representation for.
        Returns:
        the transferable object.
      • importData

        public abstract boolean importData(Object transferData)
        Override this to handle importing data.
        Parameters:
        transferData - the data to import.
        Returns:
        whether the import succeeded.