Class DndPanel<T>

    • Constructor Detail

      • DndPanel

        public DndPanel(T data,
                        boolean isSource,
                        boolean isDestination)
        Create a new DndPanel representing the denoted data.
        Parameters:
        data - the data to represent.
        isSource - whether this panel is a source for drags.
        isDestination - whether this panel is a destination for drags.
    • Method Detail

      • dragGestureRecognized

        public void dragGestureRecognized(DragGestureEvent dge)
      • setup

        public abstract void setup(T data)
        Setup the panel to represent the denoted geometryIndex.
        Parameters:
        data - the data to represent.
      • getData

        public T getData()
        Returns:
        the geometryIndex this panel represents.
      • setData

        public void setData(T data)
        Set the data to represent.
        Parameters:
        data - the data to represent.
      • isDestination

        public boolean isDestination()
        Find out whether this panel is a drag destination.
        Returns:
        whether this panel is a drag destination.
      • isSource

        public boolean isSource()
        Find out whether this panel is a drag source.
        Returns:
        whether this panel is a drag source.
      • getSupportedFlavors

        public abstract List<DataFlavor> getSupportedFlavors()
        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.
        Returns:
        the list of supported DataFlavors.
      • getTransferData

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

        public abstract boolean importData(TransferHandler.TransferSupport ts)
        Override this method to handle the import of data.
        Parameters:
        ts - the TransferSupport involved.
        Returns:
        whether the transfer succeeded.
      • getComponent

        public abstract JComponent getComponent()
        Override this method to provide a component to visualize the data represented.
        Returns:
        the component displayed within this panel.