API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. Toolkit View Source
Author(s)
Sami Shaio
Arthur van Hoff
Fred Ecks
Since
JDK1.0
Version
1.203, 12/19/03
Serial
Hierarchy
 Object
      Toolkit
Implements
Subclasses
Description
publicabstract abstract class Toolkit
  This class is the abstract superclass of all actual implementations of the Abstract Window Toolkit.
See also:   
Constructors
public Toolkit ()
Methods
Hide/Show inherited methods
public void addAWTEventListener (AWTEventListener listener, long eventMask)
  Adds an AWTEventListener to receive all AWTEvents dispatched system-wide that conform to the given eventMask.
publicsynchronized void addPropertyChangeListener (String name, PropertyChangeListener pcl)
  Adds the specified property change listener for the named desktop property.
publicabstract void beep ()
  Emits an audio beep.
publicabstract int checkImage (Image image, int width, int height, ImageObserver observer)
  Indicates the construction status of a specified image that is being prepared for display.
pack-privatesynchronized int countAWTEventListeners (long eventMask)
protectedabstract ButtonPeer createButton (Button target) throws HeadlessException
  Creates this toolkit's implementation of Button using the specified peer interface.
protectedabstract CanvasPeer createCanvas (Canvas target)
  Creates this toolkit's implementation of Canvas using the specified peer interface.
protectedabstract CheckboxPeer createCheckbox (Checkbox target) throws HeadlessException
  Creates this toolkit's implementation of Checkbox using the specified peer interface.
protectedabstract CheckboxMenuItemPeer createCheckboxMenuItem (CheckboxMenuItem target) throws HeadlessException
  Creates this toolkit's implementation of CheckboxMenuItem using the specified peer interface.
protectedabstract ChoicePeer createChoice (Choice target) throws HeadlessException
  Creates this toolkit's implementation of Choice using the specified peer interface.
protected LightweightPeer createComponent (Component target)
  Creates a peer for a component or container.
public Cursor createCustomCursor (Image cursor, Point hotSpot, String name) throws IndexOutOfBoundsException HeadlessException
  Creates a new custom cursor object.
protectedabstract DesktopPeer createDesktopPeer (Desktop target) throws HeadlessException
  Creates this toolkit's implementation of the Desktop using the specified peer interface.
protectedabstract DialogPeer createDialog (Dialog target) throws HeadlessException
  Creates this toolkit's implementation of Dialog using the specified peer interface.
public T createDragGestureRecognizer (Class< T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)
  Creates a concrete, platform dependent, subclass of the abstract DragGestureRecognizer class requested, and associates it with the DragSource, Component and DragGestureListener specified.
publicabstract DragSourceContextPeer createDragSourceContextPeer (DragGestureEvent dge) throws InvalidDnDOperationException
  Creates the peer for a DragSourceContext.
protectedabstract FileDialogPeer createFileDialog (FileDialog target) throws HeadlessException
  Creates this toolkit's implementation of FileDialog using the specified peer interface.
protectedabstract FramePeer createFrame (Frame target) throws HeadlessException
  Creates this toolkit's implementation of Frame using the specified peer interface.
public Image createImage (byte[] imagedata)
  Creates an image which decodes the image stored in the specified byte array.
publicabstract 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.
publicabstract Image createImage (ImageProducer producer)
  Creates an image with the specified image producer.
publicabstract Image createImage (String filename)
  Returns an image which gets pixel data from the specified file.
publicabstract Image createImage (URL url)
  Returns an image which gets pixel data from the specified URL.
protectedabstract LabelPeer createLabel (Label target) throws HeadlessException
  Creates this toolkit's implementation of Label using the specified peer interface.
protectedabstract ListPeer createList (List target) throws HeadlessException
  Creates this toolkit's implementation of List using the specified peer interface.
protectedabstract MenuPeer createMenu (Menu target) throws HeadlessException
  Creates this toolkit's implementation of Menu using the specified peer interface.
protectedabstract MenuBarPeer createMenuBar (MenuBar target) throws HeadlessException
  Creates this toolkit's implementation of MenuBar using the specified peer interface.
protectedabstract MenuItemPeer createMenuItem (MenuItem target) throws HeadlessException
  Creates this toolkit's implementation of MenuItem using the specified peer interface.
protectedabstract PanelPeer createPanel (Panel target)
  Creates this toolkit's implementation of Panel using the specified peer interface.
protectedabstract PopupMenuPeer createPopupMenu (PopupMenu target) throws HeadlessException
  Creates this toolkit's implementation of PopupMenu using the specified peer interface.
protectedabstract ScrollbarPeer createScrollbar (Scrollbar target) throws HeadlessException
  Creates this toolkit's implementation of Scrollbar using the specified peer interface.
protectedabstract ScrollPanePeer createScrollPane (ScrollPane target) throws HeadlessException
  Creates this toolkit's implementation of ScrollPane using the specified peer interface.
protectedabstract TextAreaPeer createTextArea (TextArea target) throws HeadlessException
  Creates this toolkit's implementation of TextArea using the specified peer interface.
protectedabstract TextFieldPeer createTextField (TextField target) throws HeadlessException
  Creates this toolkit's implementation of TextField using the specified peer interface.
protectedabstract WindowPeer createWindow (Window target) throws HeadlessException
  Creates this toolkit's implementation of Window using the specified peer interface.
pack-privatestatic boolean enabledOnToolkit (long eventMask)
public AWTEventListener getAWTEventListeners ()
  Returns an array of all the AWTEventListeners registered on this toolkit.
public AWTEventListener getAWTEventListeners (long eventMask)
  Returns an array of all the AWTEventListeners registered on this toolkit which listen to all of the event types specified in the eventMask argument.
public Dimension getBestCursorSize (int preferredWidth, int preferredHeight) throws HeadlessException
  Returns the supported cursor dimension which is closest to the desired sizes.
publicabstract ColorModel getColorModel () throws HeadlessException
  Determines the color model of this toolkit's screen.
publicstaticsynchronized Toolkit getDefaultToolkit ()
  Gets the default toolkit.
publicfinalsynchronized Object getDesktopProperty (String propertyName)
  Obtains a value for the specified desktop property.
pack-privatestatic EventQueue getEventQueue ()
@Deprecated
publicabstract String getFontList ()
  Returns the names of the available fonts in this toolkit.
@Deprecated
publicabstract FontMetrics getFontMetrics (Font font)
  Gets the screen device metrics for rendering of the font.
@Deprecated
protectedabstract FontPeer getFontPeer (String name, int style)
  Creates this toolkit's implementation of Font using the specified peer interface.
publicabstract Image getImage (String filename)
  Returns an image which gets pixel data from the specified file, whose format can be either GIF, JPEG or PNG.
publicabstract Image getImage (URL url)
  Returns an image which gets pixel data from the specified URL.
public boolean getLockingKeyState (int keyCode) throws UnsupportedOperationException
  Returns whether the given locking key on the keyboard is currently in its "on" state.
public int getMaximumCursorColors () throws HeadlessException
  Returns the maximum number of colors the Toolkit supports in a custom cursor palette.
public int getMenuShortcutKeyMask () throws HeadlessException
  Determines which modifier key is the appropriate accelerator key for menu shortcuts.
protected MouseInfoPeer getMouseInfoPeer ()
  Obtains this toolkit's implementation of helper class for MouseInfo operations.
protectedstatic Container getNativeContainer (Component c)
Give native peers the ability to query the native container given a native component (eg the direct parent may be lightweight).
public PrintJob getPrintJob (Frame frame, String jobtitle, JobAttributes jobAttributes, PageAttributes pageAttributes)
  Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.
publicabstract PrintJob getPrintJob (Frame frame, String jobtitle, Properties props)
  Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.
publicstatic String getProperty (String key, String defaultValue)
  Gets a property with the specified key and default.
public PropertyChangeListener getPropertyChangeListeners ()
  Returns an array of all the property change listeners registered on this toolkit.
publicsynchronized PropertyChangeListener getPropertyChangeListeners (String propertyName)
  Returns an array of all the PropertyChangeListeners associated with the named property.
public Insets getScreenInsets (GraphicsConfiguration gc) throws HeadlessException
  Gets the insets of the screen.
publicabstract int getScreenResolution () throws HeadlessException
  Returns the screen resolution in dots-per-inch.
publicabstract Dimension getScreenSize () throws HeadlessException
  Gets the size of the screen.
publicabstract Clipboard getSystemClipboard () throws HeadlessException
  Gets the singleton instance of the system Clipboard which interfaces with clipboard facilities provided by the native platform.
publicfinal EventQueue getSystemEventQueue ()
  Get the application's or applet's EventQueue instance.
protectedabstract EventQueue getSystemEventQueueImpl ()
  Gets the application's or applet's EventQueue instance, without checking access.
public Clipboard getSystemSelection () throws HeadlessException
  Gets the singleton instance of the system selection as a Clipboard object.
protected void initializeDesktopProperties ()
initializeDesktopProperties
public boolean isAlwaysOnTopSupported ()
  Returns whether the always-on-top mode is supported by this toolkit.
public boolean isDynamicLayoutActive () throws HeadlessException
  Returns whether dynamic layout of Containers on resize is currently active (both set programmatically, and supported by the underlying operating system and/or window manager).
protected boolean isDynamicLayoutSet () throws HeadlessException
  Returns whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete.
public boolean isFrameStateSupported (int state) throws HeadlessException
  Returns whether Toolkit supports this state for Frames.
publicabstract boolean isModalExclusionTypeSupported (ModalExclusionType modalExclusionType)
  Returns whether the given modal exclusion type is supported by this toolkit.
publicabstract boolean isModalityTypeSupported (ModalityType modalityType)
  Returns whether the given modality type is supported by this toolkit.
protected Object lazilyLoadDesktopProperty (String name)
an opportunity to lazily evaluate desktop property values.
pack-privatestatic void loadLibraries ()
protected void loadSystemColors (int[] systemColors) throws HeadlessException
  Fills in the integer array that is supplied as an argument with the current system color values.
publicabstract Map<TextAttribute, Object> mapInputMethodHighlight (InputMethodHighlight highlight) throws HeadlessException
  Returns a map of visual attributes for the abstract level description of the given input method highlight, or null if no mapping is found.
pack-private void notifyAWTEventListeners (AWTEvent theEvent)
publicabstract boolean prepareImage (Image image, int width, int height, ImageObserver observer)
  Prepares an image for rendering.
public void removeAWTEventListener (AWTEventListener listener)
  Removes an AWTEventListener from receiving dispatched AWTEvents.
publicsynchronized void removePropertyChangeListener (String name, PropertyChangeListener pcl)
  Removes the specified property change listener for the named desktop property.
protectedfinal void setDesktopProperty (String name, Object newValue)
Sets the named desktop property to the specified value and fires a property change event to notify any listeners that the value has changed.
public void setDynamicLayout (boolean dynamic) throws HeadlessException
  Controls whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete.
public void setLockingKeyState (int keyCode, boolean on) throws UnsupportedOperationException
  Sets the state of the given locking key on the keyboard.
publicabstract void sync ()
  Synchronizes this toolkit's graphics state.
Fields
Hide/Show inherited fields
protectedfinal Map<String, Object> desktopProperties
protectedfinal PropertyChangeSupport desktopPropsSupport
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar