java.awt
Class Toolkit

java.lang.Object
  |
  +--java.awt.Toolkit

public abstract class Toolkit
extends Object

An AWT toolkit. It is used to bind the abstract AWT classes to a particular native toolkit implementation.


Constructor Summary
Toolkit()
           
 
Method Summary
abstract  int checkImage(Image image, int width, int height, java.awt.image.ImageObserver observer)
          Returns the status of the construction of the indicated method at the indicated width and height for the default screen.
protected abstract  java.awt.peer.ButtonPeer createButton(Button target)
          Uses the specified Peer interface to create a new Button.
protected abstract  java.awt.peer.CanvasPeer createCanvas(Canvas target)
          Uses the specified Peer interface to create a new Canvas.
protected abstract  java.awt.peer.CheckboxPeer createCheckbox(Checkbox target)
          Uses the specified Peer interface to create a new Checkbox.
protected abstract  java.awt.peer.CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target)
          Uses the specified Peer interface to create a new CheckboxMenuItem.
protected abstract  java.awt.peer.ChoicePeer createChoice(Choice target)
          Uses the specified Peer interface to create a new Choice.
protected abstract  java.awt.peer.DialogPeer createDialog(Dialog target)
          Uses the specified Peer interface to create a new Dialog.
protected abstract  java.awt.peer.FileDialogPeer createFileDialog(FileDialog target)
          Uses the specified Peer interface to create a new FileDialog.
protected abstract  java.awt.peer.FramePeer createFrame(Frame target)
          Uses the specified Peer interface to create a new Frame.
abstract  Image createImage(java.awt.image.ImageProducer producer)
          Creates an image with the specified image producer.
protected abstract  java.awt.peer.LabelPeer createLabel(Label target)
          Uses the specified Peer interface to create a new Label.
protected abstract  java.awt.peer.ListPeer createList(List target)
          Uses the specified Peer interface to create a new List.
protected abstract  java.awt.peer.MenuPeer createMenu(Menu target)
          Uses the specified Peer interface to create a new Menu.
protected abstract  java.awt.peer.MenuBarPeer createMenuBar(MenuBar target)
          Uses the specified Peer interface to create a new MenuBar.
protected abstract  java.awt.peer.MenuItemPeer createMenuItem(MenuItem target)
          Uses the specified Peer interface to create a new MenuItem.
protected abstract  java.awt.peer.PanelPeer createPanel(Panel target)
          Uses the specified Peer interface to create a new Panel.
protected abstract  java.awt.peer.ScrollbarPeer createScrollbar(Scrollbar target)
          Uses the specified Peer interface to create a new Scrollbar.
protected abstract  java.awt.peer.TextAreaPeer createTextArea(TextArea target)
          Uses the specified Peer interface to create a new TextArea.
protected abstract  java.awt.peer.TextFieldPeer createTextField(TextField target)
          Uses the specified Peer interface to create a new TextField.
protected abstract  java.awt.peer.WindowPeer createWindow(Window target)
          Uses the specified Peer interface to create a new Window.
abstract  java.awt.image.ColorModel getColorModel()
          Returns the ColorModel of the screen.
static Toolkit getDefaultToolkit()
          Returns the default toolkit.
abstract  String[] getFontList()
          Returns the names of the available fonts.
abstract  FontMetrics getFontMetrics(Font font)
          Returns the screen metrics of the font.
abstract  Image getImage(String filename)
          Returns an image which gets pixel data from the specified file.
abstract  Image getImage(URL url)
          Returns an image which gets pixel data from the specified URL.
abstract  int getScreenResolution()
          Returns the screen resolution in dots-per-inch.
abstract  Dimension getScreenSize()
          Gets the size of the screen.
abstract  boolean prepareImage(Image image, int width, int height, java.awt.image.ImageObserver observer)
          Prepares an image for rendering on the default screen at the specified width and height.
abstract  void sync()
          Syncs the graphics state; useful when doing animation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Toolkit

public Toolkit()
Method Detail

createButton

protected abstract java.awt.peer.ButtonPeer createButton(Button target)
Uses the specified Peer interface to create a new Button.

Parameters:
target - the Button to be created

createTextField

protected abstract java.awt.peer.TextFieldPeer createTextField(TextField target)
Uses the specified Peer interface to create a new TextField.

Parameters:
target - the TextField to be created

createLabel

protected abstract java.awt.peer.LabelPeer createLabel(Label target)
Uses the specified Peer interface to create a new Label.

Parameters:
target - the Label to be created

createList

protected abstract java.awt.peer.ListPeer createList(List target)
Uses the specified Peer interface to create a new List.

Parameters:
target - the List to be created

createCheckbox

protected abstract java.awt.peer.CheckboxPeer createCheckbox(Checkbox target)
Uses the specified Peer interface to create a new Checkbox.

Parameters:
target - the Checkbox to be created

createScrollbar

protected abstract java.awt.peer.ScrollbarPeer createScrollbar(Scrollbar target)
Uses the specified Peer interface to create a new Scrollbar.

Parameters:
target - the Scrollbar to be created

createTextArea

protected abstract java.awt.peer.TextAreaPeer createTextArea(TextArea target)
Uses the specified Peer interface to create a new TextArea.

Parameters:
target - the TextArea to be created

createChoice

protected abstract java.awt.peer.ChoicePeer createChoice(Choice target)
Uses the specified Peer interface to create a new Choice.

Parameters:
target - the Choice to be created

createFrame

protected abstract java.awt.peer.FramePeer createFrame(Frame target)
Uses the specified Peer interface to create a new Frame.

Parameters:
target - the Frame to be created

createCanvas

protected abstract java.awt.peer.CanvasPeer createCanvas(Canvas target)
Uses the specified Peer interface to create a new Canvas.

Parameters:
target - the Canvas to be created

createPanel

protected abstract java.awt.peer.PanelPeer createPanel(Panel target)
Uses the specified Peer interface to create a new Panel.

Parameters:
target - the Panel to be created

createWindow

protected abstract java.awt.peer.WindowPeer createWindow(Window target)
Uses the specified Peer interface to create a new Window.

Parameters:
target - the Window to be created

createDialog

protected abstract java.awt.peer.DialogPeer createDialog(Dialog target)
Uses the specified Peer interface to create a new Dialog.

Parameters:
target - the Dialog to be created

createMenuBar

protected abstract java.awt.peer.MenuBarPeer createMenuBar(MenuBar target)
Uses the specified Peer interface to create a new MenuBar.

Parameters:
target - the MenuBar to be created

createMenu

protected abstract java.awt.peer.MenuPeer createMenu(Menu target)
Uses the specified Peer interface to create a new Menu.

Parameters:
target - the Menu to be created

createMenuItem

protected abstract java.awt.peer.MenuItemPeer createMenuItem(MenuItem target)
Uses the specified Peer interface to create a new MenuItem.

Parameters:
target - the MenuItem to be created

createFileDialog

protected abstract java.awt.peer.FileDialogPeer createFileDialog(FileDialog target)
Uses the specified Peer interface to create a new FileDialog.

Parameters:
target - the FileDialog to be created

createCheckboxMenuItem

protected abstract java.awt.peer.CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target)
Uses the specified Peer interface to create a new CheckboxMenuItem.

Parameters:
target - the CheckboxMenuItem to be created

getScreenSize

public abstract Dimension getScreenSize()
Gets the size of the screen.


getScreenResolution

public abstract int getScreenResolution()
Returns the screen resolution in dots-per-inch.


getColorModel

public abstract java.awt.image.ColorModel getColorModel()
Returns the ColorModel of the screen.


getFontList

public abstract String[] getFontList()
Returns the names of the available fonts.


getFontMetrics

public abstract FontMetrics getFontMetrics(Font font)
Returns the screen metrics of the font.


sync

public abstract void sync()
Syncs the graphics state; useful when doing animation.


getDefaultToolkit

public static Toolkit getDefaultToolkit()
Returns the default toolkit. This is controlled by the "awt.toolkit" property.

Throws:
AWTError - Toolkit not found or could not be instantiated.

getImage

public abstract Image getImage(String filename)
Returns an image which gets pixel data from the specified file.

Parameters:
filename - the file containing the pixel data in one of the recognized file formats

getImage

public abstract Image getImage(URL url)
Returns an image which gets pixel data from the specified URL.

Parameters:
url - the URL to use in fetching the pixel data

prepareImage

public abstract boolean prepareImage(Image image,
                                     int width,
                                     int height,
                                     java.awt.image.ImageObserver observer)
Prepares an image for rendering on the default screen at the specified width and height.


checkImage

public abstract int checkImage(Image image,
                               int width,
                               int height,
                               java.awt.image.ImageObserver observer)
Returns the status of the construction of the indicated method at the indicated width and height for the default screen.


createImage

public abstract Image createImage(java.awt.image.ImageProducer producer)
Creates an image with the specified image producer.

Parameters:
producer - the image producer to be used