Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.Toolkit
gnu.java.awt.ClasspathToolkit
public abstract class ClasspathToolkit
extends Toolkit
There exist some parts of AWT and Java2D that are specific to
the underlying platform, but for which the Toolkit
class
does not provide suitable abstractions. Examples include some
methods of Font
or GraphicsEnvironment
. Those
methods use ClasspathToolkit as a central place for obtaining
platform-specific functionality.
In addition, ClasspathToolkit implements some abstract methods
of Toolkit
that are not really platform-specific,
such as the maintenance of a cache of loaded images.
Thread Safety: The methods of this class may safely be
called without external synchronization. This also hold for any
inherited Toolkit
methods. Subclasses are responsible for
the necessary synchronization.
Field Summary |
Fields inherited from class java.awt.Toolkit | |
Object>() , desktopProperties , desktopPropsSupport |
Method Summary | |
protected DesktopPeer |
|
abstract EmbeddedWindowPeer |
|
abstract Font |
|
abstract RobotPeer |
|
abstract ClasspathFontPeer |
|
Font | |
abstract GraphicsEnvironment |
|
int |
|
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected DesktopPeer createDesktopPeer(Desktop target) throws HeadlessException
- Overrides:
- createDesktopPeer in interface Toolkit
public abstract EmbeddedWindowPeer createEmbeddedWindow(EmbeddedWindow w)
Creates an embedded window peer, and associates it with an EmbeddedWindow object.
- Parameters:
w
- The embedded window with which to associate a peer.
public abstract Font createFont(int format, InputStream stream)
Creates a font, reading the glyph definitions from a stream.This method provides the platform-specific implementation for the static factory method
Font.createFont(int,InputStream)
.
- Parameters:
format
- the format of the font data, such asFont.TRUETYPE_FONT
. An implementation may ignore this argument if it is able to automatically recognize the font format from the provided data.stream
- an input stream from where the font data is read in. The stream will be advanced to the position after the font data, but not closed.
- Throws:
IllegalArgumentException
- ifformat
is not supported.
public abstract RobotPeer createRobot(GraphicsDevice screen) throws AWTException
Creates a RobotPeer on a given GraphicsDevice.
public abstract ClasspathFontPeer getClasspathFontPeer(String name, Map attrs)
Acquires an appropriateClasspathFontPeer
, for use in classpath's implementation ofFont
.
- Parameters:
name
- The logical name of the font. This may be either a face name or a logical font name, or may even be null. A default implementation of name decoding is provided inClasspathFontPeer
, but may be overridden in other toolkits.attrs
- Any extraTextAttribute
attributes this font peer should have, such as size, weight, family name, or transformation.
public Font getFont(String name, Map<K,V> attrs)
Creates aFont
, in a platform-specific manner. The default implementation simply constructs aFont
, but some toolkits may wish to override this, to returnFont
subclasses which implementOpenType
orMultipleMaster
.
public abstract GraphicsEnvironment getLocalGraphicsEnvironment()
Returns a shared instance of the local, platform-specific graphics environment.This method is specific to GNU Classpath. It gets called by the Classpath implementation of
GraphicsEnvironment.getLocalGraphcisEnvironment()
.
public int getMouseNumberOfButtons()
Returns the number of mouse buttons. (used by java.awt.MouseInfo). This dummy implementation returns -1 (no mouse). toolkit implementors should overload this method if possible.
- Since:
- 1.5
public void registerImageIOSpis(IIORegistry reg)
Used to register ImageIO SPIs provided by the toolkit. Our default implementation does nothing.