APIdia Launch Partner
Top Description Fields Constructors Methods
java.awt.dnd

pack-priv Class DnDEventMulticaster

extends AWTEventMulticaster
implements DragSourceListener, DragSourceMotionListener
Class Inheritance
All Implemented Interfaces
java.awt.dnd.DragSourceMotionListener, java.util.EventListener, java.awt.dnd.DragSourceListener
Imports
java.awt.AWTEventMulticaster, java.io.ObjectOutputStream, .IOException, java.util.EventListener

A class extends AWTEventMulticaster to implement efficient and thread-safe multi-cast event dispatching for the drag-and-drop events defined in the java.awt.dnd package.
Since
1.4
See Also
AWTEventMulticaster

Field Summary

Inherited from java.awt.AWTEventMulticaster:
ab

Constructor Summary

AccessConstructor and Description
protected
DnDEventMulticaster(EventListener
listener-a
a
,
EventListener
listener-b
b
)

Creates an event multicaster instance which chains listener-a with listener-b.

Method Summary

Modifier and TypeMethod and Description
public static DragSourceListener
add(DragSourceListener
drag-source-listener-a
a
,
DragSourceListener
drag-source-listener-b
b
)

Adds drag-source-listener-a with drag-source-listener-b and returns the resulting multicast listener.

public static DragSourceMotionListener
add(DragSourceMotionListener
drag-source-motion-listener-a
a
,
DragSourceMotionListener
drag-source-motion-listener-b
b
)

Adds drag-source-motion-listener-a with drag-source-motion-listener-b and returns the resulting multicast listener.

protected static EventListener
addInternal(EventListener
event listener-a
a
,
EventListener
event listener-b
b
)

Hides java.awt.AWTEventMulticaster.addInternal.

Returns the resulting multicast listener from adding listener-a and listener-b together.

public void
dragDropEnd(DragSourceDropEvent
the DragSourceDropEvent
dsde
)

Implements java.awt.dnd.DragSourceListener.dragDropEnd.

Handles the DragSourceDropEvent by invoking dragDropEnd on listener-a and listener-b.

public void
dragEnter(DragSourceDragEvent
the DragSourceDragEvent
dsde
)

Implements java.awt.dnd.DragSourceListener.dragEnter.

Handles the DragSourceDragEvent by invoking dragEnter on listener-a and listener-b.

public void
dragExit(DragSourceEvent
the DragSourceEvent
dse
)

Implements java.awt.dnd.DragSourceListener.dragExit.

Handles the DragSourceEvent by invoking dragExit on listener-a and listener-b.

public void
dragMouseMoved(DragSourceDragEvent
the DragSourceDragEvent
dsde
)

Implements java.awt.dnd.DragSourceMotionListener.dragMouseMoved.

Handles the DragSourceDragEvent by invoking dragMouseMoved on listener-a and listener-b.

public void
dragOver(DragSourceDragEvent
the DragSourceDragEvent
dsde
)

Implements java.awt.dnd.DragSourceListener.dragOver.

Handles the DragSourceDragEvent by invoking dragOver on listener-a and listener-b.

public void
dropActionChanged(DragSourceDragEvent
the DragSourceDragEvent
dsde
)

Implements java.awt.dnd.DragSourceListener.dropActionChanged.

Handles the DragSourceDragEvent by invoking dropActionChanged on listener-a and listener-b.

public static DragSourceListener
remove(DragSourceListener
drag-source-listener-l
l
,
DragSourceListener
the drag-source-listener being removed
oldl
)

Removes the old drag-source-listener from drag-source-listener-l and returns the resulting multicast listener.

public static DragSourceMotionListener
remove(DragSourceMotionListener
drag-source-motion-listener-l
l
,
DragSourceMotionListener
the drag-source-motion-listener being removed
ol
)

Removes the old drag-source-motion-listener from drag-source-motion-listener-l and returns the resulting multicast listener.

protected EventListener
remove(EventListener
the listener to be removed
oldl
)

Overrides java.awt.AWTEventMulticaster.remove.

Removes a listener from this multicaster and returns the resulting multicast listener.

protected static EventListener
removeInternal(EventListener
the listener being removed from
l
,
EventListener
the listener being removed
oldl
)

Hides java.awt.AWTEventMulticaster.removeInternal.

Returns the resulting multicast listener after removing the old listener from listener-l.

protected static void
save(ObjectOutputStream s, String k, EventListener l)

Hides java.awt.AWTEventMulticaster.save.

Saves a Serializable listener chain to a serialization stream.

Inherited from java.awt.AWTEventMulticaster:
actionPerformedaddaddaddaddaddaddaddaddaddaddaddaddaddaddaddaddaddadjustmentValueChangedancestorMovedancestorResizedcaretPositionChangedcomponentAddedcomponentHiddencomponentMovedcomponentRemovedcomponentResizedcomponentShownfocusGainedfocusLostgetListenershierarchyChangedinputMethodTextChangeditemStateChangedkeyPressedkeyReleasedkeyTypedmouseClickedmouseDraggedmouseEnteredmouseExitedmouseMovedmousePressedmouseReleasedmouseWheelMovedremoveremoveremoveremoveremoveremoveremoveremoveremoveremoveremoveremoveremoveremoveremoveremoveremovesaveInternaltextValueChangedwindowActivatedwindowClosedwindowClosingwindowDeactivatedwindowDeiconifiedwindowGainedFocuswindowIconifiedwindowLostFocuswindowOpenedwindowStateChanged

Constructor Detail

DnDEventMulticasterback to summary
protected DnDEventMulticaster(EventListener a, EventListener b)

Creates an event multicaster instance which chains listener-a with listener-b. Input parameters a and b should not be null, though implementations may vary in choosing whether or not to throw NullPointerException in that case.

Parameters
a:EventListener

listener-a

b:EventListener

listener-b

Method Detail

addback to summary
public static DragSourceListener add(DragSourceListener a, DragSourceListener b)

Adds drag-source-listener-a with drag-source-listener-b and returns the resulting multicast listener.

Parameters
a:DragSourceListener

drag-source-listener-a

b:DragSourceListener

drag-source-listener-b

addback to summary
public static DragSourceMotionListener add(DragSourceMotionListener a, DragSourceMotionListener b)

Adds drag-source-motion-listener-a with drag-source-motion-listener-b and returns the resulting multicast listener.

Parameters
a:DragSourceMotionListener

drag-source-motion-listener-a

b:DragSourceMotionListener

drag-source-motion-listener-b

Annotations
@SuppressWarnings:overloads
addInternalback to summary
protected static EventListener addInternal(EventListener a, EventListener b)

Hides java.awt.AWTEventMulticaster.addInternal.

Returns the resulting multicast listener from adding listener-a and listener-b together. If listener-a is null, it returns listener-b; If listener-b is null, it returns listener-a If neither are null, then it creates and returns a new AWTEventMulticaster instance which chains a with b.

Parameters
a:EventListener

event listener-a

b:EventListener

event listener-b

dragDropEndback to summary
public void dragDropEnd(DragSourceDropEvent dsde)

Implements java.awt.dnd.DragSourceListener.dragDropEnd.

Handles the DragSourceDropEvent by invoking dragDropEnd on listener-a and listener-b.

Parameters
dsde:DragSourceDropEvent

the DragSourceDropEvent

dragEnterback to summary
public void dragEnter(DragSourceDragEvent dsde)

Implements java.awt.dnd.DragSourceListener.dragEnter.

Handles the DragSourceDragEvent by invoking dragEnter on listener-a and listener-b.

Parameters
dsde:DragSourceDragEvent

the DragSourceDragEvent

dragExitback to summary
public void dragExit(DragSourceEvent dse)

Implements java.awt.dnd.DragSourceListener.dragExit.

Handles the DragSourceEvent by invoking dragExit on listener-a and listener-b.

Parameters
dse:DragSourceEvent

the DragSourceEvent

dragMouseMovedback to summary
public void dragMouseMoved(DragSourceDragEvent dsde)

Implements java.awt.dnd.DragSourceMotionListener.dragMouseMoved.

Handles the DragSourceDragEvent by invoking dragMouseMoved on listener-a and listener-b.

Parameters
dsde:DragSourceDragEvent

the DragSourceDragEvent

dragOverback to summary
public void dragOver(DragSourceDragEvent dsde)

Implements java.awt.dnd.DragSourceListener.dragOver.

Handles the DragSourceDragEvent by invoking dragOver on listener-a and listener-b.

Parameters
dsde:DragSourceDragEvent

the DragSourceDragEvent

dropActionChangedback to summary
public void dropActionChanged(DragSourceDragEvent dsde)

Implements java.awt.dnd.DragSourceListener.dropActionChanged.

Handles the DragSourceDragEvent by invoking dropActionChanged on listener-a and listener-b.

Parameters
dsde:DragSourceDragEvent

the DragSourceDragEvent

removeback to summary
public static DragSourceListener remove(DragSourceListener l, DragSourceListener oldl)

Removes the old drag-source-listener from drag-source-listener-l and returns the resulting multicast listener.

Parameters
l:DragSourceListener

drag-source-listener-l

oldl:DragSourceListener

the drag-source-listener being removed

removeback to summary
public static DragSourceMotionListener remove(DragSourceMotionListener l, DragSourceMotionListener ol)

Removes the old drag-source-motion-listener from drag-source-motion-listener-l and returns the resulting multicast listener.

Parameters
l:DragSourceMotionListener

drag-source-motion-listener-l

ol:DragSourceMotionListener

the drag-source-motion-listener being removed

Annotations
@SuppressWarnings:overloads
removeback to summary
protected EventListener remove(EventListener oldl)

Overrides java.awt.AWTEventMulticaster.remove.

Removes a listener from this multicaster and returns the resulting multicast listener.

Parameters
oldl:EventListener

the listener to be removed

removeInternalback to summary
protected static EventListener removeInternal(EventListener l, EventListener oldl)

Hides java.awt.AWTEventMulticaster.removeInternal.

Returns the resulting multicast listener after removing the old listener from listener-l. If listener-l equals the old listener OR listener-l is null, returns null. Else if listener-l is an instance of AWTEventMulticaster, then it removes the old listener from it. Else, returns listener l.

Parameters
l:EventListener

the listener being removed from

oldl:EventListener

the listener being removed

saveback to summary
protected static void save(ObjectOutputStream s, String k, EventListener l) throws IOException

Hides java.awt.AWTEventMulticaster.save.

Doc from java.awt.AWTEventMulticaster.save.

Saves a Serializable listener chain to a serialization stream.

Exceptions
IOException:
if serialization fails