java.awt.dnd

Class DropTarget

public class DropTarget extends Object implements DropTargetListener, EventListener, Serializable

Since: 1.2

Nested Class Summary
protected static classDropTarget.DropTargetAutoScroller
Constructor Summary
DropTarget()
Creates a DropTarget object.
DropTarget(Component c, DropTargetListener dtl)
Creates a DropTarget object.
DropTarget(Component c, int i, DropTargetListener dtl)
Creates a DropTarget object.
DropTarget(Component c, int i, DropTargetListener dtl, boolean b)
Creates a DropTarget object.
DropTarget(Component c, int i, DropTargetListener dtl, boolean b, FlavorMap fm)
Creates a DropTarget object.
Method Summary
voidaddDropTargetListener(DropTargetListener dtl)
Adds a new DropTargetListener.
voidaddNotify(ComponentPeer p)
protected voidclearAutoscroll()
protected DropTarget.DropTargetAutoScrollercreateDropTargetAutoScroller(Component c, Point p)
protected DropTargetContextcreateDropTargetContext()
voiddragEnter(DropTargetDragEvent dtde)
voiddragExit(DropTargetEvent dte)
voiddragOver(DropTargetDragEvent dtde)
voiddrop(DropTargetDropEvent dtde)
voiddropActionChanged(DropTargetDragEvent dtde)
ComponentgetComponent()
Returns the component associated with this drop target object.
intgetDefaultActions()
Returns the default actions.
DropTargetContextgetDropTargetContext()
FlavorMapgetFlavorMap()
protected voidinitializeAutoscrolling(Point p)
booleanisActive()
voidremoveDropTargetListener(DropTargetListener dtl)
voidremoveNotify(ComponentPeer p)
voidsetActive(boolean active)
voidsetComponent(Component c)
Sets the component associated with this drop target object.
voidsetDefaultActions(int ops)
Sets the default actions.
voidsetFlavorMap(FlavorMap fm)
protected voidupdateAutoscroll(Point dragCursorLocn)

Constructor Detail

DropTarget

public DropTarget()
Creates a DropTarget object.

Throws: HeadlessException If GraphicsEnvironment.isHeadless() returns true.

DropTarget

public DropTarget(Component c, DropTargetListener dtl)
Creates a DropTarget object.

Throws: HeadlessException If GraphicsEnvironment.isHeadless() returns true.

DropTarget

public DropTarget(Component c, int i, DropTargetListener dtl)
Creates a DropTarget object.

Throws: HeadlessException If GraphicsEnvironment.isHeadless() returns true.

DropTarget

public DropTarget(Component c, int i, DropTargetListener dtl, boolean b)
Creates a DropTarget object.

Throws: HeadlessException If GraphicsEnvironment.isHeadless() returns true.

DropTarget

public DropTarget(Component c, int i, DropTargetListener dtl, boolean b, FlavorMap fm)
Creates a DropTarget object.

Throws: HeadlessException If GraphicsEnvironment.isHeadless() returns true.

Method Detail

addDropTargetListener

public void addDropTargetListener(DropTargetListener dtl)
Adds a new DropTargetListener.

Throws: TooManyListenersException Sun's JDK does not, despite documentation, throw this exception here when you install an additional DropTargetListener. So to be compatible, we do the same thing.

addNotify

public void addNotify(ComponentPeer p)

clearAutoscroll

protected void clearAutoscroll()

createDropTargetAutoScroller

protected DropTarget.DropTargetAutoScroller createDropTargetAutoScroller(Component c, Point p)

createDropTargetContext

protected DropTargetContext createDropTargetContext()

dragEnter

public void dragEnter(DropTargetDragEvent dtde)

dragExit

public void dragExit(DropTargetEvent dte)

dragOver

public void dragOver(DropTargetDragEvent dtde)

drop

public void drop(DropTargetDropEvent dtde)

dropActionChanged

public void dropActionChanged(DropTargetDragEvent dtde)

getComponent

public Component getComponent()
Returns the component associated with this drop target object.

getDefaultActions

public int getDefaultActions()
Returns the default actions.

getDropTargetContext

public DropTargetContext getDropTargetContext()

getFlavorMap

public FlavorMap getFlavorMap()

initializeAutoscrolling

protected void initializeAutoscrolling(Point p)

isActive

public boolean isActive()

removeDropTargetListener

public void removeDropTargetListener(DropTargetListener dtl)

removeNotify

public void removeNotify(ComponentPeer p)

setActive

public void setActive(boolean active)

setComponent

public void setComponent(Component c)
Sets the component associated with this drop target object.

setDefaultActions

public void setDefaultActions(int ops)
Sets the default actions.

setFlavorMap

public void setFlavorMap(FlavorMap fm)

updateAutoscroll

protected void updateAutoscroll(Point dragCursorLocn)