public class EditorDropTargetListener
extends java.lang.Object
implements java.awt.dnd.DropTargetListener
Derived classes could extend this class to provide a different drag and drop interface.
Red (johnr) |
Red (eal) |
Modifier and Type | Field and Description |
---|---|
protected EditorDropTarget |
_dropTarget
Associated DropTarget.
|
Constructor and Description |
---|
EditorDropTargetListener() |
Modifier and Type | Method and Description |
---|---|
protected Figure |
_getFigureUnder(java.awt.geom.Point2D point)
Return the figure that is an icon of a NamedObj and is
under the specified point, or null if there is none.
|
protected NamedObj |
_getObjectUnder(java.awt.geom.Point2D point)
Return the object under the specified point, or null if there
is none.
|
void |
dragEnter(java.awt.dnd.DropTargetDragEvent dropEvent)
Accept the event if the data is a known key.
|
void |
dragExit(java.awt.dnd.DropTargetEvent dropEvent)
Remove any highlighting that might be active.
|
void |
dragOver(java.awt.dnd.DropTargetDragEvent dropEvent)
If the location of the event is over an icon for
an instance of NamedObj, then highlight that icon.
|
void |
drop(java.awt.dnd.DropTargetDropEvent dropEvent)
If the transferable object is recognized as a Ptolemy II object,
then use the MoML description of the object to create a new
instance of the object at the drop location.
|
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent dropEvent)
Accept the event if the data is a known key.
|
void |
setDropTarget(EditorDropTarget dropTarget)
Links this Listener back to the EditorDropTarget it belongs to.
|
protected EditorDropTarget _dropTarget
public void dragEnter(java.awt.dnd.DropTargetDragEvent dropEvent)
dragEnter
in interface java.awt.dnd.DropTargetListener
dropEvent
- The drop event.public void dragExit(java.awt.dnd.DropTargetEvent dropEvent)
dragExit
in interface java.awt.dnd.DropTargetListener
dropEvent
- The drop event.public void dragOver(java.awt.dnd.DropTargetDragEvent dropEvent)
dragOver
in interface java.awt.dnd.DropTargetListener
dropEvent
- The drop event.public void drop(java.awt.dnd.DropTargetDropEvent dropEvent)
drop
in interface java.awt.dnd.DropTargetListener
dropEvent
- The drop event.public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dropEvent)
dropActionChanged
in interface java.awt.dnd.DropTargetListener
dropEvent
- The drop event.public void setDropTarget(EditorDropTarget dropTarget)
dropTarget
- The drop target.protected Figure _getFigureUnder(java.awt.geom.Point2D point)
point
- The point in the graph pane.protected NamedObj _getObjectUnder(java.awt.geom.Point2D point)
point
- The point in the graph pane.