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
public class BasicDropHandler
- extends DropTarget
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:
- Serialized Form
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicDropHandler
public BasicDropHandler(JComponent comp)
- Constructs a new drop handler for use with a given component.
- Parameters:
comp
- the component which this drop handler will control
dragEnter
public void dragEnter(DropTargetDragEvent evt)
- Specified by:
dragEnter
in interface DropTargetListener
- Overrides:
dragEnter
in class DropTarget
dragOver
public void dragOver(DropTargetDragEvent evt)
- Specified by:
dragOver
in interface DropTargetListener
- Overrides:
dragOver
in class DropTarget
dragExit
public void dragExit(DropTargetEvent evt)
- Specified by:
dragExit
in interface DropTargetListener
- Overrides:
dragExit
in class DropTarget
drop
public void drop(DropTargetDropEvent evt)
- Specified by:
drop
in interface DropTargetListener
- Overrides:
drop
in class DropTarget
isDropLocation
protected boolean isDropLocation(Point loc)
- 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 at loc
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.