This class is the abstract superclass of all actual
implementations of the Abstract Window Toolkit. Subclasses of
Toolkit are used to bind the various components
to particular native toolkit implementations.
Most applications should not call any of the methods in this
class directly. The methods defined by Toolkit are
the "glue" that joins the platform-independent classes in the
java.awt package with their counterparts in
java.awt.peer. Some methods defined by
Toolkit query the native operating system directly.
Creates a peer for a component or container. This peer is windowless
and allows the Component and Container classes to be extended directly
to create windowless components that are defined entirely in java.
Determines the color model of this toolkit's screen.
ColorModel is an abstract class that
encapsulates the ability to translate between the
pixel values of an image and its red, green, blue,
and alpha components.
This toolkit method is called by the
getColorModel method
of the Component class.
Returns the names of the available fonts in this toolkit.
For 1.1, the following font names are deprecated (the replacement
name follows):
TimesRoman (use Serif)
Helvetica (use SansSerif)
Courier (use Monospaced)
The ZapfDingbats font is also deprecated in 1.1, but only as a
separate fontname. Unicode defines the ZapfDingbat characters
starting at ?, and as of 1.1 Java supports those characters.
If there is a system property named "awt.toolkit",
that property is treated as the name of a class that is a subclass
of Toolkit.
If the system property does not exist, then the default toolkit
used is the class named "sun.awt.motif.MToolkit",
which is a motif implementation of the Abstract Window Toolkit.
public abstract boolean prepareImage(Image image,
int width,
int height,
ImageObserver observer)
Prepares an image for rendering.
If the values of the width and height arguments are both
-1, this method prepares the image for rendering
on the default screen; otherwise, this method prepares an image
for rendering on the default screen at the specified width and height.
The image data is downloaded asynchronously in another thread,
and an appropriately scaled screen representation of the image is
generated.
This method is called by components prepareImage
methods.
Information on the flags returned by this method can be found
with the definition of the ImageObserver interface.
Parameters:
image - the image for which to prepare a
screen representation.
width - the width of the desired screen
representation, or -1.
height - the height of the desired screen
representation, or -1.
observer - the ImageObserver
object to be notified as the
image is being prepared.
Returns:
true if the image has already been
fully prepared; false otherwise.
public abstract int checkImage(Image image,
int width,
int height,
ImageObserver observer)
Indicates the construction status of a specified image that is
being prepared for display.
If the values of the width and height arguments are both
-1, this method returns the construction status of
a screen representation of the specified image in this toolkit.
Otherwise, this method returns the construction status of a
scaled representation of the image at the specified width
and height.
This method does not cause the image to begin loading.
An application must call prepareImage to force
the loading of an image.
This method is called by the component's checkImage
methods.
Information on the flags returned by this method can be found
with the definition of the ImageObserver interface.
Parameters:
image - the image whose status is being checked.
width - the width of the scaled version whose status is
being checked, or -1.
height - the height of the scaled version whose status
is being checked, or -1.
observer - the ImageObserver object to be
notified as the image is being prepared.
Returns:
the bitwise inclusive OR of the
ImageObserver flags for the
image data that is currently available.
public abstract Image createImage(byte imagedata[],
int imageoffset,
int imagelength)
Creates an image which decodes the image stored in the specified
byte array, and at the specified offset and length.
The data must be in some image format, such as GIF or JPEG,
that is supported by this toolkit.
Parameters:
imagedata - an array of bytes, representing
image data in a supported image format.
imageoffset - the offset of the beginning
of the data in the array.
imagelength - the length of the data in the array.
Determines which modifier key is the appropriate accelerator
key for menu shortcuts.
Menu shortcuts, which are embodied in the
MenuShortcut class, are handled by the
MenuBar class.
By default, this method returns Event.CTRL_MASK.
Toolkit implementations should override this method if the
Control key isn't the correct key for accelerators.
Returns:
the modifier mask on the Event class
that is used for menu shortcuts on this toolkit.
Get the application's or applet's EventQueue instance.
Depending on the Toolkit implementation, different EventQueues
may be returned for different applets. Applets should
therefore not assume that the EventQueue instance returned
by this method will be shared by other applets or the system.
Submit a bug or feature - Version 1.1.8 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1995-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.