Package uk.ac.starlink.datanode.tree
Class BasicDropHandler
java.lang.Object
java.awt.dnd.DropTarget
uk.ac.starlink.datanode.tree.BasicDropHandler
- All Implemented Interfaces:
DropTargetListener
,Serializable
,EventListener
Custom DropTarget subclass. This provides basic
DropTarget/DropTargetListener functionality for use with components
which want to define their own drop behaviour. An instance of this
class can be slotted into a JComponent using its
Component.setDropTarget(java.awt.dnd.DropTarget)
method to override the
one which is installed with it (which probably comes from the basic UI).- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.dnd.DropTarget
DropTarget.DropTargetAutoScroller
-
Constructor Summary
ConstructorsConstructorDescriptionBasicDropHandler
(JComponent comp) Constructs a new drop handler for use with a given component. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
dragExit
(DropTargetEvent evt) void
void
drop
(DropTargetDropEvent evt) protected boolean
isDropLocation
(Point loc) Indicates whether a given location is permissible for a drop event.Methods inherited from class java.awt.dnd.DropTarget
addDropTargetListener, addNotify, clearAutoscroll, createDropTargetAutoScroller, createDropTargetContext, dropActionChanged, getComponent, getDefaultActions, getDropTargetContext, getFlavorMap, initializeAutoscrolling, isActive, removeDropTargetListener, removeNotify, setActive, setComponent, setDefaultActions, setFlavorMap, updateAutoscroll
-
Constructor Details
-
BasicDropHandler
Constructs a new drop handler for use with a given component.- Parameters:
comp
- the component which this drop handler will control
-
-
Method Details
-
dragEnter
- Specified by:
dragEnter
in interfaceDropTargetListener
- Overrides:
dragEnter
in classDropTarget
-
dragOver
- Specified by:
dragOver
in interfaceDropTargetListener
- Overrides:
dragOver
in classDropTarget
-
dragExit
- Specified by:
dragExit
in interfaceDropTargetListener
- Overrides:
dragExit
in classDropTarget
-
drop
- Specified by:
drop
in interfaceDropTargetListener
- Overrides:
drop
in classDropTarget
-
isDropLocation
Indicates whether a given location is permissible for a drop event.- Parameters:
loc
- the point at which a drop might take place- Returns:
true
iff it's OK to drop atloc
-