All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.dnd.DropTarget

java.lang.Object
    |
    +----java.awt.dnd.DropTarget

public class DropTarget
extends Object
implements DropTargetListener, Serializable

The DropTarget is associated with a Component, when that Component wishes to accept Drops during Drag and Drop operations.

Since:
JDK1.2

Constructor Index

 o DropTarget()
Construct a DropTarget
 o DropTarget(Component, DropTargetListener)
Construct a DropTarget
 o DropTarget(Component, int, DropTargetListener)
Construct a DropTarget
 o DropTarget(Component, int, DropTargetListener, Insets, boolean)
Construct a DropTarget

Method Index

 o addDropTargetListener(DropTargetListener)
Add a new DropTargetListener (UNICAST SOURCE)
 o addNotify(ComponentPeer)
Notify the DropTarget that it has been associated with a Component This method is usually called from java.awt.Component.addNotify() of the Component associated with this DropTarget to notify the DropTarget that a ComponentPeer has been associated with that Component.
 o createDropTargetContext(DropTarget)
Create the DropTargetContext associated with this DropTarget.
 o dragEnter(DropTargetDragEvent)
The DropTarget intercepts dragEnter() notifications before the registered DropTargetListener gets them.
 o dragExit(DropTargetEvent)
The DropTarget intercepts dragExit() notifications before the registered DropTarget gets them.
 o dragOver(DropTargetDragEvent)
The DropTarget intercepts dragOver() notifications before the registered DropTargetListener gets them.
 o dragScroll(DropTargetDragEvent)
The DropTarget intercepts dragScroll() notifications before the registered DropTarget gets them.
 o drop(DropTargetDropEvent)
The DropTarget intercepts drop() notifications before the registered DropTarget gets them.
 o getAutoscrollDelay()
 o getAutoscrollInsets()
 o getComponent()
 o getDefaultActions()
 o getDropTargetContext()
 o getFlavorMap()
 o isActive()
 o isAutoscrolling()
 o removeDropTargetListener(DropTargetListener)
Remove the current DropTargetListener (UNICAST SOURCE)
 o removeNotify(ComponentPeer)
Notify the DropTarget that it has been disassociated from a Component This method is usually called from java.awt.Component.removeNotify() of the Component associated with this DropTarget to notify the DropTarget that a ComponentPeer has been disassociated with that Component.
 o setActive(boolean)
set the DropTarget (in)active.
 o setAutoscrollDelay(int)
set the Autoscroll ms initial delay
 o setAutoscrollInsets(Insets)
Sets the Autoscroll insets.
 o setComponent(Component)
Note: this interface is required to permit the safe association of a DropTarget with a Component in one of two ways, either: component.setDropTarget(droptarget); or droptarget.setComponent(component); The caller must have AWTPermission.setDropTarget to succeed.
 o setDefaultActions(int)
Sets the default acceptable actions for this DropTarget
 o supportsAutoscroll()

Constructors

 o DropTarget
public DropTarget(Component c,
                  int ops,
                  DropTargetListener dtl,
                  Insets asins,
                  boolean act) throws SecurityException
Construct a DropTarget

Parameters:
c - The Component with which this DropTarget is associated
ops - The default acceptable actions for this DropTarget
dtl - The DropTargetListener for this DropTarget
asins - The Autoscroll Inset region
act - Is the DropTarget accepting drops.
 o DropTarget
public DropTarget() throws SecurityException
Construct a DropTarget

 o DropTarget
public DropTarget(Component c,
                  DropTargetListener dtl) throws SecurityException
Construct a DropTarget

Parameters:
c - The Component with which this DropTarget is associated
dtl - The DropTargetListener for this DropTarget
 o DropTarget
public DropTarget(Component c,
                  int ops,
                  DropTargetListener dtl) throws SecurityException
Construct a DropTarget

Parameters:
c - The Component with which this DropTarget is associated
ops - The default acceptable actions for this DropTarget
dtl - The DropTargetListener for this DropTarget

Methods

 o setComponent
public void setComponent(Component c) throws IllegalArgumentException, SecurityException
Note: this interface is required to permit the safe association of a DropTarget with a Component in one of two ways, either: component.setDropTarget(droptarget); or droptarget.setComponent(component); The caller must have AWTPermission.setDropTarget to succeed.

Parameters:
c - The new Component this DropTarget is to be associated with.
 o getComponent
public Component getComponent()
Returns:
the current Component
 o supportsAutoscroll
public boolean supportsAutoscroll()
Returns:
if this DropTarget and Component supports autoscrolling
 o setAutoscrollInsets
public void setAutoscrollInsets(Insets scrollInsets)
Sets the Autoscroll insets.

Parameters:
scrollInsets - the Autoscroll insets
 o getAutoscrollInsets
public Insets getAutoscrollInsets()
Returns:
the current autoscroll insets
 o setAutoscrollDelay
public void setAutoscrollDelay(int ms)
set the Autoscroll ms initial delay

 o getAutoscrollDelay
public int getAutoscrollDelay()
Returns:
the initial Autoscroll ms delay
 o isAutoscrolling
public boolean isAutoscrolling()
Returns:
if the DropTarget is currently Autoscrolling
 o setDefaultActions
public void setDefaultActions(int ops)
Sets the default acceptable actions for this DropTarget

Parameters:
ops - the default actions.
See Also:
DnDConstants
 o getDefaultActions
public int getDefaultActions()
Returns:
the current default actions
 o setActive
public void setActive(boolean isActive)
set the DropTarget (in)active.

Parameters:
isActive -
 o isActive
public boolean isActive()
Returns:
is the DropTarget active?
 o addDropTargetListener
public void addDropTargetListener(DropTargetListener dte) throws TooManyListenersException
Add a new DropTargetListener (UNICAST SOURCE)

Parameters:
dte - The new DropTargetListener
 o removeDropTargetListener
public void removeDropTargetListener(DropTargetListener dte)
Remove the current DropTargetListener (UNICAST SOURCE)

Parameters:
dte - the DropTargetListener to deregister.
 o dragEnter
public void dragEnter(DropTargetDragEvent dtde)
The DropTarget intercepts dragEnter() notifications before the registered DropTargetListener gets them.

 o dragOver
public void dragOver(DropTargetDragEvent dtde)
The DropTarget intercepts dragOver() notifications before the registered DropTargetListener gets them.

 o dragScroll
public void dragScroll(DropTargetDragEvent dtde)
The DropTarget intercepts dragScroll() notifications before the registered DropTarget gets them. Note that if the platform itself does not support Autoscrolling this method may never be called by the Context's peer.

 o dragExit
public void dragExit(DropTargetEvent dte)
The DropTarget intercepts dragExit() notifications before the registered DropTarget gets them.

 o drop
public void drop(DropTargetDropEvent dtde)
The DropTarget intercepts drop() notifications before the registered DropTarget gets them.

 o getFlavorMap
public FlavorMap getFlavorMap()
Returns:
the FlavorMap for this DropTarget
 o addNotify
public void addNotify(ComponentPeer peer) throws SecurityException
Notify the DropTarget that it has been associated with a Component This method is usually called from java.awt.Component.addNotify() of the Component associated with this DropTarget to notify the DropTarget that a ComponentPeer has been associated with that Component. Calling this method, other than to notify this DropTarget of the association of the ComponentPeer with the Component may result in a malfunction of the DnD system.

Parameters:
peer - The Peer of the Component we are associated with!
 o removeNotify
public void removeNotify(ComponentPeer peer)
Notify the DropTarget that it has been disassociated from a Component This method is usually called from java.awt.Component.removeNotify() of the Component associated with this DropTarget to notify the DropTarget that a ComponentPeer has been disassociated with that Component. Calling this method, other than to notify this DropTarget of the disassociation of the ComponentPeer from the Component may result in a malfunction of the DnD system.

Parameters:
peer - The Peer of the Component we are being disassociated froe!
 o getDropTargetContext
public DropTargetContext getDropTargetContext()
Returns:
the DropTargetContext associated with this DropTarget.
 o createDropTargetContext
protected DropTargetContext createDropTargetContext(DropTarget owner)
Create the DropTargetContext associated with this DropTarget. Subclasses may override this method to instantiate their own DropTargetContext subclass. This call is typically *only* called by the platform's DropTargetContextPeer as a drag operation encounters this DropTarget. Accessing the Context while no Drag is current has undefined results.

Parameters:
owner - the owner of the DropTargetContext

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature