| Modifier and Type | Field and Description |
|---|---|
| private ComponentFactory | |
| private static final KeyboardFocusManagerPeer | |
| private final Toolkit |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAWTEventListener(AWTEventListener listener, long eventMask)
Overrides java. Adds an AWTEventListener to receive all AWTEvents dispatched
system-wide that conform to the given |
| public void | addPropertyChangeListener(String name, PropertyChangeListener pcl)
Overrides java. Adds the specified property change listener for the named desktop property. |
| public boolean | areExtraMouseButtonsEnabled()
Overrides java. Reports whether events from extra mouse buttons are allowed to be processed and posted into
|
| public void | beep()
Implements abstract java. Emits an audio beep depending on native system settings and hardware capabilities. |
| public int | checkImage(Image img, int w, int h, ImageObserver o)
Implements abstract java. Indicates the construction status of a specified image that is being prepared for display. |
| public Cursor | createCustomCursor(Image cursor, Point hotSpot, String name)
Overrides java. Creates a new custom cursor object. |
| public <T extends DragGestureRecognizer> T | createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)
Overrides java. Creates a concrete, platform dependent, subclass of the abstract DragGestureRecognizer class requested, and associates it with the DragSource, Component and DragGestureListener specified. |
| public Image | createImage(String filename)
Implements abstract java. Returns an image which gets pixel data from the specified file. |
| public Image | createImage(URL url)
Implements abstract java. Returns an image which gets pixel data from the specified URL. |
| public Image | createImage(byte[] data, int offset, int length)
Implements abstract java. Creates an image which decodes the image stored in the specified byte array, and at the specified offset and length. |
| public Image | createImage(ImageProducer producer)
Implements abstract java. Creates an image with the specified image producer. |
| public Image | createImage(byte[] imagedata)
Overrides java. Creates an image which decodes the image stored in the specified byte array. |
| public SystemTrayPeer | |
| public TrayIconPeer | |
| public AWTEventListener[] | getAWTEventListeners()
Overrides java. Returns an array of all the |
| public AWTEventListener[] | getAWTEventListeners(long eventMask)
Overrides java. Returns an array of all the |
| public Dimension | getBestCursorSize(int preferredWidth, int preferredHeight)
Overrides java. Returns the supported cursor dimension which is closest to the desired sizes. |
| public ColorModel | getColorModel()
Implements abstract java. Determines the color model of this toolkit's screen. |
| public String[] | getFontList()
Implements abstract java. Returns the names of the available fonts in this toolkit. |
| public FontMetrics | getFontMetrics(Font font)
Implements abstract java. Gets the screen device metrics for rendering of the font. |
| public FontPeer | getFontPeer(String name, int style)
Overrides default sun. Creates this toolkit's implementation of |
| public GlobalCursorManager | |
| public Image | getImage(String filename)
Implements abstract java. Returns an image which gets pixel data from the specified file, whose format can be either GIF, JPEG or PNG. |
| public Image | getImage(URL url)
Implements abstract java. Returns an image which gets pixel data from the specified URL. |
| public KeyboardFocusManagerPeer | getKeyboardFocusManagerPeer()
Implements sun. Gets a singleton KeyboardFocusManagerPeer instance. |
| public boolean | getLockingKeyState(int keyCode)
Overrides java. Returns whether the given locking key on the keyboard is currently in its "on" state. |
| public int | getMaximumCursorColors()
Overrides java. Returns the maximum number of colors the Toolkit supports in a custom cursor palette. |
| public int | getMenuShortcutKeyMask()
Overrides java.
Deprecated
since 10.
Determines which modifier key is the appropriate accelerator key for menu shortcuts. |
| public int | getMenuShortcutKeyMaskEx()
Overrides java. Determines which extended modifier key is the appropriate accelerator key for menu shortcuts. |
| public PrintJob | getPrintJob(Frame frame, String jobtitle, JobAttributes jobAttributes, PageAttributes pageAttributes)
Overrides java. Gets a |
| public PrintJob | getPrintJob(Frame frame, String doctitle, Properties props)
Implements abstract java. Gets a |
| public Insets | getScreenInsets(GraphicsConfiguration gc)
Overrides java. Gets the insets of the screen. |
| public int | getScreenResolution()
Implements abstract java. Returns the screen resolution in dots-per-inch. |
| public Dimension | |
| public Clipboard | getSystemClipboard()
Implements abstract java. Gets the singleton instance of the system Clipboard which interfaces with clipboard facilities provided by the native platform. |
| public EventQueue | getSystemEventQueueImpl()
Implements abstract java. A method used by toolkit subclasses to get the |
| public Toolkit | |
| public boolean | isAlwaysOnTopSupported()
Overrides java. Returns whether the always-on-top mode is supported by this toolkit. |
| public boolean | |
| public boolean | isDynamicLayoutActive()
Overrides java. Returns whether dynamic layout of Containers on resize is currently enabled on the underlying operating system and/or window manager. |
| protected boolean | isDynamicLayoutSet()
Overrides java. Returns whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete. |
| public boolean | isModalExclusionTypeSupported(Dialog.
Implements abstract java. Returns whether the given modal exclusion type is supported by this toolkit. |
| public boolean | isModalityTypeSupported(Dialog.
Implements abstract java. Returns whether the given modality type is supported by this toolkit. |
| public boolean | |
| protected void | loadSystemColors(int[] systemColors)
Overrides java. Fills in the integer array that is supplied as an argument with the current system color values. |
| public Map | mapInputMethodHighlight(InputMethodHighlight highlight)
Implements abstract java. Returns a map of visual attributes for the abstract level description of the given input method highlight, or null if no mapping is found. |
| public boolean | prepareImage(Image img, int w, int h, ImageObserver o)
Implements abstract java. Prepares an image for rendering. |
| public void | removeAWTEventListener(AWTEventListener listener)
Overrides java. Removes an AWTEventListener from receiving dispatched AWTEvents. |
| public void | removePropertyChangeListener(String name, PropertyChangeListener pcl)
Overrides java. Removes the specified property change listener for the named desktop property. |
| public void | setDynamicLayout(boolean dynamic)
Overrides java. Controls whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete. |
| public void | setLockingKeyState(int keyCode, boolean on)
Overrides java. Sets the state of the given locking key on the keyboard. |
| public void |
| componentFactory | back to summary |
|---|---|
| private ComponentFactory componentFactory | |
| kfmPeer | back to summary |
|---|---|
| private static final KeyboardFocusManagerPeer kfmPeer | |
| tk | back to summary |
|---|---|
| private final Toolkit tk | |
| HeadlessToolkit | back to summary |
|---|---|
| public HeadlessToolkit(Toolkit tk) | |
| addAWTEventListener | back to summary |
|---|---|
| public void addAWTEventListener(AWTEventListener listener, long eventMask) Overrides java. Doc from java. Adds an AWTEventListener to receive all AWTEvents dispatched
system-wide that conform to the given
Note event listener use is not recommended for normal application use, but are intended solely to support special purpose facilities including support for accessibility, event record/playback, and diagnostic tracing. If listener is null, no exception is thrown and no action is performed.
| |
| addPropertyChangeListener | back to summary |
|---|---|
| public void addPropertyChangeListener(String name, PropertyChangeListener pcl) Overrides java. Doc from java. Adds the specified property change listener for the named desktop
property. When a
| |
| areExtraMouseButtonsEnabled | back to summary |
|---|---|
| public boolean areExtraMouseButtonsEnabled() throws HeadlessException Overrides java. Doc from java. Reports whether events from extra mouse buttons are allowed to be processed and posted into
java -Dsun.awt.enableExtraMouseButtons=false ApplicationAlternatively, the property could be set in the application by using the following code:
System.setProperty("sun.awt.enableExtraMouseButtons", "true");
before the Toolkit class initialization.
If not set by the time of the Toolkit class initialization, this property will be
initialized with true.
Changing this value after the Toolkit class initialization will have no effect.
| |
| beep | back to summary |
|---|---|
| public void beep() Implements abstract java. Doc from java. Emits an audio beep depending on native system settings and hardware capabilities.
| |
| checkImage | back to summary |
|---|---|
| public int checkImage(Image img, int w, int h, ImageObserver o) Implements abstract java. Doc from java. 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
This method does not cause the image to begin loading.
An application must call
This method is called by the component's
Information on the flags returned by this method can be found
with the definition of the
| |
| createCustomCursor | back to summary |
|---|---|
| public Cursor createCustomCursor(Image cursor, Point hotSpot, String name) throws IndexOutOfBoundsException, HeadlessException Overrides java. Doc from java. Creates a new custom cursor object. If the image to display is invalid, the cursor will be hidden (made completely transparent), and the hotspot will be set to (0, 0). Note that multi-frame images are invalid and may cause this method to hang.
| |
| createDragGestureRecognizer | back to summary |
|---|---|
| public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) Overrides java. Doc from java. Creates a concrete, platform dependent, subclass of the abstract DragGestureRecognizer class requested, and associates it with the DragSource, Component and DragGestureListener specified. subclasses should override this to provide their own implementation
| |
| createImage | back to summary |
|---|---|
| public Image createImage(String filename) Implements abstract java. Doc from java. Returns an image which gets pixel data from the specified file. The returned Image is a new object which will not be shared with any other caller of this method or its getImage variant.
| |
| createImage | back to summary |
|---|---|
| public Image createImage(URL url) Implements abstract java. Doc from java. Returns an image which gets pixel data from the specified URL. The returned Image is a new object which will not be shared with any other caller of this method or its getImage variant.
| |
| createImage | back to summary |
|---|---|
| public Image createImage(byte[] data, int offset, int length) Implements abstract java. Doc from java. 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.
| |
| createImage | back to summary |
|---|---|
| public Image createImage(ImageProducer producer) Implements abstract java. Doc from java. Creates an image with the specified image producer.
| |
| createImage | back to summary |
|---|---|
| public Image createImage(byte[] imagedata) Overrides java. Doc from java. Creates an image which decodes the image stored in the specified byte array. The data must be in some image format, such as GIF or JPEG, that is supported by this toolkit.
| |
| createSystemTray | back to summary |
|---|---|
| public SystemTrayPeer createSystemTray(SystemTray target) throws HeadlessException | |
| createTrayIcon | back to summary |
|---|---|
| public TrayIconPeer createTrayIcon(TrayIcon target) throws HeadlessException | |
| getAWTEventListeners | back to summary |
|---|---|
| public AWTEventListener[] getAWTEventListeners() Overrides java. Doc from java. Returns an array of all the
| |
| getAWTEventListeners | back to summary |
|---|---|
| public AWTEventListener[] getAWTEventListeners(long eventMask) Overrides java. Doc from java. Returns an array of all the
| |
| getBestCursorSize | back to summary |
|---|---|
| public Dimension getBestCursorSize(int preferredWidth, int preferredHeight) throws HeadlessException Overrides java. Doc from java. Returns the supported cursor dimension which is closest to the desired sizes. Systems which only support a single cursor size will return that size regardless of the desired sizes. Systems which don't support custom cursors will return a dimension of 0, 0. Note if an image is used whose dimensions don't match a supported size (as returned by this method), the Toolkit implementation will attempt to resize the image to a supported size. Since converting low-resolution images is difficult, no guarantees are made as to the quality of a cursor image which isn't a supported size. It is therefore recommended that this method be called and an appropriate image used so no image conversion is made.
| |
| getColorModel | back to summary |
|---|---|
| public ColorModel getColorModel() throws HeadlessException Implements abstract java. Doc from java. Determines the color model of this toolkit's screen.
This toolkit method is called by the
| |
| getFontList | back to summary |
|---|---|
| public String[] getFontList() Implements abstract java. Doc from java. Returns the names of the available fonts in this toolkit. For 1.1, the following font names are deprecated (the replacement name follows):
The ZapfDingbats fontname is also deprecated in 1.1 but the characters are defined in Unicode starting at 0x2700, and as of 1.1 Java supports those characters.
| |
| getFontMetrics | back to summary |
|---|---|
| public FontMetrics getFontMetrics(Font font) Implements abstract java. Doc from java. Gets the screen device metrics for rendering of the font.
| |
| getFontPeer | back to summary |
|---|---|
| public FontPeer getFontPeer(String name, int style) Overrides default sun. Doc from sun. Creates this toolkit's implementation of
| |
| getGlobalCursorManager | back to summary |
|---|---|
| public GlobalCursorManager getGlobalCursorManager() throws HeadlessException | |
| getImage | back to summary |
|---|---|
| public Image getImage(String filename) Implements abstract java. Doc from java. Returns an image which gets pixel data from the specified file, whose format can be either GIF, JPEG or PNG. The underlying toolkit attempts to resolve multiple requests with the same filename to the same returned Image.
Since the mechanism required to facilitate this sharing of
| |
| getImage | back to summary |
|---|---|
| public Image getImage(URL url) Implements abstract java. Doc from java. Returns an image which gets pixel data from the specified URL. The pixel data referenced by the specified URL must be in one of the following formats: GIF, JPEG or PNG. The underlying toolkit attempts to resolve multiple requests with the same URL to the same returned Image.
Since the mechanism required to facilitate this sharing of
| |
| getKeyboardFocusManagerPeer | back to summary |
|---|---|
| public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() Implements sun. Doc from sun. Gets a singleton KeyboardFocusManagerPeer instance.
| |
| getLockingKeyState | back to summary |
|---|---|
| public boolean getLockingKeyState(int keyCode) throws UnsupportedOperationException Overrides java. Doc from java. Returns whether the given locking key on the keyboard is currently in
its "on" state.
Valid key codes are
| |
| getMaximumCursorColors | back to summary |
|---|---|
| public int getMaximumCursorColors() throws HeadlessException Overrides java. Doc from java. Returns the maximum number of colors the Toolkit supports in a custom cursor palette. Note if an image is used which has more colors in its palette than the supported maximum, the Toolkit implementation will attempt to flatten the palette to the maximum. Since converting low-resolution images is difficult, no guarantees are made as to the quality of a cursor image which has more colors than the system supports. It is therefore recommended that this method be called and an appropriate image used so no image conversion is made.
| |
| getMenuShortcutKeyMask | back to summary |
|---|---|
| public int getMenuShortcutKeyMask() throws HeadlessException Overrides java. Doc from java. Deprecated since 10. Determines which modifier key is the appropriate accelerator key for menu shortcuts.
Menu shortcuts, which are embodied in the
By default, this method returns
| |
| getMenuShortcutKeyMaskEx | back to summary |
|---|---|
| public int getMenuShortcutKeyMaskEx() throws HeadlessException Overrides java. Doc from java. Determines which extended modifier key is the appropriate accelerator key for menu shortcuts.
Menu shortcuts, which are embodied in the
By default, this method returns
| |
| getPrintJob | back to summary |
|---|---|
| public PrintJob getPrintJob(Frame frame, String jobtitle, JobAttributes jobAttributes, PageAttributes pageAttributes) Overrides java. Doc from java. Gets a
| |
| getPrintJob | back to summary |
|---|---|
| public PrintJob getPrintJob(Frame frame, String doctitle, Properties props) Implements abstract java. Doc from java. Gets a
| |
| getScreenInsets | back to summary |
|---|---|
| public Insets getScreenInsets(GraphicsConfiguration gc) throws HeadlessException Overrides java. Doc from java. Gets the insets of the screen.
| |
| getScreenResolution | back to summary |
|---|---|
| public int getScreenResolution() throws HeadlessException Implements abstract java. Doc from java. Returns the screen resolution in dots-per-inch.
| |
| getScreenSize | back to summary |
|---|---|
| public Dimension getScreenSize() throws HeadlessException Implements abstract java. Doc from java. Gets the size of the screen. On systems with multiple displays, the
primary display is used. Multi-screen aware display dimensions are
available from
| |
| getSystemClipboard | back to summary |
|---|---|
| public Clipboard getSystemClipboard() throws HeadlessException Implements abstract java. Doc from java. Gets the singleton instance of the system Clipboard which interfaces with clipboard facilities provided by the native platform. This clipboard enables data transfer between Java programs and native applications which use native clipboard facilities.
In addition to any and all default formats text returned by the system
Clipboard's
java.awt.datatransfer.StringSelection, if the
requested flavor is DataFlavor.plainTextFlavor, or an
equivalent flavor, a Reader is returnedNote The behavior of
the system Clipboard's
| |
| getSystemEventQueueImpl | back to summary |
|---|---|
| public EventQueue getSystemEventQueueImpl() Implements abstract java. Doc from java. A method used by toolkit subclasses to get the
| |
| getUnderlyingToolkit | back to summary |
|---|---|
| public Toolkit getUnderlyingToolkit() | |
| isAlwaysOnTopSupported | back to summary |
|---|---|
| public boolean isAlwaysOnTopSupported() Overrides java. Doc from java. Returns whether the always-on-top mode is supported by this toolkit.
To detect whether the always-on-top mode is supported for a
particular Window, use
| |
| isDesktopSupported | back to summary |
|---|---|
| public boolean isDesktopSupported() | |
| isDynamicLayoutActive | back to summary |
|---|---|
| public boolean isDynamicLayoutActive() throws HeadlessException Overrides java. Doc from java. Returns whether dynamic layout of Containers on resize is currently
enabled on the underlying operating system and/or window manager. If the
platform supports it,
If dynamic layout is currently inactive then Containers re-layout their
components when resizing is completed. As a result the
| |
| isDynamicLayoutSet | back to summary |
|---|---|
| protected boolean isDynamicLayoutSet() throws HeadlessException Overrides java. Doc from java. Returns whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete. Note this method returns the value that was set programmatically; it does not reflect support at the level of the operating system or window manager for dynamic layout on resizing, or the current operating system or window manager settings. The OS/WM support can be queried using getDesktopProperty("awt.dynamicLayoutSupported").
| |
| isModalExclusionTypeSupported | back to summary |
|---|---|
| public boolean isModalExclusionTypeSupported(Dialog. Implements abstract java. Doc from java. Returns whether the given modal exclusion type is supported by this
toolkit. If an unsupported modal exclusion type property is set on a window,
then
| |
| isModalityTypeSupported | back to summary |
|---|---|
| public boolean isModalityTypeSupported(Dialog. Implements abstract java. Doc from java. Returns whether the given modality type is supported by this toolkit. If
a dialog with unsupported modality type is created, then
| |
| isTraySupported | back to summary |
|---|---|
| public boolean isTraySupported() | |
| loadSystemColors | back to summary |
|---|---|
| protected void loadSystemColors(int[] systemColors) throws HeadlessException Overrides java. Doc from java. Fills in the integer array that is supplied as an argument with the current system color values.
| |
| mapInputMethodHighlight | back to summary |
|---|---|
| public Map Implements abstract java. Doc from java. Returns a map of visual attributes for the abstract level description of the given input method highlight, or null if no mapping is found. The style field of the input method highlight is ignored. The map returned is unmodifiable.
| |
| prepareImage | back to summary |
|---|---|
| public boolean prepareImage(Image img, int w, int h, ImageObserver o) Implements abstract java. Doc from java. Prepares an image for rendering.
If the values of the width and height arguments are both
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
Information on the flags returned by this method can be found
with the definition of the
| |
| removeAWTEventListener | back to summary |
|---|---|
| public void removeAWTEventListener(AWTEventListener listener) Overrides java. Doc from java. Removes an AWTEventListener from receiving dispatched AWTEvents. Note event listener use is not recommended for normal application use, but are intended solely to support special purpose facilities including support for accessibility, event record/playback, and diagnostic tracing. If listener is null, no exception is thrown and no action is performed.
| |
| removePropertyChangeListener | back to summary |
|---|---|
| public void removePropertyChangeListener(String name, PropertyChangeListener pcl) Overrides java. Doc from java. Removes the specified property change listener for the named
desktop property. When a
| |
| setDynamicLayout | back to summary |
|---|---|
| public void setDynamicLayout(boolean dynamic) throws HeadlessException Overrides java. Doc from java. Controls whether the layout of Containers is validated dynamically
during resizing, or statically, after resizing is complete.
Use
| |
| setLockingKeyState | back to summary |
|---|---|
| public void setLockingKeyState(int keyCode, boolean on) throws UnsupportedOperationException Overrides java. Doc from java. Sets the state of the given locking key on the keyboard.
Valid key codes are
Depending on the platform, setting the state of a locking key may involve event processing and therefore may not be immediately observable through getLockingKeyState.
| |
| sync | back to summary |
|---|---|
| public void sync() Implements abstract java. Doc from java. Synchronizes this toolkit's graphics state. Some window systems may do buffering of graphics events. This method ensures that the display is up-to-date. It is useful for animation.
| |