Disables erasing of background on the canvas before painting if
this is supported by the current toolkit. It is recommended to
call this method early, before the Canvas becomes displayable,
because some Toolkit implementations do not support changing
this property once the Canvas becomes displayable.

Disables the native erasing of the background on the given
component before painting if this is supported by the current
toolkit. This only has an effect for certain components such as
Canvas, Panel and Window. It is recommended to call this method
early, before the Component becomes displayable, because some
Toolkit implementations do not support changing this property
once the Component becomes displayable.

Gives native peers the ability to query the closest HW component.
If the given component is heavyweight, then it returns this. Otherwise,
it goes one level up in the hierarchy and tests next component.

Grabs the mouse input for the given window. The window must be
visible. The window or its children do not receive any
additional mouse events besides those targeted to them. All
other events will be dispatched as before - to the respective
targets. This Window will receive UngrabEvent when automatic
ungrab is about to happen. The event can be listened to by
installing AWTEventListener with WINDOW_EVENT_MASK. See
UngrabEvent class for the list of conditions when ungrab is
about to happen.

Checks that the given object implements/extends the given
interface/class.
Note that using the instanceof operator causes a class to be loaded.
Using this method doesn't load a class and it can be used instead of
the instanceof operator for performance reasons.

Returns whether the native system requires using the peer.updateWindow()
method to update the contents of a non-opaque window, or if usual
painting procedures are sufficient. The default return value covers
the X11 systems. On MS Windows this method is overriden in WToolkit
to return true.

{
if (EventQueue.isDispatchThread()) {
throw new IllegalThreadException("The SunToolkit.realSync() method cannot be used on the event dispatch thread (EDT).");
}
int bigLoop = 0;
do {
// Let's do sync first
sync();
// During the wait process, when we were processing incoming
// events, we could have made some new request, which can
// generate new events. Example: MapNotify/XSetInputFocus.
// Therefore, we dispatch them as long as there is something
// to dispatch.
int iters = 0;
while (iters < MIN_ITERS) {
syncNativeQueue(timeout);
iters++;
}
while (syncNativeQueue(timeout) && iters < MAX_ITERS) {
iters++;
}
if (iters >= MAX_ITERS) {
throw new InfiniteLoop();
}
// native requests were dispatched by X/Window Manager or Windows
// Moreover, we processed them all on Toolkit thread
// Now wait while EDT processes them.
//
// During processing of some events (focus, for example),
// some other events could have been generated. So, after
// waitForIdle, we may end up with full EventQueue
iters = 0;
while (iters < MIN_ITERS) {
waitForIdle(timeout);
iters++;
}
while (waitForIdle(timeout) && iters < MAX_ITERS) {
iters++;
}
if (iters >= MAX_ITERS) {
throw new InfiniteLoop();
}
bigLoop++;
// Again, for Java events, it was simple to check for new Java
// events by checking event queue, but what if Java events
// resulted in native requests? Therefor, check native events again.
} while ((syncNativeQueue(timeout) || waitForIdle(timeout)) && bigLoop < MAX_ITERS);
}

Forces toolkit to synchronize with the native windowing
sub-system, flushing all pending work and waiting for all the
events to be processed. This method guarantees that after
return no additional Java events will be generated, unless
cause by user. Obviously, the method cannot be used on the
event dispatch thread (EDT). In case it nevertheless gets
invoked on this thread, the method throws the
IllegalThreadException runtime exception.

Notice that realSync isn't guaranteed to work if recurring
actions occur, such as if during processing of some event
another request which may generate some events occurs. By
default, sync tries to perform as much as {@value MAX_ITERS}
cycles of event processing, allowing for roughly {@value
MAX_ITERS} additional requests.

For example, requestFocus() generates native request, which
generates one or two Java focus events, which then generate a
serie of paint events, a serie of Java focus events, which then
generate a serie of paint events which then are processed -
three cycles, minimum.

Sets the synchronous status of focus requests on lightweight
components in the specified window to the specified value.
If the boolean parameter is true then the focus
requests on lightweight components will be performed
synchronously, if it is false, then asynchronously.
By default, all windows have their lightweight request status
set to asynchronous.

The application can only set the status of lightweight focus
requests to synchronous for any of its windows if it doesn't
perform focus transfers between different heavyweight containers.
In this case the observable focus behaviour is the same as with
asynchronous status.

If the application performs focus transfer between different
heavyweight containers and sets the lightweight focus request
status to synchronous for any of its windows, then further focus
behaviour is unspecified.

Platform toolkits need to implement this method to perform the
sync of the native queue. The method should wait until native
requests are processed, all native events are processed and
corresponding Java events are generated. Should return
true if some events were processed,
false otherwise.

Waits for the Java event queue to empty. Ensures that all
events are processed (including paint events), and that if
recursive events were generated, they are also processed.
Should return true if more processing is
necessary, false otherwise.