|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.dnd.DropTarget
ptolemy.vergil.basic.EditorDropTarget
public class EditorDropTarget
This class provides drag-and-drop support. When this drop target receives a transferable object containing a ptolemy entity, it creates a new instance of the object, and adds it to the given graph. If the drop location falls on top of an icon associated with an instance of NamedObj, then the object is deposited inside that instance (so the instance becomes its container). Otherwise, the object is deposited inside the model associated with the target graph. In either 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.
Red (johnr) |
Red (eal) |
Nested Class Summary | |
---|---|
private class |
EditorDropTarget.DTListener
The drop target listener used with the diva graph object. |
Nested classes/interfaces inherited from class java.awt.dnd.DropTarget |
---|
java.awt.dnd.DropTarget.DropTargetAutoScroller |
Field Summary | |
---|---|
private java.util.Vector<java.awt.dnd.DropTargetListener> |
_additionalListeners
Vector to contain additional listeners. |
private boolean |
_dropIntoEnabled
Flag indicating whether drop into is enabled. |
Constructor Summary | |
---|---|
EditorDropTarget(JGraph graph)
Construct a new graph target to operate on the given JGraph. |
Method Summary | |
---|---|
void |
deRegisterAdditionalListener(java.awt.dnd.DropTargetListener listener)
Remove an additional listener. |
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. |
Methods inherited from class java.awt.dnd.DropTarget |
---|
addDropTargetListener, addNotify, clearAutoscroll, createDropTargetAutoScroller, createDropTargetContext, dragEnter, dragExit, dragOver, drop, 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 |
Field Detail |
---|
private java.util.Vector<java.awt.dnd.DropTargetListener> _additionalListeners
private boolean _dropIntoEnabled
Constructor Detail |
---|
public EditorDropTarget(JGraph graph)
graph
- The diva graph panel.Method Detail |
---|
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |