org.nakedobjects.viewer.classic.event.dnd
Class DragDropEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byorg.nakedobjects.viewer.classic.event.dnd.DragDropEvent
All Implemented Interfaces:
java.io.Serializable

public class DragDropEvent
extends java.util.EventObject

See Also:
Serialized Form

Field Summary
static int COPY
          Indicates the DragDropComponent has been dropped and it should be copied to the new DropDestination location.
static int DRAG
          Indicates the start of the drag process when a DragDropComponent is first dragged.
static int DRAG_CANCEL
           
static int DRAG_ENTER
          Indicates a DragDropComponent has been been entered during dragging.
static int DRAG_EXIT
          Indicates a DragDropComponent has been exited during dragging.
static int DRAGGING
          Indicates the continued dragging of a DragDropComponent.
static int DROP
          Indicates the DragDropComponent has been dropped onto another DragDropComponent.
static int MOVE
          Indicates the DragDropComponent has been dropped and it should be move to the new DragDropComponent location.
static int VACANT_DROP
          Indicates a DragDropComponent has been dropped into an empty space - outside of a DropDestination.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DragDropEvent(int action, int modifiers, DragSource dragSource, DropDestination dropDestination, java.awt.Point location)
           
 
Method Summary
 int getAction()
          Returns the drag/drop action that has taken place.
 DragSource getDragSource()
          Returns the component that is being dragged.
 DropDestination getDropDestination()
          Returns the component being dropped onto.
 java.awt.Point getLocationInDestination()
          Returns the mouse position within the destination Component.
 java.awt.Point getLocationInSource()
          Returns the mouse position within the source Component.
 java.awt.Point getLocationOnScreen()
           
 int getModifiers()
          Returns the modifier which indicates which buttons and keys where used when issuing the gesture.
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DRAG

public static final int DRAG
Indicates the start of the drag process when a DragDropComponent is first dragged.

See Also:
Constant Field Values

DRAGGING

public static final int DRAGGING
Indicates the continued dragging of a DragDropComponent.

See Also:
Constant Field Values

MOVE

public static final int MOVE
Indicates the DragDropComponent has been dropped and it should be move to the new DragDropComponent location.

See Also:
Constant Field Values

COPY

public static final int COPY
Indicates the DragDropComponent has been dropped and it should be copied to the new DropDestination location.

See Also:
Constant Field Values

DROP

public static final int DROP
Indicates the DragDropComponent has been dropped onto another DragDropComponent.

See Also:
Constant Field Values

VACANT_DROP

public static final int VACANT_DROP
Indicates a DragDropComponent has been dropped into an empty space - outside of a DropDestination.

See Also:
Constant Field Values

DRAG_ENTER

public static final int DRAG_ENTER
Indicates a DragDropComponent has been been entered during dragging.

See Also:
Constant Field Values

DRAG_EXIT

public static final int DRAG_EXIT
Indicates a DragDropComponent has been exited during dragging.

See Also:
Constant Field Values

DRAG_CANCEL

public static final int DRAG_CANCEL
See Also:
Constant Field Values
Constructor Detail

DragDropEvent

public DragDropEvent(int action,
                     int modifiers,
                     DragSource dragSource,
                     DropDestination dropDestination,
                     java.awt.Point location)
Method Detail

getAction

public int getAction()
Returns the drag/drop action that has taken place. See the class constants.


getDragSource

public DragSource getDragSource()
Returns the component that is being dragged.

Returns:
DragSource that is being dragged

getDropDestination

public DropDestination getDropDestination()
Returns the component being dropped onto.

Returns:
the DropDestination where the dragged component is trying to be dropped.

getLocationInDestination

public java.awt.Point getLocationInDestination()
Returns the mouse position within the destination Component. This is calculated from a location that is relative to the source component.

Returns:
mouse location with respect to the destination Component

getLocationInSource

public java.awt.Point getLocationInSource()
Returns the mouse position within the source Component. This is calculated from a location that is relative to the source component.

Returns:
mouse location with respect to the source Component

getLocationOnScreen

public java.awt.Point getLocationOnScreen()

getModifiers

public int getModifiers()
Returns the modifier which indicates which buttons and keys where used when issuing the gesture. See the InputEvent class for details of the moifiers.

Returns:
the modifiers from the original MouseEvent.
See Also:
InputEvent

toString

public java.lang.String toString()