APIdia Launch Partner
Top Description Fields Constructors Methods
java.awt

pack-priv Class LightweightDispatcher

Located in compilation unit of java.awt.Container.

extends Object
implements Serializable, AWTEventListener
Class Inheritance
All Implemented Interfaces
java.awt.event.AWTEventListener, java.util.EventListener, java.io.Serializable

Class to manage the dispatching of MouseEvents to the lightweight descendants and SunDropTargetEvents to both lightweight and heavyweight descendants contained by a native container.

Note

the class name is not appropriate anymore, but we cannot change it because we must keep serialization compatibility.

Author
Timothy Prinzing

Field Summary

Modifier and TypeField and Description
private static final int
private static final PlatformLogger
private long
eventMask

The event mask for contained lightweight components.

private Component
focus

This variable is not used, but kept for serialization compatibility

private transient boolean
isMouseDTInNativeContainer

Is DnD over the native container.

private transient boolean
isMouseInNativeContainer

Is the mouse over the native container.

private static final int
private static final long
private transient WeakReference<Component>
mouseEventTarget

The current subcomponent being hosted by this windowed component that has events being forwarded to it.

private Container
nativeContainer

The windowed container that might be hosting events for subcomponents.

private Cursor
nativeCursor

This variable is not used, but kept for serialization compatibility

private static final long
PROXY_EVENT_MASK

The kind of events routed to lightweight components from windowed hosts.

private static final long
serialVersionUID

Use serialVersionUID from JDK 1.1 for interoperability.

private transient WeakReference<Component>
targetLastEntered

The last component entered by the MouseEvent.

private transient WeakReference<Component>
targetLastEnteredDT

The last component entered by the SunDropTargetEvent.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
dispatchEvent(AWTEvent
the event
e
)

Dispatches an event to a sub-component if necessary, and returns whether or not the event was forwarded to a sub-component.

pack-priv void
pack-priv void
enableEvents(long events)

Enables events to subcomponents.

public void
eventDispatched(AWTEvent e)

Implements java.awt.event.AWTEventListener.eventDispatched.

Invoked when an event is dispatched in the AWT.

private boolean
private boolean
private boolean
processMouseEvent(MouseEvent e)

This method attempts to distribute a mouse event to a lightweight component.

private Component
retargetMouseEnterExit(Component targetOver, MouseEvent e, Component lastEntered, boolean inNativeContainer)

pack-priv void
retargetMouseEvent(Component target, int id, MouseEvent e)

Sends a mouse event to the current mouse event recipient using the given event (sent to the windowed host) as a srcEvent.

private void
private void
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BUTTONS_DOWN_MASKback to summary
private static final int BUTTONS_DOWN_MASK
eventLogback to summary
private static final PlatformLogger eventLog
eventMaskback to summary
private long eventMask

The event mask for contained lightweight components. Lightweight components need a windowed container to host window-related events. This separate mask indicates events that have been requested by contained lightweight components without effecting the mask of the windowed component itself.

focusback to summary
private Component focus

This variable is not used, but kept for serialization compatibility

isMouseDTInNativeContainerback to summary
private transient boolean isMouseDTInNativeContainer

Is DnD over the native container.

isMouseInNativeContainerback to summary
private transient boolean isMouseInNativeContainer

Is the mouse over the native container.

LWD_MOUSE_DRAGGED_OVERback to summary
private static final int LWD_MOUSE_DRAGGED_OVER
MOUSE_MASKback to summary
private static final long MOUSE_MASK
mouseEventTargetback to summary
private transient WeakReference<Component> mouseEventTarget

The current subcomponent being hosted by this windowed component that has events being forwarded to it. If this is null, there are currently no events being forwarded to a subcomponent.

nativeContainerback to summary
private Container nativeContainer

The windowed container that might be hosting events for subcomponents.

nativeCursorback to summary
private Cursor nativeCursor

This variable is not used, but kept for serialization compatibility

PROXY_EVENT_MASKback to summary
private static final long PROXY_EVENT_MASK

The kind of events routed to lightweight components from windowed hosts.

serialVersionUIDback to summary
private static final long serialVersionUID

Use serialVersionUID from JDK 1.1 for interoperability.

Annotations
@Serial
targetLastEnteredback to summary
private transient WeakReference<Component> targetLastEntered

The last component entered by the MouseEvent.

targetLastEnteredDTback to summary
private transient WeakReference<Component> targetLastEnteredDT

The last component entered by the SunDropTargetEvent.

Constructor Detail

LightweightDispatcherback to summary
pack-priv LightweightDispatcher(Container nativeContainer)

Method Detail

dispatchEventback to summary
pack-priv boolean dispatchEvent(AWTEvent e)

Dispatches an event to a sub-component if necessary, and returns whether or not the event was forwarded to a sub-component.

Parameters
e:AWTEvent

the event

disposeback to summary
pack-priv void dispose()
enableEventsback to summary
pack-priv void enableEvents(long events)

Enables events to subcomponents.

eventDispatchedback to summary
public void eventDispatched(AWTEvent e)

Implements java.awt.event.AWTEventListener.eventDispatched.

Doc from java.awt.event.AWTEventListener.eventDispatched.

Invoked when an event is dispatched in the AWT.

Annotations
@SuppressWarnings:deprecation
isMouseGrabback to summary
private boolean isMouseGrab(MouseEvent e)
processDropTargetEventback to summary
private boolean processDropTargetEvent(SunDropTargetEvent e)
processMouseEventback to summary
private boolean processMouseEvent(MouseEvent e)

This method attempts to distribute a mouse event to a lightweight component. It tries to avoid doing any unnecessary probes down into the component tree to minimize the overhead of determining where to route the event, since mouse movement events tend to come in large and frequent amounts.

retargetMouseEnterExitback to summary
private Component retargetMouseEnterExit(Component targetOver, MouseEvent e, Component lastEntered, boolean inNativeContainer)
retargetMouseEventback to summary
pack-priv void retargetMouseEvent(Component target, int id, MouseEvent e)

Sends a mouse event to the current mouse event recipient using the given event (sent to the windowed host) as a srcEvent. If the mouse event target is still in the component tree, the coordinates of the event are translated to those of the target. If the target has been removed, we don't bother to send the message.

Annotations
@SuppressWarnings:deprecation
startListeningForOtherDragsback to summary
private void startListeningForOtherDrags()
stopListeningForOtherDragsback to summary
private void stopListeningForOtherDrags()
trackDropTargetEnterExitback to summary
private void trackDropTargetEnterExit(Component targetOver, MouseEvent e)
trackMouseEnterExitback to summary
private void trackMouseEnterExit(Component targetOver, MouseEvent e)