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.

    • Constructor Summary

      Constructors 
      ChangeConstructor Description
      DragSrcAdapter​(Draggable dragComponent)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      ChangeModifier 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.
      NEWprotected java.awt.Cursor getDropOkCursor​(int action)
      Get the cursor for an "OK" drop.
      NEWprotected 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 NEW

        protected Draggable dragComponent

Constructor Detail

  • 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 NEW

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

      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