Module org.jpo
Package org.jpo.gui

Class JpoTransferableDropTargetListener

java.lang.Object
org.jpo.gui.JpoTransferableDropTargetListener
All Implemented Interfaces:
DropTargetListener, EventListener

public class JpoTransferableDropTargetListener extends Object implements DropTargetListener
A drop target listener for the transferable
  • Constructor Details

    • JpoTransferableDropTargetListener

      public JpoTransferableDropTargetListener(JpoDropTargetDropEventHandler jpoDropTargetDropEventHandler)
      Constructor
      Parameters:
      jpoDropTargetDropEventHandler - Event handler
  • Method Details

    • dragEnter

      public void dragEnter(DropTargetDragEvent event)
      this callback method is invoked every time something is dragged onto the ThumbnailController. We check if the desired DataFlavor is supported and then reject the drag if it is not.
      Specified by:
      dragEnter in interface DropTargetListener
      Parameters:
      event - The event
    • dragOver

      public void dragOver(DropTargetDragEvent event)
      this callback method is invoked every time something is dragged over the ThumbnailController. We could do some highlighting if we so desired.
      Specified by:
      dragOver in interface DropTargetListener
      Parameters:
      event - The event
    • dropActionChanged

      public void dropActionChanged(DropTargetDragEvent event)
      this callback method is invoked when the user presses or releases shift when doing a drag. He can signal that he wants to change the copy / move of the operation. This method could intercept this change and could modify the event if it needs to. On Thumbnails this does nothing.
      Specified by:
      dropActionChanged in interface DropTargetListener
      Parameters:
      event - The event
    • dragExit

      public void dragExit(DropTargetEvent event)
      this callback method is invoked to tell the dropTarget that the drag has moved on to something else. We do nothing here.
      Specified by:
      dragExit in interface DropTargetListener
      Parameters:
      event - The event
    • drop

      public void drop(DropTargetDropEvent event)
      This method is called when the drop occurs. It gives the hard work to the SortableDefaultMutableTreeNode.
      Specified by:
      drop in interface DropTargetListener
      Parameters:
      event - The event