| 
 | JavaTM 2 Platform Std. Ed. v1.4.2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.dnd.DropTarget
The DropTarget is associated 
 with a Component when that Component 
 wishes
 to accept drops during Drag and Drop operations.
 
  Each
 DropTarget is associated with a FlavorMap.
 The default FlavorMap hereafter designates the
 FlavorMap returned by SystemFlavorMap.getDefaultFlavorMap().
| Nested Class Summary | |
| protected static class | DropTarget.DropTargetAutoScrollerthis protected nested class implements autoscrolling | 
| Constructor Summary | |
| DropTarget()Creates a DropTarget. | |
| DropTarget(Component c,
           DropTargetListener dtl)Creates a DropTargetgiven theComponentto associate itself with, and theDropTargetListenerto handle event processing. | |
| DropTarget(Component c,
           int ops,
           DropTargetListener dtl)Creates a DropTargetgiven theComponentto associate itself with, anintrepresenting
 the default acceptable action(s) to support, and aDropTargetListenerto handle event processing. | |
| DropTarget(Component c,
           int ops,
           DropTargetListener dtl,
           boolean act)Creates a DropTargetgiven theComponentto associate itself with, anintrepresenting
 the default acceptable action(s) 
 to support, aDropTargetListenerto handle event processing, and abooleanindicating 
 if theDropTargetis currently accepting drops. | |
| DropTarget(Component c,
           int ops,
           DropTargetListener dtl,
           boolean act,
           FlavorMap fm)Creates a new DropTarget given the Componentto associate itself with, anintrepresenting
 the default acceptable action(s) to 
 support, aDropTargetListenerto handle event processing, abooleanindicating 
 if theDropTargetis currently accepting drops, and 
 aFlavorMapto use (or null for the defaultFlavorMap). | |
| Method Summary | |
|  void | addDropTargetListener(DropTargetListener dtl)Adds a new DropTargetListener(UNICAST SOURCE). | 
|  void | addNotify(java.awt.peer.ComponentPeer peer)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. | 
| protected  void | clearAutoscroll()clear autoscrolling | 
| protected  DropTarget.DropTargetAutoScroller | createDropTargetAutoScroller(Component c,
                             Point p)create an embedded autoscroller | 
| protected  DropTargetContext | createDropTargetContext()Creates the DropTargetContext associated with this DropTarget. | 
|  void | dragEnter(DropTargetDragEvent dtde)The DropTargetintercepts 
 dragEnter() notifications before the 
 registeredDropTargetListenergets them. | 
|  void | dragExit(DropTargetEvent dte)The DropTargetintercepts 
 dragExit() notifications before the 
 registeredDropTargetListenergets them. | 
|  void | dragOver(DropTargetDragEvent dtde)The DropTargetintercepts dragOver() notifications before the
 registeredDropTargetListenergets them. | 
|  void | drop(DropTargetDropEvent dtde)The DropTargetintercepts drop() notifications before the 
 registeredDropTargetListenergets them. | 
|  void | dropActionChanged(DropTargetDragEvent dtde)The DropTargetintercepts 
 dropActionChanged() notifications before the 
 registeredDropTargetListenergets them. | 
|  Component | getComponent()Gets the Componentassociated 
 with thisDropTarget. | 
|  int | getDefaultActions()Gets an intrepresenting the
 current action(s) supported by thisDropTarget. | 
|  DropTargetContext | getDropTargetContext()Gets the DropTargetContextassociated 
 with thisDropTarget. | 
|  FlavorMap | getFlavorMap()Gets the FlavorMapassociated with thisDropTarget. | 
| protected  void | initializeAutoscrolling(Point p)initialize autoscrolling | 
|  boolean | isActive()Reports whether or not this DropTargetis currently active (ready to accept drops). | 
|  void | removeDropTargetListener(DropTargetListener dtl)Removes the current DropTargetListener(UNICAST SOURCE). | 
|  void | removeNotify(java.awt.peer.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. | 
|  void | setActive(boolean isActive)Sets the DropTarget active if true, 
 inactive iffalse. | 
|  void | setComponent(Component c)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);  | 
|  void | setDefaultActions(int ops)Sets the default acceptable actions for this DropTarget | 
|  void | setFlavorMap(FlavorMap fm)Sets the FlavorMapassociated
 with thisDropTarget. | 
| protected  void | updateAutoscroll(Point dragCursorLocn)update autoscrolling with current cursor locn | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public DropTarget(Component c,
                  int ops,
                  DropTargetListener dtl,
                  boolean act,
                  FlavorMap fm)
           throws HeadlessException
Component 
 to associate itself with, an int representing
 the default acceptable action(s) to 
 support, a DropTargetListener
 to handle event processing, a boolean indicating 
 if the DropTarget is currently accepting drops, and 
 a FlavorMap to use (or null for the default FlavorMap).
 The Component will receive drops only if it is enabled.
c - The Component with which this DropTarget is associatedops - The default acceptable actions for this DropTargetdtl - The DropTargetListener for this DropTargetact - Is the DropTarget accepting drops.fm - The FlavorMap to use, or null for the default FlavorMap
HeadlessException - if GraphicsEnvironment.isHeadless()
            returns trueGraphicsEnvironment.isHeadless()
public DropTarget(Component c,
                  int ops,
                  DropTargetListener dtl,
                  boolean act)
           throws HeadlessException
DropTarget given the Component 
 to associate itself with, an int representing
 the default acceptable action(s) 
 to support, a DropTargetListener
 to handle event processing, and a boolean indicating 
 if the DropTarget is currently accepting drops.
 The Component will receive drops only if it is enabled.
c - The Component with which this DropTarget is associatedops - The default acceptable actions for this DropTargetdtl - The DropTargetListener for this DropTargetact - Is the DropTarget accepting drops.
HeadlessException - if GraphicsEnvironment.isHeadless()
            returns trueGraphicsEnvironment.isHeadless()
public DropTarget()
           throws HeadlessException
DropTarget.
HeadlessException - if GraphicsEnvironment.isHeadless()
            returns trueGraphicsEnvironment.isHeadless()
public DropTarget(Component c,
                  DropTargetListener dtl)
           throws HeadlessException
DropTarget given the Component 
 to associate itself with, and the DropTargetListener
 to handle event processing.
 The Component will receive drops only if it is enabled.
c - The Component with which this DropTarget is associateddtl - The DropTargetListener for this DropTarget
HeadlessException - if GraphicsEnvironment.isHeadless()
            returns trueGraphicsEnvironment.isHeadless()
public DropTarget(Component c,
                  int ops,
                  DropTargetListener dtl)
           throws HeadlessException
DropTarget given the Component 
 to associate itself with, an int representing
 the default acceptable action(s) to support, and a
 DropTargetListener to handle event processing.
 The Component will receive drops only if it is enabled.
c - The Component with which this DropTarget is associatedops - The default acceptable actions for this DropTargetdtl - The DropTargetListener for this DropTarget
HeadlessException - if GraphicsEnvironment.isHeadless()
            returns trueGraphicsEnvironment.isHeadless()| Method Detail | 
public void setComponent(Component c)
 component.setDropTarget(droptarget); 
 or  droptarget.setComponent(component); 
 The Component will receive drops only if it is enabled.
c - The new Component this DropTarget 
 is to be associated with.public Component getComponent()
Component associated 
 with this DropTarget.
 
public void setDefaultActions(int ops)
DropTarget
 
ops - the default actions
 DnDConstantspublic int getDefaultActions()
int representing the
 current action(s) supported by this DropTarget.
 
public void setActive(boolean isActive)
true, 
 inactive if false.
 
isActive - sets the DropTarget (in)active.public boolean isActive()
DropTarget 
 is currently active (ready to accept drops).
 
true if active, false if not
public void addDropTargetListener(DropTargetListener dtl)
                           throws TooManyListenersException
DropTargetListener (UNICAST SOURCE).
 
dtl - The new DropTargetListener
 
TooManyListenersExceptionDropTargetListener is already added to this
 DropTarget.
TooManyListenersExceptionpublic void removeDropTargetListener(DropTargetListener dtl)
DropTargetListener (UNICAST SOURCE).
 
dtl - the DropTargetListener to deregister.public void dragEnter(DropTargetDragEvent dtde)
DropTarget intercepts 
 dragEnter() notifications before the 
 registered DropTargetListener gets them. 
 
dragEnter in interface DropTargetListenerdtde - the DropTargetDragEventpublic void dragOver(DropTargetDragEvent dtde)
DropTarget 
 intercepts dragOver() notifications before the
 registered DropTargetListener gets them.
 
dragOver in interface DropTargetListenerdtde - the DropTargetDragEventpublic void dropActionChanged(DropTargetDragEvent dtde)
DropTarget intercepts 
 dropActionChanged() notifications before the 
 registered DropTargetListener gets them.
 
dropActionChanged in interface DropTargetListenerdtde - the DropTargetDragEventpublic void dragExit(DropTargetEvent dte)
DropTarget intercepts 
 dragExit() notifications before the 
 registered DropTargetListener gets them.
 
dragExit in interface DropTargetListenerdte - the DropTargetEventpublic void drop(DropTargetDropEvent dtde)
DropTarget intercepts drop() notifications before the 
 registered DropTargetListener gets them.
 
drop in interface DropTargetListenerdtde - the DropTargetDropEventpublic FlavorMap getFlavorMap()
FlavorMap
 associated with this DropTarget.
 If no FlavorMap has been set for this
 DropTarget, it is associated with the default
 FlavorMap.
 
public void setFlavorMap(FlavorMap fm)
FlavorMap associated
 with this DropTarget.
 
fm - the new FlavorMap, or null to 
 associate the default FlavorMap with this DropTarget.public void addNotify(java.awt.peer.ComponentPeer peer)
peer - The Peer of the Component we are associated with!public void removeNotify(java.awt.peer.ComponentPeer peer)
peer - The Peer of the Component we are being disassociated from!public DropTargetContext getDropTargetContext()
DropTargetContext associated 
 with this DropTarget.
 
DropTargetContext associated with this DropTarget.protected DropTargetContext createDropTargetContext()
protected DropTarget.DropTargetAutoScroller createDropTargetAutoScroller(Component c,
                                                                         Point p)
c - the Componentp - the Pointprotected void initializeAutoscrolling(Point p)
p - the Pointprotected void updateAutoscroll(Point dragCursorLocn)
dragCursorLocn - the Pointprotected void clearAutoscroll()
| 
 | JavaTM 2 Platform Std. Ed. v1.4.2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.