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(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 DropTarget
DropTarget.DropTargetAutoScroller -
Constructor Summary
ConstructorsConstructorDescriptionBasicDropHandler(JComponent comp) Constructs a new drop handler for use with a given component. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddragExit(DropTargetEvent evt) voidvoiddrop(DropTargetDropEvent evt) protected booleanisDropLocation(Point loc) Indicates whether a given location is permissible for a drop event.Methods inherited from class 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:
dragEnterin interfaceDropTargetListener- Overrides:
dragEnterin classDropTarget
-
dragOver
- Specified by:
dragOverin interfaceDropTargetListener- Overrides:
dragOverin classDropTarget
-
dragExit
- Specified by:
dragExitin interfaceDropTargetListener- Overrides:
dragExitin classDropTarget
-
drop
- Specified by:
dropin interfaceDropTargetListener- Overrides:
dropin 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:
trueiff it's OK to drop atloc
-