Class DefaultSwingDropTarget

  extended by java.awt.dnd.DropTarget
      extended by net.lucidviews.util.gui.swing.dnd.DefaultDropTarget
          extended by net.lucidviews.util.gui.swing.dnd.DefaultSwingDropTarget
All Implemented Interfaces:
DropTargetListener, Serializable, EventListener
Direct Known Subclasses:

public class DefaultSwingDropTarget
extends DefaultDropTarget

An extension of the DropTarget class for Swing components that invokes state changes on the drag'n'drop event.

This class must be sub-classed and the drag/drop methods overridden with custom implementations. NB: overridden methods must call the super method to invoke the state change on the event.

$Revision: $
Stephen Battey
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class java.awt.dnd.DropTarget
Field Summary
private static long serialVersionUID
          Serialisation version id.
protected  JComponent target
          The component that is the target of dropped content.
Fields inherited from class net.lucidviews.util.gui.swing.dnd.DefaultDropTarget
canImport, supportedActions
Constructor Summary
protected DefaultSwingDropTarget(JComponent component, int supportedActions)
          Create a drop target for the specified Swing component.
Method Summary
protected  boolean dataFlavourSupported(Component component, DataFlavor[] flavours)
          Check if a data type is accepted by this drop target.
Methods inherited from class net.lucidviews.util.gui.swing.dnd.DefaultDropTarget
dragEnter, dragExit, dragOver, drop, dropActionChanged
Methods inherited from class java.awt.dnd.DropTarget
addDropTargetListener, addNotify, clearAutoscroll, createDropTargetAutoScroller, createDropTargetContext, getComponent, getDefaultActions, getDropTargetContext, getFlavorMap, initializeAutoscrolling, isActive, removeDropTargetListener, removeNotify, setActive, setComponent, setDefaultActions, setFlavorMap, updateAutoscroll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


private static final long serialVersionUID
Serialisation version id.

See Also:
Constant Field Values


protected JComponent target
The component that is the target of dropped content.

Constructor Detail


protected DefaultSwingDropTarget(JComponent component,
                                 int supportedActions)
Create a drop target for the specified Swing component.

component - the GUI component that is to accept DnDs
supportedActions - the actions that will be supported - a bit mask of DnDConstants
Method Detail


protected boolean dataFlavourSupported(Component component,
                                       DataFlavor[] flavours)
Check if a data type is accepted by this drop target.
By default, all data flavours are supported. This method can be overridden to change that behaviour.

dataFlavourSupported in class DefaultDropTarget
component - the component being targeted
flavours - the data flavour(s) of the incoming drag'n'drop event
a Boolean value indicating if the data flavour is accepted by this drop target