APIdia Launch Partner
Top Description Fields Constructors Methods
sun.awt

public Class PaintEventDispatcher

extends Object
Class Inheritance
Known Direct Subclasses
javax.swing.SwingPaintEventDispatcher
Imports
java.awt.Component, .Rectangle, java.awt.event.PaintEvent

PaintEventDispatcher is responsible for dispatching PaintEvents. There can be only one PaintEventDispatcher active at a particular time.

Field Summary

Modifier and TypeField and Description
private static PaintEventDispatcher
dispatcher

Singleton dispatcher.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PaintEvent
createPaintEvent(Component target, int x, int y, int w, int h)

Creates and returns the PaintEvent that should be dispatched for the specified component.

public static PaintEventDispatcher

Returns:

PaintEventDispatcher
getPaintEventDispatcher
()

Returns the currently active PaintEventDispatcher.

public boolean
queueSurfaceDataReplacing(Component c, Runnable r)

This method is invoked from the toolkit thread when the surface data of the component needs to be replaced.

public static void
setPaintEventDispatcher(PaintEventDispatcher
PaintEventDispatcher
dispatcher
)

Sets the current PaintEventDispatcher.

public boolean
shouldDoNativeBackgroundErase(Component c)

Returns true if a native background erase should be done for the specified Component.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dispatcherback to summary
private static PaintEventDispatcher dispatcher

Singleton dispatcher.

Constructor Detail

PaintEventDispatcherback to summary
public PaintEventDispatcher()

Method Detail

createPaintEventback to summary
public PaintEvent createPaintEvent(Component target, int x, int y, int w, int h)

Creates and returns the PaintEvent that should be dispatched for the specified component. If this returns null no PaintEvent is dispatched.

Warning

This is invoked from the native thread, be careful what methods you end up invoking here.

getPaintEventDispatcherback to summary
public static PaintEventDispatcher getPaintEventDispatcher()

Returns the currently active PaintEventDispatcher. This will never return null.

Returns:PaintEventDispatcher

PaintEventDispatcher

queueSurfaceDataReplacingback to summary
public boolean queueSurfaceDataReplacing(Component c, Runnable r)

This method is invoked from the toolkit thread when the surface data of the component needs to be replaced. The method run() of the Runnable argument performs surface data replacing, run() should be invoked on the EDT. Returns true if the Runnable has been enqueued to be invoked on the EDT. (Fix 6255371.)

setPaintEventDispatcherback to summary
public static void setPaintEventDispatcher(PaintEventDispatcher dispatcher)

Sets the current PaintEventDispatcher.

Parameters
dispatcher:PaintEventDispatcher

PaintEventDispatcher

shouldDoNativeBackgroundEraseback to summary
public boolean shouldDoNativeBackgroundErase(Component c)

Returns true if a native background erase should be done for the specified Component.