Package docking.dnd

Class DragSrcAdapter

  • All Implemented Interfaces:
    java.awt.dnd.DragSourceListener, java.util.EventListener

    public class DragSrcAdapter
    extends java.lang.Object
    implements java.awt.dnd.DragSourceListener
    Adapter class that receives notifications in order to provide drag over effects.

    When the operation ends, this class receives a dragDropEnd message, and is responsible for checking the success of the operation. If the operation was successful, and if it was a Move, then this class will remove the source data.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dragDropEnd​(java.awt.dnd.DragSourceDropEvent e)
      Called when the drag-drop operation completes.
      void dragEnter​(java.awt.dnd.DragSourceDragEvent e)
      Called as the hotspot enters a platform dependent drop site.
      void dragExit​(java.awt.dnd.DragSourceEvent e)
      Called as the hotspot exits a platform dependent drop site.
      void dragOver​(java.awt.dnd.DragSourceDragEvent e)
      Called as the hotspot moves over a platform dependent drop site.
      void dropActionChanged​(java.awt.dnd.DragSourceDragEvent e)
      Drop action changed, i.e., ctrl key pressed during drag to change to a copy operation.
      protected java.awt.Cursor getDropOkCursor​(int action)
      Get the cursor for an "OK" drop.
      protected void setDragOverFeedback​(java.awt.dnd.DragSourceDragEvent e)
      Sets the cursor according to the actions that are legal.
      • Methods inherited from class java.lang.Object

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

      • dragComponent

        protected Draggable dragComponent
    • Constructor Detail

      • DragSrcAdapter

        public DragSrcAdapter​(Draggable dragComponent)
        Constructor
        Parameters:
        dragComponent - component that can be dragged.
    • Method Detail

      • dragDropEnd

        public void dragDropEnd​(java.awt.dnd.DragSourceDropEvent e)
        Called when the drag-drop operation completes. Calls the drag component's move() method if the action is a move operation.
        Specified by:
        dragDropEnd in interface java.awt.dnd.DragSourceListener
      • dragEnter

        public void dragEnter​(java.awt.dnd.DragSourceDragEvent e)
        Called as the hotspot enters a platform dependent drop site.
        Specified by:
        dragEnter in interface java.awt.dnd.DragSourceListener
      • dragOver

        public void dragOver​(java.awt.dnd.DragSourceDragEvent e)
        Called as the hotspot moves over a platform dependent drop site.
        Specified by:
        dragOver in interface java.awt.dnd.DragSourceListener
      • dragExit

        public void dragExit​(java.awt.dnd.DragSourceEvent e)
        Called as the hotspot exits a platform dependent drop site.
        Specified by:
        dragExit in interface java.awt.dnd.DragSourceListener
      • dropActionChanged

        public void dropActionChanged​(java.awt.dnd.DragSourceDragEvent e)
        Drop action changed, i.e., ctrl key pressed during drag to change to a copy operation.
        Specified by:
        dropActionChanged in interface java.awt.dnd.DragSourceListener
      • setDragOverFeedback

        protected void setDragOverFeedback​(java.awt.dnd.DragSourceDragEvent e)
        Sets the cursor according to the actions that are legal.
      • getDropOkCursor

        protected java.awt.Cursor getDropOkCursor​(int action)
        Get the cursor for an "OK" drop.
        Parameters:
        action - action for the drag operation (copy, move, link)
        Returns:
        cursor that is appropriate for the give action