org.artoflife.gui.population
Class PopulationViewDropTargetListener

java.lang.Object
  |
  +--org.artoflife.util.dnd.ThumbnailIconDropTargetListener
        |
        +--org.artoflife.gui.population.PopulationViewDropTargetListener
All Implemented Interfaces:
java.awt.dnd.DropTargetListener, java.util.EventListener

public class PopulationViewDropTargetListener
extends ThumbnailIconDropTargetListener

A lot of this is copied from TransferHandler$DropHandler, the default Swing drop handler, modified to handle the distinction between MOVE within a PopulationView and COPY from another one.

Author:
Steve Meyfroidt

Field Summary
 
Fields inherited from class org.artoflife.util.dnd.ThumbnailIconDropTargetListener
lastDragImageBounds, lastMousePosition, thumbnailIcon
 
Constructor Summary
PopulationViewDropTargetListener()
           
 
Method Summary
 void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
          Initialise everything here so can paint icon while tracking in dragOver.
 void dragExit(java.awt.dnd.DropTargetEvent dte)
          Must call this from subclass dragExit() implementation.
 void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
          If got a thumbnail icon to paint then track cursor with it.
 void drop(java.awt.dnd.DropTargetDropEvent dtde)
          Must call this from subclass drop() implementation.
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PopulationViewDropTargetListener

public PopulationViewDropTargetListener()
Method Detail

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
Description copied from class: ThumbnailIconDropTargetListener
Initialise everything here so can paint icon while tracking in dragOver.

Must call this from subclasses after accepting the drag else you will see "No current drop operation" exceptions from the underlying AWT DnD implementation.

Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener
Overrides:
dragEnter in class ThumbnailIconDropTargetListener
See Also:
DropTargetListener.dragEnter(DropTargetDragEvent)

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
Description copied from class: ThumbnailIconDropTargetListener
If got a thumbnail icon to paint then track cursor with it.

Must call this from subclass dragOver implementations.

Specified by:
dragOver in interface java.awt.dnd.DropTargetListener
Overrides:
dragOver in class ThumbnailIconDropTargetListener
See Also:
DropTargetListener.dragOver(DropTargetDragEvent)

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
See Also:
DropTargetListener.dropActionChanged(DropTargetDragEvent)

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent dte)
Description copied from class: ThumbnailIconDropTargetListener
Must call this from subclass dragExit() implementation.

Specified by:
dragExit in interface java.awt.dnd.DropTargetListener
Overrides:
dragExit in class ThumbnailIconDropTargetListener
See Also:
DropTargetListener.dragExit(DropTargetEvent)

drop

public void drop(java.awt.dnd.DropTargetDropEvent dtde)
Description copied from class: ThumbnailIconDropTargetListener
Must call this from subclass drop() implementation.

Specified by:
drop in interface java.awt.dnd.DropTargetListener
Overrides:
drop in class ThumbnailIconDropTargetListener
See Also:
DropTargetListener.drop(DropTargetDropEvent)

artoflife pre0.1.0-dev

Copyright © 2002 the Art Of Life team. All Rights Reserved.