java.awt.dnd
Class DragSourceDropEvent

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject 
      extended by java.awt.dnd.DragSourceEvent sample code for java.awt.dnd.DragSourceEvent definition code for java.awt.dnd.DragSourceEvent 
          extended by java.awt.dnd.DragSourceDropEvent
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class DragSourceDropEvent
extends DragSourceEvent sample code for java.awt.dnd.DragSourceEvent definition code for java.awt.dnd.DragSourceEvent

The DragSourceDropEvent is delivered from the DragSourceContextPeer, via the DragSourceContext, to the dragDropEnd method of DragSourceListeners registered with that DragSourceContext and with its associated DragSource. It contains sufficient information for the originator of the operation to provide appropriate feedback to the end user when the operation completes.

Since:
1.2
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
source sample code for java.util.EventObject.source definition code for java.util.EventObject.source
 
Constructor Summary
DragSourceDropEvent sample code for java.awt.dnd.DragSourceDropEvent.DragSourceDropEvent(java.awt.dnd.DragSourceContext) definition code for java.awt.dnd.DragSourceDropEvent.DragSourceDropEvent(java.awt.dnd.DragSourceContext) (DragSourceContext sample code for java.awt.dnd.DragSourceContext definition code for java.awt.dnd.DragSourceContext  dsc)
          Construct a DragSourceDropEvent for a drag that does not result in a drop.
DragSourceDropEvent sample code for java.awt.dnd.DragSourceDropEvent.DragSourceDropEvent(java.awt.dnd.DragSourceContext, int, boolean) definition code for java.awt.dnd.DragSourceDropEvent.DragSourceDropEvent(java.awt.dnd.DragSourceContext, int, boolean) (DragSourceContext sample code for java.awt.dnd.DragSourceContext definition code for java.awt.dnd.DragSourceContext  dsc, int action, boolean success)
          Construct a DragSourceDropEvent for a drop, given the DragSourceContext, the drop action, and a boolean indicating if the drop was successful.
DragSourceDropEvent sample code for java.awt.dnd.DragSourceDropEvent.DragSourceDropEvent(java.awt.dnd.DragSourceContext, int, boolean, int, int) definition code for java.awt.dnd.DragSourceDropEvent.DragSourceDropEvent(java.awt.dnd.DragSourceContext, int, boolean, int, int) (DragSourceContext sample code for java.awt.dnd.DragSourceContext definition code for java.awt.dnd.DragSourceContext  dsc, int action, boolean success, int x, int y)
          Construct a DragSourceDropEvent for a drop, given the DragSourceContext, the drop action, a boolean indicating if the drop was successful, and coordinates.
 
Method Summary
 int getDropAction sample code for java.awt.dnd.DragSourceDropEvent.getDropAction() definition code for java.awt.dnd.DragSourceDropEvent.getDropAction() ()
          This method returns an int representing the action performed by the target on the subject of the drop.
 boolean getDropSuccess sample code for java.awt.dnd.DragSourceDropEvent.getDropSuccess() definition code for java.awt.dnd.DragSourceDropEvent.getDropSuccess() ()
          This method returns a boolean indicating if the drop was successful.
 
Methods inherited from class java.awt.dnd.DragSourceEvent sample code for java.awt.dnd.DragSourceEvent definition code for java.awt.dnd.DragSourceEvent
getDragSourceContext sample code for java.awt.dnd.DragSourceEvent.getDragSourceContext() definition code for java.awt.dnd.DragSourceEvent.getDragSourceContext() , getLocation sample code for java.awt.dnd.DragSourceEvent.getLocation() definition code for java.awt.dnd.DragSourceEvent.getLocation() , getX sample code for java.awt.dnd.DragSourceEvent.getX() definition code for java.awt.dnd.DragSourceEvent.getX() , getY sample code for java.awt.dnd.DragSourceEvent.getY() definition code for java.awt.dnd.DragSourceEvent.getY()
 
Methods inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
getSource sample code for java.util.EventObject.getSource() definition code for java.util.EventObject.getSource() , toString sample code for java.util.EventObject.toString() definition code for java.util.EventObject.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

DragSourceDropEvent sample code for java.awt.dnd.DragSourceDropEvent(java.awt.dnd.DragSourceContext, int, boolean) definition code for java.awt.dnd.DragSourceDropEvent(java.awt.dnd.DragSourceContext, int, boolean)

public DragSourceDropEvent(DragSourceContext sample code for java.awt.dnd.DragSourceContext definition code for java.awt.dnd.DragSourceContext  dsc,
                           int action,
                           boolean success)
Construct a DragSourceDropEvent for a drop, given the DragSourceContext, the drop action, and a boolean indicating if the drop was successful. The coordinates for this DragSourceDropEvent are not specified, so getLocation will return null for this event.

The argument action should be one of DnDConstants that represents a single action. This constructor does not throw any exception for invalid action.

Parameters:
dsc - the DragSourceContext associated with this DragSourceDropEvent
action - the drop action
success - a boolean indicating if the drop was successful
Throws:
IllegalArgumentException - if dsc is null.
See Also:
DragSourceEvent.getLocation() sample code for java.awt.dnd.DragSourceEvent.getLocation() definition code for java.awt.dnd.DragSourceEvent.getLocation()

DragSourceDropEvent sample code for java.awt.dnd.DragSourceDropEvent(java.awt.dnd.DragSourceContext, int, boolean, int, int) definition code for java.awt.dnd.DragSourceDropEvent(java.awt.dnd.DragSourceContext, int, boolean, int, int)

public DragSourceDropEvent(DragSourceContext sample code for java.awt.dnd.DragSourceContext definition code for java.awt.dnd.DragSourceContext  dsc,
                           int action,
                           boolean success,
                           int x,
                           int y)
Construct a DragSourceDropEvent for a drop, given the DragSourceContext, the drop action, a boolean indicating if the drop was successful, and coordinates.

The argument action should be one of DnDConstants that represents a single action. This constructor does not throw any exception for invalid action.

Parameters:
dsc - the DragSourceContext associated with this DragSourceDropEvent
action - the drop action
success - a boolean indicating if the drop was successful
x - the horizontal coordinate for the cursor location
y - the vertical coordinate for the cursor location
Throws:
IllegalArgumentException - if dsc is null.
Since:
1.4

DragSourceDropEvent sample code for java.awt.dnd.DragSourceDropEvent(java.awt.dnd.DragSourceContext) definition code for java.awt.dnd.DragSourceDropEvent(java.awt.dnd.DragSourceContext)

public DragSourceDropEvent(DragSourceContext sample code for java.awt.dnd.DragSourceContext definition code for java.awt.dnd.DragSourceContext  dsc)
Construct a DragSourceDropEvent for a drag that does not result in a drop. The coordinates for this DragSourceDropEvent are not specified, so getLocation will return null for this event.

Parameters:
dsc - the DragSourceContext
Throws:
IllegalArgumentException - if dsc is null.
See Also:
DragSourceEvent.getLocation() sample code for java.awt.dnd.DragSourceEvent.getLocation() definition code for java.awt.dnd.DragSourceEvent.getLocation()
Method Detail

getDropSuccess sample code for java.awt.dnd.DragSourceDropEvent.getDropSuccess() definition code for java.awt.dnd.DragSourceDropEvent.getDropSuccess()

public boolean getDropSuccess()
This method returns a boolean indicating if the drop was successful.

Returns:
true if the drop target accepted the drop and successfully performed a drop action; false if the drop target rejected the drop or if the drop target accepted the drop, but failed to perform a drop action.

getDropAction sample code for java.awt.dnd.DragSourceDropEvent.getDropAction() definition code for java.awt.dnd.DragSourceDropEvent.getDropAction()

public int getDropAction()
This method returns an int representing the action performed by the target on the subject of the drop.

Returns:
the action performed by the target on the subject of the drop if the drop target accepted the drop and the target drop action is supported by the drag source; otherwise, DnDConstants.ACTION_NONE.