net.lucidviews.util.gui.swing.dnd
Class DefaultSwingDropTarget
java.lang.Object
java.awt.dnd.DropTarget
net.lucidviews.util.gui.swing.dnd.DefaultDropTarget
net.lucidviews.util.gui.swing.dnd.DefaultSwingDropTarget
- All Implemented Interfaces:
- DropTargetListener, Serializable, EventListener
- Direct Known Subclasses:
- JWebAddress.WebAddressDropTarget
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.
- Since:
- 1.3
- Version:
- $Revision: 1.1.2.1 $
- Author:
- Stephen Battey
- See Also:
- Serialized Form
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 |
serialVersionUID
private static final long serialVersionUID
- Serialisation version id.
- See Also:
- Constant Field Values
target
protected JComponent target
- The component that is the target of dropped content.
DefaultSwingDropTarget
protected DefaultSwingDropTarget(JComponent component,
int supportedActions)
- Create a drop target for the specified Swing component.
- Parameters:
component
- the GUI component that is to accept DnDssupportedActions
- the actions that will be supported - a bit mask of DnDConstants
dataFlavourSupported
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.
- Overrides:
dataFlavourSupported
in class DefaultDropTarget
- Parameters:
component
- the component being targetedflavours
- the data flavour(s) of the incoming drag'n'drop event
- Returns:
- a Boolean value indicating if the data flavour is accepted by this
drop target