java::awt::Toolkit Class Reference

Inheritance diagram for java::awt::Toolkit:

Inheritance graph
java::lang::Object
[legend]
Collaboration diagram for java::awt::Toolkit:

Collaboration graph
java::lang::Object
[legend]

List of all members.


Detailed Description

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.

Version:
1.189, 01/23/03
Author:
Sami Shaio

Arthur van Hoff

Fred Ecks

Since:
JDK1.0

Public Member Functions

virtual Dimension getScreenSize () const =0
 Gets the size of the screen.
virtual jint getScreenResolution () const =0
 Returns the screen resolution in dots-per-inch.
virtual jint getMenuShortcutKeyMask () const =0
 Determines which modifier key is the appropriate accelerator key for menu shortcuts.
virtual Ref
< ComponentPeer
createNativeComponent (const Ref< Component > &target)=0
 Creates this toolkit's native implementation of Component using the specified peer interface.
virtual Ref
< MenuComponentPeer
createNativeMenuComponent (const Ref< MenuComponent > &target)=0
 Creates this toolkit's native implementation of MenuComponent using the specified peer interface.
virtual Ref< ImageloadIconResource (const String &res_name) const =0
virtual Ref< ImageloadBitmapResource (const String &res_name) const =0

Static Public Member Functions

static ToolkitgetDefaultToolkit ()
 Gets the default toolkit.

Member Function Documentation

static Toolkit& java::awt::Toolkit::getDefaultToolkit (  )  [static]

Gets the default toolkit.

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.

Also loads additional classes into the VM, using the property 'assistive_technologies' specified in the Sun reference implementation by a line in the 'accessibility.properties' file. The form is "assistive_technologies=..." where the "..." is a comma-separated list of assistive technology classes to load. Each class is loaded in the order given and a single instance of each is created using Class.forName(class).newInstance(). This is done just after the AWT toolkit is created. All errors are handled via an AWTError exception.

Returns:
the default toolkit.
Exceptions:
AWTError if a toolkit could not be found, or if one could not be accessed or instantiated.

virtual Dimension java::awt::Toolkit::getScreenSize (  )  const [pure virtual]

Gets the size of the screen.

On systems with multiple displays, the primary display is used. Multi-screen aware display dimensions are available from GraphicsConfiguration and GraphicsDevice.

Returns:
the size of this toolkit's screen, in pixels.
Exceptions:
HeadlessException if GraphicsEnvironment.isHeadless() returns true
See also:
java.awt.GraphicsConfiguration::getBounds

java.awt.GraphicsDevice::getDisplayMode

java.awt.GraphicsEnvironment::isHeadless

virtual jint java::awt::Toolkit::getScreenResolution (  )  const [pure virtual]

Returns the screen resolution in dots-per-inch.

Returns:
this toolkit's screen resolution, in dots-per-inch.
Exceptions:
HeadlessException if GraphicsEnvironment.isHeadless() returns true
See also:
java.awt.GraphicsEnvironment::isHeadless

virtual jint java::awt::Toolkit::getMenuShortcutKeyMask (  )  const [pure virtual]

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.
Exceptions:
HeadlessException if GraphicsEnvironment.isHeadless() returns true
See also:
java.awt.GraphicsEnvironment::isHeadless

java.awt.MenuBar

java.awt.MenuShortcut

Since:
JDK1.1

virtual Ref<ComponentPeer> java::awt::Toolkit::createNativeComponent ( const Ref< Component > &  target  )  [pure virtual]

Creates this toolkit's native implementation of Component using the specified peer interface.

Parameters:
target the component to be implemented.
Returns:
this toolkit's implementation of Component.
Exceptions:
HeadlessException if GraphicsEnvironment.isHeadless() returns true
See also:
java.awt.GraphicsEnvironment::isHeadless

virtual Ref<MenuComponentPeer> java::awt::Toolkit::createNativeMenuComponent ( const Ref< MenuComponent > &  target  )  [pure virtual]

Creates this toolkit's native implementation of MenuComponent using the specified peer interface.

Parameters:
target the component to be implemented.
Returns:
this toolkit's implementation of MenuComponent.
Exceptions:
HeadlessException if GraphicsEnvironment.isHeadless() returns true
See also:
java.awt.GraphicsEnvironment::isHeadless

virtual Ref<Image> java::awt::Toolkit::loadIconResource ( const String res_name  )  const [pure virtual]

virtual Ref<Image> java::awt::Toolkit::loadBitmapResource ( const String res_name  )  const [pure virtual]


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:12 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3