public class EditorDropTarget
extends java.awt.dnd.DropTarget
RelativeLocatable
marker interface,
then instead of dropping it inside the target object, it is dropped
into the container of the target object and assigned a location relative
to the target object. If the drop location is not on top of any object, then
the object is deposited inside the model associated with the
target graph. In any case, if the target container implements
the DropListener interface, then it is informed of the drop by
calling its dropped() method.
Sometimes, you will want to disable the feature that a drop onto a NamedObj results in the dropped object being placed inside that NamedObj. To disable this feature, call setDropIntoEnabled() with a false argument.
Constructor and Description |
---|
EditorDropTarget()
Construct a new graph target to operate on the given JGraph.
|
EditorDropTarget(JGraph graph)
Construct a new graph target to operate on the given JGraph.
|
Modifier and Type | Method and Description |
---|---|
void |
deRegisterAdditionalListener(java.awt.dnd.DropTargetListener listener)
Remove an additional listener.
|
java.util.Vector<java.awt.dnd.DropTargetListener> |
getAdditionalListeners()
Return the Vector of listeners that have been registered.
|
boolean |
isDropIntoEnabled()
Return true if the feature is enabled that a a drop onto an
instance of NamedObj results in that NamedObj containing the
dropped object.
|
void |
registerAdditionalListener(java.awt.dnd.DropTargetListener listener)
Register additional DropTargetListeners.
|
void |
setDropIntoEnabled(boolean enabled)
If the argument is false, then disable the feature that a
a drop onto an instance of NamedObj results in that NamedObj
containing the dropped object.
|
addDropTargetListener, addNotify, clearAutoscroll, createDropTargetAutoScroller, createDropTargetContext, dragEnter, dragExit, dragOver, drop, dropActionChanged, getComponent, getDefaultActions, getDropTargetContext, getFlavorMap, initializeAutoscrolling, isActive, removeDropTargetListener, removeNotify, setActive, setComponent, setDefaultActions, setFlavorMap, updateAutoscroll
public EditorDropTarget()
public EditorDropTarget(JGraph graph)
graph
- The diva graph panel.public void deRegisterAdditionalListener(java.awt.dnd.DropTargetListener listener)
listener
- The DropTargetListener to be removed.public boolean isDropIntoEnabled()
public void registerAdditionalListener(java.awt.dnd.DropTargetListener listener)
listener
- The DropTargetListener to be added.public void setDropIntoEnabled(boolean enabled)
enabled
- False to disable the drop into feature.public java.util.Vector<java.awt.dnd.DropTargetListener> getAdditionalListeners()
registerAdditionalListener(DropTargetListener)
.