Java Doc for Toolkit.java in  » 6.0-JDK-Core » AWT » java » awt » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.Toolkit

Toolkit
abstract public class Toolkit (Code)
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.

Many GUI operations may be performed asynchronously. This means that if you set the state of a component, and then immediately query the state, the returned value may not yet reflect the requested change. This includes, but is not limited to:

  • Scrolling to a specified position.
    For example, calling ScrollPane.setScrollPosition and then getScrollPosition may return an incorrect value if the original request has not yet been processed.

  • Moving the focus from one component to another.
    For more information, see Timing Focus Transfers, a section in The Swing Tutorial.

  • Making a top-level container visible.
    Calling setVisible(true) on a Window, Frame or Dialog may occur asynchronously.

  • Setting the size or location of a top-level container.
    Calls to setSize, setBounds or setLocation on a Window, Frame or Dialog are forwarded to the underlying window management system and may be ignored or modified. See java.awt.Window for more information.

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.203, 12/19/03
author:
   Sami Shaio
author:
   Arthur van Hoff
author:
   Fred Ecks
since:
   JDK1.0



Field Summary
final protected  Map<String, Object>desktopProperties
    
final protected  PropertyChangeSupportdesktopPropsSupport
    


Method Summary
public  voidaddAWTEventListener(AWTEventListener listener, long eventMask)
     Adds an AWTEventListener to receive all AWTEvents dispatched system-wide that conform to the given eventMask.

First, if there is a security manager, its checkPermission method is called with an AWTPermission("listenToAllAWTEvents") permission. This may result in a SecurityException.

public  voidaddPropertyChangeListener(String name, PropertyChangeListener pcl)
     Adds the specified property change listener for the named desktop property.
abstract public  voidbeep()
     Emits an audio beep.
abstract public  intcheckImage(Image image, int width, int height, ImageObserver observer)
     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 -1, this method returns the construction status of a screen representation of the specified image in this toolkit. Otherwise, this method returns the construction status of a scaled representation of the image at the specified width and height.

This method does not cause the image to begin loading. An application must call prepareImage to force the loading of an image.

This method is called by the component's checkImage methods.

Information on the flags returned by this method can be found with the definition of the ImageObserver interface.
Parameters:
  image - the image whose status is being checked.
Parameters:
  width - the width of the scaled version whose status isbeing checked, or -1.
Parameters:
  height - the height of the scaled version whose statusis being checked, or -1.
Parameters:
  observer - the ImageObserver object to benotified as the image is being prepared.

synchronized  intcountAWTEventListeners(long eventMask)
    
abstract protected  ButtonPeercreateButton(Button target)
     Creates this toolkit's implementation of Button using the specified peer interface.
Parameters:
  target - the button to be implemented.
abstract protected  CanvasPeercreateCanvas(Canvas target)
     Creates this toolkit's implementation of Canvas using the specified peer interface.
Parameters:
  target - the canvas to be implemented.
abstract protected  CheckboxPeercreateCheckbox(Checkbox target)
     Creates this toolkit's implementation of Checkbox using the specified peer interface.
Parameters:
  target - the check box to be implemented.
abstract protected  CheckboxMenuItemPeercreateCheckboxMenuItem(CheckboxMenuItem target)
     Creates this toolkit's implementation of CheckboxMenuItem using the specified peer interface.
Parameters:
  target - the checkbox menu item to be implemented.
abstract protected  ChoicePeercreateChoice(Choice target)
     Creates this toolkit's implementation of Choice using the specified peer interface.
Parameters:
  target - the choice to be implemented.
protected  LightweightPeercreateComponent(Component target)
     Creates a peer for a component or container.
public  CursorcreateCustomCursor(Image cursor, Point hotSpot, String name)
     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).
abstract protected  DesktopPeercreateDesktopPeer(Desktop target)
     Creates this toolkit's implementation of the Desktop using the specified peer interface.
abstract protected  DialogPeercreateDialog(Dialog target)
     Creates this toolkit's implementation of Dialog using the specified peer interface.
Parameters:
  target - the dialog to be implemented.
public  TcreateDragGestureRecognizer(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.
abstract public  DragSourceContextPeercreateDragSourceContextPeer(DragGestureEvent dge)
     Creates the peer for a DragSourceContext.
abstract protected  FileDialogPeercreateFileDialog(FileDialog target)
     Creates this toolkit's implementation of FileDialog using the specified peer interface.
Parameters:
  target - the file dialog to be implemented.
abstract protected  FramePeercreateFrame(Frame target)
     Creates this toolkit's implementation of Frame using the specified peer interface.
Parameters:
  target - the frame to be implemented.
abstract public  ImagecreateImage(String filename)
     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.

This method first checks if there is a security manager installed. If so, the method calls the security manager's checkRead method with the specified file to ensure that the image creation is allowed.
Parameters:
  filename - the name of a file containing pixel datain a recognized file format.

abstract public  ImagecreateImage(URL url)
     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.

This method first checks if there is a security manager installed. If so, the method calls the security manager's checkPermission method with the url.openConnection().getPermission() permission to ensure that the image creation is allowed.

abstract public  ImagecreateImage(ImageProducer producer)
     Creates an image with the specified image producer.
Parameters:
  producer - the image producer to be used.
public  ImagecreateImage(byte[] imagedata)
     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.
Parameters:
  imagedata - an array of bytes, representingimage data in a supported image format.

abstract public  ImagecreateImage(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. The data must be in some image format, such as GIF or JPEG, that is supported by this toolkit.
Parameters:
  imagedata - an array of bytes, representingimage data in a supported image format.
Parameters:
  imageoffset - the offset of the beginningof the data in the array.
Parameters:
  imagelength - the length of the data in the array.
abstract protected  LabelPeercreateLabel(Label target)
     Creates this toolkit's implementation of Label using the specified peer interface.
Parameters:
  target - the label to be implemented.
abstract protected  ListPeercreateList(java.awt.List target)
     Creates this toolkit's implementation of List using the specified peer interface.
Parameters:
  target - the list to be implemented.
abstract protected  MenuPeercreateMenu(Menu target)
     Creates this toolkit's implementation of Menu using the specified peer interface.
Parameters:
  target - the menu to be implemented.
abstract protected  MenuBarPeercreateMenuBar(MenuBar target)
     Creates this toolkit's implementation of MenuBar using the specified peer interface.
Parameters:
  target - the menu bar to be implemented.
abstract protected  MenuItemPeercreateMenuItem(MenuItem target)
     Creates this toolkit's implementation of MenuItem using the specified peer interface.
Parameters:
  target - the menu item to be implemented.
abstract protected  PanelPeercreatePanel(Panel target)
     Creates this toolkit's implementation of Panel using the specified peer interface.
Parameters:
  target - the panel to be implemented.
abstract protected  PopupMenuPeercreatePopupMenu(PopupMenu target)
     Creates this toolkit's implementation of PopupMenu using the specified peer interface.
Parameters:
  target - the popup menu to be implemented.
abstract protected  ScrollPanePeercreateScrollPane(ScrollPane target)
     Creates this toolkit's implementation of ScrollPane using the specified peer interface.
Parameters:
  target - the scroll pane to be implemented.
abstract protected  ScrollbarPeercreateScrollbar(Scrollbar target)
     Creates this toolkit's implementation of Scrollbar using the specified peer interface.
Parameters:
  target - the scroll bar to be implemented.
abstract protected  TextAreaPeercreateTextArea(TextArea target)
     Creates this toolkit's implementation of TextArea using the specified peer interface.
Parameters:
  target - the text area to be implemented.
abstract protected  TextFieldPeercreateTextField(TextField target)
     Creates this toolkit's implementation of TextField using the specified peer interface.
Parameters:
  target - the text field to be implemented.
abstract protected  WindowPeercreateWindow(Window target)
     Creates this toolkit's implementation of Window using the specified peer interface.
Parameters:
  target - the window to be implemented.
static  booleanenabledOnToolkit(long eventMask)
    
public  AWTEventListener[]getAWTEventListeners()
     Returns an array of all the AWTEventListeners registered on this toolkit. If there is a security manager, its checkPermission method is called with an AWTPermission("listenToAllAWTEvents") permission. This may result in a SecurityException.
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. If there is a security manager, its checkPermission method is called with an AWTPermission("listenToAllAWTEvents") permission. This may result in a SecurityException.
public  DimensiongetBestCursorSize(int preferredWidth, int preferredHeight)
     Returns the supported cursor dimension which is closest to the desired sizes.
abstract public  ColorModelgetColorModel()
     Determines the color model of this toolkit's screen.
public static synchronized  ToolkitgetDefaultToolkit()
     Gets the default toolkit.

If a system property named "java.awt.headless" is set to true then the headless implementation of Toolkit is used.

If there is no "java.awt.headless" or it is set to false and there is a system property named "awt.toolkit", that property is treated as the name of a class that is a subclass of Toolkit; otherwise the default platform-specific implementation of Toolkit is used.

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.

final public synchronized  ObjectgetDesktopProperty(String propertyName)
     Obtains a value for the specified desktop property. A desktop property is a uniquely named value for a resource that is Toolkit global in nature.
static  EventQueuegetEventQueue()
    
abstract public  String[]getFontList()
     Returns the names of the available fonts in this toolkit.

For 1.1, the following font names are deprecated (the replacement name follows):

  • TimesRoman (use Serif)
  • Helvetica (use SansSerif)
  • Courier (use Monospaced)

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.

abstract public  FontMetricsgetFontMetrics(Font font)
     Gets the screen device metrics for rendering of the font.
abstract protected  FontPeergetFontPeer(String name, int style)
     Creates this toolkit's implementation of Font using the specified peer interface.
abstract public  ImagegetImage(String filename)
     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 Image objects may continue to hold onto images that are no longer in use for an indefinite period of time, developers are encouraged to implement their own caching of images by using the Toolkit.createImage(java.lang.String) createImage variant wherever available. If the image data contained in the specified file changes, the Image object returned from this method may still contain stale information which was loaded from the file after a prior call. Previously loaded image data can be manually discarded by calling the Image.flush flush method on the returned Image.

This method first checks if there is a security manager installed. If so, the method calls the security manager's checkRead method with the file specified to ensure that the access to the image is allowed.
Parameters:
  filename - the name of a file containing pixel datain a recognized file format.

abstract public  ImagegetImage(URL url)
     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 Image objects may continue to hold onto images that are no longer in use for an indefinite period of time, developers are encouraged to implement their own caching of images by using the Toolkit.createImage(java.net.URL) createImage variant wherever available. If the image data stored at the specified URL changes, the Image object returned from this method may still contain stale information which was fetched from the URL after a prior call. Previously loaded image data can be manually discarded by calling the Image.flush flush method on the returned Image.

This method first checks if there is a security manager installed. If so, the method calls the security manager's checkPermission method with the url.openConnection().getPermission() permission to ensure that the access to the image is allowed.

public  booleangetLockingKeyState(int keyCode)
     Returns whether the given locking key on the keyboard is currently in its "on" state.
public  intgetMaximumCursorColors()
     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.

public  intgetMenuShortcutKeyMask()
     Determines which modifier key is the appropriate accelerator key for menu shortcuts.
protected  MouseInfoPeergetMouseInfoPeer()
     Obtains this toolkit's implementation of helper class for MouseInfo operations.
protected static  ContainergetNativeContainer(Component c)
     Give native peers the ability to query the native container given a native component (eg the direct parent may be lightweight).
abstract public  PrintJobgetPrintJob(Frame frame, String jobtitle, Properties props)
     Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.

Each actual implementation of this method should first check if there is a security manager installed.

public  PrintJobgetPrintJob(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.

Each actual implementation of this method should first check if there is a security manager installed.

public static  StringgetProperty(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.
public  PropertyChangeListener[]getPropertyChangeListeners(String propertyName)
     Returns an array of all the PropertyChangeListeners associated with the named property.
public  InsetsgetScreenInsets(GraphicsConfiguration gc)
     Gets the insets of the screen.
abstract public  intgetScreenResolution()
     Returns the screen resolution in dots-per-inch.
abstract public  DimensiongetScreenSize()
     Gets the size of the screen.
abstract public  ClipboardgetSystemClipboard()
     Gets the singleton instance of the system Clipboard which interfaces with clipboard facilities provided by the native platform.
final public  EventQueuegetSystemEventQueue()
     Get the application's or applet's EventQueue instance. Depending on the Toolkit implementation, different EventQueues may be returned for different applets.
abstract protected  EventQueuegetSystemEventQueueImpl()
     Gets the application's or applet's EventQueue instance, without checking access.
public  ClipboardgetSystemSelection()
     Gets the singleton instance of the system selection as a Clipboard object.
protected  voidinitializeDesktopProperties()
    
public  booleanisAlwaysOnTopSupported()
     Returns whether the always-on-top mode is supported by this toolkit.
public  booleanisDynamicLayoutActive()
     Returns whether dynamic layout of Containers on resize is currently active (both set in program ( isDynamicLayoutSet() ) , and supported by the underlying operating system and/or window manager). If dynamic layout is currently inactive then Containers re-layout their components when resizing is completed.
protected  booleanisDynamicLayoutSet()
     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.
public  booleanisFrameStateSupported(int state)
     Returns whether Toolkit supports this state for Frames.
abstract public  booleanisModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType)
     Returns whether the given modal exclusion type is supported by this toolkit.
abstract public  booleanisModalityTypeSupported(Dialog.ModalityType modalityType)
     Returns whether the given modality type is supported by this toolkit.
protected  ObjectlazilyLoadDesktopProperty(String name)
     an opportunity to lazily evaluate desktop property values.
static  voidloadLibraries()
    
protected  voidloadSystemColors(int[] systemColors)
     Fills in the integer array that is supplied as an argument with the current system color values.
abstract public  Map<java.awt.font.TextAttribute, ?>mapInputMethodHighlight(InputMethodHighlight highlight)
     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.
 voidnotifyAWTEventListeners(AWTEvent theEvent)
    
abstract public  booleanprepareImage(Image image, int width, int height, ImageObserver observer)
     Prepares an image for rendering.

If the values of the width and height arguments are both -1, this method prepares the image for rendering on the default screen; otherwise, this method prepares an image for rendering on the default screen at the specified width and height.

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 prepareImage methods.

Information on the flags returned by this method can be found with the definition of the ImageObserver interface.
Parameters:
  image - the image for which to prepare ascreen representation.
Parameters:
  width - the width of the desired screenrepresentation, or -1.
Parameters:
  height - the height of the desired screenrepresentation, or -1.
Parameters:
  observer - the ImageObserverobject to be notified as theimage is being prepared.

public  voidremoveAWTEventListener(AWTEventListener listener)
     Removes an AWTEventListener from receiving dispatched AWTEvents.

First, if there is a security manager, its checkPermission method is called with an AWTPermission("listenToAllAWTEvents") permission. This may result in a SecurityException.

public  voidremovePropertyChangeListener(String name, PropertyChangeListener pcl)
     Removes the specified property change listener for the named desktop property.
final protected  voidsetDesktopProperty(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  voidsetDynamicLayout(boolean dynamic)
     Controls whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete. Use isDynamicLayoutActive() to detect if this feature enabled in this program and is supported by this operating system and/or window manager. Note that this feature is supported not on all platforms, and conversely, that this feature cannot be turned off on some platforms. On these platforms where dynamic layout during resizing is not supported (or is always supported), setting this property has no effect. Note that this feature can be set or unset as a property of the operating system or window manager on some platforms.
public  voidsetLockingKeyState(int keyCode, boolean on)
     Sets the state of the given locking key on the keyboard.
abstract public  voidsync()
     Synchronizes this toolkit's graphics state.

Field Detail
desktopProperties
final protected Map<String, Object> desktopProperties(Code)



desktopPropsSupport
final protected PropertyChangeSupport desktopPropsSupport(Code)





Method Detail
addAWTEventListener
public void addAWTEventListener(AWTEventListener listener, long eventMask)(Code)
Adds an AWTEventListener to receive all AWTEvents dispatched system-wide that conform to the given eventMask.

First, if there is a security manager, its checkPermission method is called with an AWTPermission("listenToAllAWTEvents") permission. This may result in a SecurityException.

eventMask is a bitmask of event types to receive. It is constructed by bitwise OR-ing together the event masks defined in AWTEvent.

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.
Parameters:
  listener - the event listener.
Parameters:
  eventMask - the bitmask of event types to receive
throws:
  SecurityException - if a security manager exists and its checkPermission method doesn't allow the operation.
See Also:   Toolkit.removeAWTEventListener
See Also:   Toolkit.getAWTEventListeners
See Also:   SecurityManager.checkPermission
See Also:   java.awt.AWTEvent
See Also:   java.awt.AWTPermission
See Also:   java.awt.event.AWTEventListener
See Also:   java.awt.event.AWTEventListenerProxy
since:
   1.2




addPropertyChangeListener
public void addPropertyChangeListener(String name, PropertyChangeListener pcl)(Code)
Adds the specified property change listener for the named desktop property. If pcl is null, no exception is thrown and no action is performed.
Parameters:
  name - The name of the property to listen for
Parameters:
  pcl - The property change listener
since:
   1.2



beep
abstract public void beep()(Code)
Emits an audio beep.
since:
   JDK1.1



checkImage
abstract public int checkImage(Image image, int width, int height, ImageObserver observer)(Code)
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 -1, this method returns the construction status of a screen representation of the specified image in this toolkit. Otherwise, this method returns the construction status of a scaled representation of the image at the specified width and height.

This method does not cause the image to begin loading. An application must call prepareImage to force the loading of an image.

This method is called by the component's checkImage methods.

Information on the flags returned by this method can be found with the definition of the ImageObserver interface.
Parameters:
  image - the image whose status is being checked.
Parameters:
  width - the width of the scaled version whose status isbeing checked, or -1.
Parameters:
  height - the height of the scaled version whose statusis being checked, or -1.
Parameters:
  observer - the ImageObserver object to benotified as the image is being prepared. the bitwise inclusive OR of theImageObserver flags for theimage data that is currently available.
See Also:   java.awt.Toolkit.prepareImage(java.awt.Imageintintjava.awt.image.ImageObserver)
See Also:   java.awt.Component.checkImage(java.awt.Imagejava.awt.image.ImageObserver)
See Also:   java.awt.Component.checkImage(java.awt.Imageintintjava.awt.image.ImageObserver)
See Also:   java.awt.image.ImageObserver




countAWTEventListeners
synchronized int countAWTEventListeners(long eventMask)(Code)



createButton
abstract protected ButtonPeer createButton(Button target) throws HeadlessException(Code)
Creates this toolkit's implementation of Button using the specified peer interface.
Parameters:
  target - the button to be implemented. this toolkit's implementation of Button.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Button
See Also:   java.awt.peer.ButtonPeer



createCanvas
abstract protected CanvasPeer createCanvas(Canvas target)(Code)
Creates this toolkit's implementation of Canvas using the specified peer interface.
Parameters:
  target - the canvas to be implemented. this toolkit's implementation of Canvas.
See Also:   java.awt.Canvas
See Also:   java.awt.peer.CanvasPeer



createCheckbox
abstract protected CheckboxPeer createCheckbox(Checkbox target) throws HeadlessException(Code)
Creates this toolkit's implementation of Checkbox using the specified peer interface.
Parameters:
  target - the check box to be implemented. this toolkit's implementation of Checkbox.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Checkbox
See Also:   java.awt.peer.CheckboxPeer



createCheckboxMenuItem
abstract protected CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) throws HeadlessException(Code)
Creates this toolkit's implementation of CheckboxMenuItem using the specified peer interface.
Parameters:
  target - the checkbox menu item to be implemented. this toolkit's implementation of CheckboxMenuItem.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.CheckboxMenuItem
See Also:   java.awt.peer.CheckboxMenuItemPeer



createChoice
abstract protected ChoicePeer createChoice(Choice target) throws HeadlessException(Code)
Creates this toolkit's implementation of Choice using the specified peer interface.
Parameters:
  target - the choice to be implemented. this toolkit's implementation of Choice.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Choice
See Also:   java.awt.peer.ChoicePeer



createComponent
protected LightweightPeer createComponent(Component target)(Code)
Creates a peer for a component or container. This peer is windowless and allows the Component and Container classes to be extended directly to create windowless components that are defined entirely in java.
Parameters:
  target - The Component to be created.



createCustomCursor
public Cursor createCustomCursor(Image cursor, Point hotSpot, String name) throws IndexOutOfBoundsException, HeadlessException(Code)
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.
Parameters:
  cursor - the image to display when the cursor is actived
Parameters:
  hotSpot - the X and Y of the large cursor's hot spot; thehotSpot values must be less than the Dimension returned bygetBestCursorSize
Parameters:
  name - a localized description of the cursor, for Java Accessibility use
exception:
  IndexOutOfBoundsException - if the hotSpot values are outsidethe bounds of the cursor
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.2




createDesktopPeer
abstract protected DesktopPeer createDesktopPeer(Desktop target) throws HeadlessException(Code)
Creates this toolkit's implementation of the Desktop using the specified peer interface.
Parameters:
  target - the desktop to be implemented this toolkit's implementation of the Desktop
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Desktop
See Also:   java.awt.peer.DesktopPeer
since:
   1.6



createDialog
abstract protected DialogPeer createDialog(Dialog target) throws HeadlessException(Code)
Creates this toolkit's implementation of Dialog using the specified peer interface.
Parameters:
  target - the dialog to be implemented. this toolkit's implementation of Dialog.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Dialog
See Also:   java.awt.peer.DialogPeer



createDragGestureRecognizer
public T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)(Code)
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
Parameters:
  abstractRecognizerClass - The abstract class of the required recognizer
Parameters:
  ds - The DragSource
Parameters:
  c - The Component target for the DragGestureRecognizer
Parameters:
  srcActions - The actions permitted for the gesture
Parameters:
  dgl - The DragGestureListener the new object or null. Always returns null ifGraphicsEnvironment.isHeadless() returns true.
See Also:   java.awt.GraphicsEnvironment.isHeadless



createDragSourceContextPeer
abstract public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException(Code)
Creates the peer for a DragSourceContext. Always throws InvalidDndOperationException if GraphicsEnvironment.isHeadless() returns true.
See Also:   java.awt.GraphicsEnvironment.isHeadless



createFileDialog
abstract protected FileDialogPeer createFileDialog(FileDialog target) throws HeadlessException(Code)
Creates this toolkit's implementation of FileDialog using the specified peer interface.
Parameters:
  target - the file dialog to be implemented. this toolkit's implementation of FileDialog.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.FileDialog
See Also:   java.awt.peer.FileDialogPeer



createFrame
abstract protected FramePeer createFrame(Frame target) throws HeadlessException(Code)
Creates this toolkit's implementation of Frame using the specified peer interface.
Parameters:
  target - the frame to be implemented. this toolkit's implementation of Frame.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Frame
See Also:   java.awt.peer.FramePeer



createImage
abstract public Image createImage(String filename)(Code)
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.

This method first checks if there is a security manager installed. If so, the method calls the security manager's checkRead method with the specified file to ensure that the image creation is allowed.
Parameters:
  filename - the name of a file containing pixel datain a recognized file format. an image which gets its pixel data fromthe specified file.
throws:
  SecurityException - if a security manager exists and itscheckRead method doesn't allow the operation.
See Also:   Toolkit.getImage(java.lang.String)




createImage
abstract public Image createImage(URL url)(Code)
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.

This method first checks if there is a security manager installed. If so, the method calls the security manager's checkPermission method with the url.openConnection().getPermission() permission to ensure that the image creation is allowed. For compatibility with pre-1.2 security managers, if the access is denied with FilePermission or SocketPermission, the method throws SecurityException if the corresponding 1.1-style SecurityManager.checkXXX method also denies permission.
Parameters:
  url - the URL to use in fetching the pixel data. an image which gets its pixel data fromthe specified URL.
throws:
  SecurityException - if a security manager exists and itscheckPermission method doesn't allowthe operation.
See Also:   Toolkit.getImage(java.net.URL)




createImage
abstract public Image createImage(ImageProducer producer)(Code)
Creates an image with the specified image producer.
Parameters:
  producer - the image producer to be used. an image with the specified image producer.
See Also:   java.awt.Image
See Also:   java.awt.image.ImageProducer
See Also:   java.awt.Component.createImage(java.awt.image.ImageProducer)



createImage
public Image createImage(byte[] imagedata)(Code)
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.
Parameters:
  imagedata - an array of bytes, representingimage data in a supported image format. an image.
since:
   JDK1.1




createImage
abstract public Image createImage(byte[] imagedata, int imageoffset, int imagelength)(Code)
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.
Parameters:
  imagedata - an array of bytes, representingimage data in a supported image format.
Parameters:
  imageoffset - the offset of the beginningof the data in the array.
Parameters:
  imagelength - the length of the data in the array. an image.
since:
   JDK1.1



createLabel
abstract protected LabelPeer createLabel(Label target) throws HeadlessException(Code)
Creates this toolkit's implementation of Label using the specified peer interface.
Parameters:
  target - the label to be implemented. this toolkit's implementation of Label.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Label
See Also:   java.awt.peer.LabelPeer



createList
abstract protected ListPeer createList(java.awt.List target) throws HeadlessException(Code)
Creates this toolkit's implementation of List using the specified peer interface.
Parameters:
  target - the list to be implemented. this toolkit's implementation of List.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.List
See Also:   java.awt.peer.ListPeer



createMenu
abstract protected MenuPeer createMenu(Menu target) throws HeadlessException(Code)
Creates this toolkit's implementation of Menu using the specified peer interface.
Parameters:
  target - the menu to be implemented. this toolkit's implementation of Menu.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Menu
See Also:   java.awt.peer.MenuPeer



createMenuBar
abstract protected MenuBarPeer createMenuBar(MenuBar target) throws HeadlessException(Code)
Creates this toolkit's implementation of MenuBar using the specified peer interface.
Parameters:
  target - the menu bar to be implemented. this toolkit's implementation of MenuBar.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.MenuBar
See Also:   java.awt.peer.MenuBarPeer



createMenuItem
abstract protected MenuItemPeer createMenuItem(MenuItem target) throws HeadlessException(Code)
Creates this toolkit's implementation of MenuItem using the specified peer interface.
Parameters:
  target - the menu item to be implemented. this toolkit's implementation of MenuItem.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.MenuItem
See Also:   java.awt.peer.MenuItemPeer



createPanel
abstract protected PanelPeer createPanel(Panel target)(Code)
Creates this toolkit's implementation of Panel using the specified peer interface.
Parameters:
  target - the panel to be implemented. this toolkit's implementation of Panel.
See Also:   java.awt.Panel
See Also:   java.awt.peer.PanelPeer



createPopupMenu
abstract protected PopupMenuPeer createPopupMenu(PopupMenu target) throws HeadlessException(Code)
Creates this toolkit's implementation of PopupMenu using the specified peer interface.
Parameters:
  target - the popup menu to be implemented. this toolkit's implementation of PopupMenu.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.PopupMenu
See Also:   java.awt.peer.PopupMenuPeer
since:
   JDK1.1



createScrollPane
abstract protected ScrollPanePeer createScrollPane(ScrollPane target) throws HeadlessException(Code)
Creates this toolkit's implementation of ScrollPane using the specified peer interface.
Parameters:
  target - the scroll pane to be implemented. this toolkit's implementation of ScrollPane.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.ScrollPane
See Also:   java.awt.peer.ScrollPanePeer
since:
   JDK1.1



createScrollbar
abstract protected ScrollbarPeer createScrollbar(Scrollbar target) throws HeadlessException(Code)
Creates this toolkit's implementation of Scrollbar using the specified peer interface.
Parameters:
  target - the scroll bar to be implemented. this toolkit's implementation of Scrollbar.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Scrollbar
See Also:   java.awt.peer.ScrollbarPeer



createTextArea
abstract protected TextAreaPeer createTextArea(TextArea target) throws HeadlessException(Code)
Creates this toolkit's implementation of TextArea using the specified peer interface.
Parameters:
  target - the text area to be implemented. this toolkit's implementation of TextArea.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.TextArea
See Also:   java.awt.peer.TextAreaPeer



createTextField
abstract protected TextFieldPeer createTextField(TextField target) throws HeadlessException(Code)
Creates this toolkit's implementation of TextField using the specified peer interface.
Parameters:
  target - the text field to be implemented. this toolkit's implementation of TextField.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.TextField
See Also:   java.awt.peer.TextFieldPeer



createWindow
abstract protected WindowPeer createWindow(Window target) throws HeadlessException(Code)
Creates this toolkit's implementation of Window using the specified peer interface.
Parameters:
  target - the window to be implemented. this toolkit's implementation of Window.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.Window
See Also:   java.awt.peer.WindowPeer



enabledOnToolkit
static boolean enabledOnToolkit(long eventMask)(Code)



getAWTEventListeners
public AWTEventListener[] getAWTEventListeners()(Code)
Returns an array of all the AWTEventListeners registered on this toolkit. If there is a security manager, its checkPermission method is called with an AWTPermission("listenToAllAWTEvents") permission. This may result in a SecurityException. Listeners can be returned within AWTEventListenerProxy objects, which also contain the event mask for the given listener. Note that listener objects added multiple times appear only once in the returned array. all of the AWTEventListeners or an emptyarray if no listeners are currently registered
throws:
  SecurityException - if a security manager exists and its checkPermission method doesn't allow the operation.
See Also:   Toolkit.addAWTEventListener
See Also:   Toolkit.removeAWTEventListener
See Also:   SecurityManager.checkPermission
See Also:   java.awt.AWTEvent
See Also:   java.awt.AWTPermission
See Also:   java.awt.event.AWTEventListener
See Also:   java.awt.event.AWTEventListenerProxy
since:
   1.4



getAWTEventListeners
public AWTEventListener[] getAWTEventListeners(long eventMask)(Code)
Returns an array of all the AWTEventListeners registered on this toolkit which listen to all of the event types specified in the eventMask argument. If there is a security manager, its checkPermission method is called with an AWTPermission("listenToAllAWTEvents") permission. This may result in a SecurityException. Listeners can be returned within AWTEventListenerProxy objects, which also contain the event mask for the given listener. Note that listener objects added multiple times appear only once in the returned array.
Parameters:
  eventMask - the bitmask of event types to listen for all of the AWTEventListeners registeredon this toolkit for the specifiedevent types, or an empty array if no such listenersare currently registered
throws:
  SecurityException - if a security manager exists and its checkPermission method doesn't allow the operation.
See Also:   Toolkit.addAWTEventListener
See Also:   Toolkit.removeAWTEventListener
See Also:   SecurityManager.checkPermission
See Also:   java.awt.AWTEvent
See Also:   java.awt.AWTPermission
See Also:   java.awt.event.AWTEventListener
See Also:   java.awt.event.AWTEventListenerProxy
since:
   1.4



getBestCursorSize
public Dimension getBestCursorSize(int preferredWidth, int preferredHeight) throws HeadlessException(Code)
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.
Parameters:
  preferredWidth - the preferred cursor width the component would liketo use.
Parameters:
  preferredHeight - the preferred cursor height the component would liketo use. the closest matching supported cursor size, or a dimension of 0,0 ifthe Toolkit implementation doesn't support custom cursors.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.2




getColorModel
abstract public ColorModel getColorModel() throws HeadlessException(Code)
Determines the color model of this toolkit's screen.

ColorModel is an abstract class that encapsulates the ability to translate between the pixel values of an image and its red, green, blue, and alpha components.

This toolkit method is called by the getColorModel method of the Component class. the color model of this toolkit's screen.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.image.ColorModel
See Also:   java.awt.Component.getColorModel




getDefaultToolkit
public static synchronized Toolkit getDefaultToolkit()(Code)
Gets the default toolkit.

If a system property named "java.awt.headless" is set to true then the headless implementation of Toolkit is used.

If there is no "java.awt.headless" or it is set to false and there is a system property named "awt.toolkit", that property is treated as the name of a class that is a subclass of Toolkit; otherwise the default platform-specific implementation of Toolkit is used.

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. the default toolkit.
exception:
  AWTError - if a toolkit could not be found, orif one could not be accessed or instantiated.




getDesktopProperty
final public synchronized Object getDesktopProperty(String propertyName)(Code)
Obtains a value for the specified desktop property. A desktop property is a uniquely named value for a resource that is Toolkit global in nature. Usually it also is an abstract representation for an underlying platform dependent desktop setting. For more information on desktop properties supported by the AWT see AWT Desktop Properties.



getEventQueue
static EventQueue getEventQueue()(Code)



getFontList
abstract public String[] getFontList()(Code)
Returns the names of the available fonts in this toolkit.

For 1.1, the following font names are deprecated (the replacement name follows):

  • TimesRoman (use Serif)
  • Helvetica (use SansSerif)
  • Courier (use Monospaced)

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. the names of the available fonts in this toolkit.java.awt.GraphicsEnvironment.getAvailableFontFamilyNames
See Also:   java.awt.GraphicsEnvironment.getAvailableFontFamilyNames




getFontMetrics
abstract public FontMetrics getFontMetrics(Font font)(Code)
Gets the screen device metrics for rendering of the font.
Parameters:
  font - a font the screen metrics of the specified font in this toolkit
See Also:   java.awt.font.LineMetrics
See Also:   java.awt.Font.getLineMetrics
See Also:   java.awt.GraphicsEnvironment.getScreenDevices



getFontPeer
abstract protected FontPeer getFontPeer(String name, int style)(Code)
Creates this toolkit's implementation of Font using the specified peer interface.
Parameters:
  name - the font to be implemented
Parameters:
  style - the style of the font, such as PLAIN,BOLD, ITALIC, or a combination this toolkit's implementation of Font
See Also:   java.awt.Font
See Also:   java.awt.peer.FontPeer
See Also:   java.awt.GraphicsEnvironment.getAllFonts



getImage
abstract public Image getImage(String filename)(Code)
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 Image objects may continue to hold onto images that are no longer in use for an indefinite period of time, developers are encouraged to implement their own caching of images by using the Toolkit.createImage(java.lang.String) createImage variant wherever available. If the image data contained in the specified file changes, the Image object returned from this method may still contain stale information which was loaded from the file after a prior call. Previously loaded image data can be manually discarded by calling the Image.flush flush method on the returned Image.

This method first checks if there is a security manager installed. If so, the method calls the security manager's checkRead method with the file specified to ensure that the access to the image is allowed.
Parameters:
  filename - the name of a file containing pixel datain a recognized file format. an image which gets its pixel data fromthe specified file.
throws:
  SecurityException - if a security manager exists and itscheckRead method doesn't allow the operation.
See Also:   Toolkit.createImage(java.lang.String)




getImage
abstract public Image getImage(URL url)(Code)
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 Image objects may continue to hold onto images that are no longer in use for an indefinite period of time, developers are encouraged to implement their own caching of images by using the Toolkit.createImage(java.net.URL) createImage variant wherever available. If the image data stored at the specified URL changes, the Image object returned from this method may still contain stale information which was fetched from the URL after a prior call. Previously loaded image data can be manually discarded by calling the Image.flush flush method on the returned Image.

This method first checks if there is a security manager installed. If so, the method calls the security manager's checkPermission method with the url.openConnection().getPermission() permission to ensure that the access to the image is allowed. For compatibility with pre-1.2 security managers, if the access is denied with FilePermission or SocketPermission, the method throws the SecurityException if the corresponding 1.1-style SecurityManager.checkXXX method also denies permission.
Parameters:
  url - the URL to use in fetching the pixel data. an image which gets its pixel data fromthe specified URL.
throws:
  SecurityException - if a security manager exists and itscheckPermission method doesn't allowthe operation.
See Also:   Toolkit.createImage(java.net.URL)




getLockingKeyState
public boolean getLockingKeyState(int keyCode) throws UnsupportedOperationException(Code)
Returns whether the given locking key on the keyboard is currently in its "on" state. Valid key codes are java.awt.event.KeyEvent.VK_CAPS_LOCK VK_CAPS_LOCK , java.awt.event.KeyEvent.VK_NUM_LOCK VK_NUM_LOCK , java.awt.event.KeyEvent.VK_SCROLL_LOCK VK_SCROLL_LOCK , and java.awt.event.KeyEvent.VK_KANA_LOCK VK_KANA_LOCK .
exception:
  java.lang.IllegalArgumentException - if keyCodeis not one of the valid key codes
exception:
  java.lang.UnsupportedOperationException - if the host system doesn'tallow getting the state of this key programmatically, or if the keyboarddoesn't have this key
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.3



getMaximumCursorColors
public int getMaximumCursorColors() throws HeadlessException(Code)
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. the maximum number of colors, or zero if custom cursors are notsupported by this Toolkit implementation.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.2




getMenuShortcutKeyMask
public int getMenuShortcutKeyMask() throws HeadlessException(Code)
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. the modifier mask on the Event classthat is used for menu shortcuts on this toolkit.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.MenuBar
See Also:   java.awt.MenuShortcut
since:
   JDK1.1




getMouseInfoPeer
protected MouseInfoPeer getMouseInfoPeer()(Code)
Obtains this toolkit's implementation of helper class for MouseInfo operations. this toolkit's implementation of helper for MouseInfo
throws:
  UnsupportedOperationException - if this operation is not implemented
See Also:   java.awt.peer.MouseInfoPeer
See Also:   java.awt.MouseInfo
since:
   1.5



getNativeContainer
protected static Container getNativeContainer(Component c)(Code)
Give native peers the ability to query the native container given a native component (eg the direct parent may be lightweight).



getPrintJob
abstract public PrintJob getPrintJob(Frame frame, String jobtitle, Properties props)(Code)
Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.

Each actual implementation of this method should first check if there is a security manager installed. If there is, the method should call the security manager's checkPrintJobAccess method to ensure initiation of a print operation is allowed. If the default implementation of checkPrintJobAccess is used (that is, that method is not overriden), then this results in a call to the security manager's checkPermission method with a RuntimePermission("queuePrintJob") permission.
Parameters:
  frame - the parent of the print dialog. May not be null.
Parameters:
  jobtitle - the title of the PrintJob. A null title is equivalentto "".
Parameters:
  props - a Properties object containing zero or more properties.Properties are not standardized and are not consistent acrossimplementations. Because of this, PrintJobs which require joband page control should use the version of this function whichtakes JobAttributes and PageAttributes objects. This objectmay be updated to reflect the user's job choices on exit. Maybe null. a PrintJob object, or null if theuser cancelled the print job.
throws:
  NullPointerException - if frame is null. This exception isalways thrown when GraphicsEnvironment.isHeadless() returnstrue.
throws:
  SecurityException - if this thread is not allowed to initiate aprint job request
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.PrintJob
See Also:   java.lang.RuntimePermission
since:
   JDK1.1




getPrintJob
public PrintJob getPrintJob(Frame frame, String jobtitle, JobAttributes jobAttributes, PageAttributes pageAttributes)(Code)
Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.

Each actual implementation of this method should first check if there is a security manager installed. If there is, the method should call the security manager's checkPrintJobAccess method to ensure initiation of a print operation is allowed. If the default implementation of checkPrintJobAccess is used (that is, that method is not overriden), then this results in a call to the security manager's checkPermission method with a RuntimePermission("queuePrintJob") permission.
Parameters:
  frame - the parent of the print dialog. May be null if and onlyif jobAttributes is not null and jobAttributes.getDialog()returns JobAttributes.DialogType.NONE orJobAttributes.DialogType.COMMON.
Parameters:
  jobtitle - the title of the PrintJob. A null title is equivalentto "".
Parameters:
  jobAttributes - a set of job attributes which will control thePrintJob. The attributes will be updated to reflect the user'schoices as outlined in the JobAttributes documentation. May benull.
Parameters:
  pageAttributes - a set of page attributes which will control thePrintJob. The attributes will be applied to every page in thejob. The attributes will be updated to reflect the user'schoices as outlined in the PageAttributes documentation. May benull. a PrintJob object, or null if theuser cancelled the print job.
throws:
  NullPointerException - if frame is null and either jobAttributesis null or jobAttributes.getDialog() returnsJobAttributes.DialogType.NATIVE.
throws:
  IllegalArgumentException - if pageAttributes specifies differingcross feed and feed resolutions. Also if this thread hasaccess to the file system and jobAttributes specifiesprint to file, and the specified destination file exists butis a directory rather than a regular file, does not exist butcannot be created, or cannot be opened for any other reason.However in the case of print to file, if a dialog is alsorequested to be displayed then the user will be given anopportunity to select a file and proceed with printing.The dialog will ensure that the selected output fileis valid before returning from this method.

This exception is always thrown when GraphicsEnvironment.isHeadless()returns true.
throws:
  SecurityException - if this thread is not allowed to initiate aprint job request, or if jobAttributes specifies print to file,and this thread is not allowed to access the file system
See Also:   java.awt.PrintJob
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.lang.RuntimePermission
See Also:   java.awt.JobAttributes
See Also:   java.awt.PageAttributes
since:
   1.3




getProperty
public static String getProperty(String key, String defaultValue)(Code)
Gets a property with the specified key and default. This method returns defaultValue if the property is not found.



getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners()(Code)
Returns an array of all the property change listeners registered on this toolkit. all of this toolkit's PropertyChangeListenersor an empty array if no property change listeners are currently registered
since:
   1.4



getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)(Code)
Returns an array of all the PropertyChangeListeners associated with the named property.
Parameters:
  propertyName - the named property all of the PropertyChangeListeners associated withthe named property or an empty array if no such listeners havebeen added
since:
   1.4



getScreenInsets
public Insets getScreenInsets(GraphicsConfiguration gc) throws HeadlessException(Code)
Gets the insets of the screen.
Parameters:
  gc - a GraphicsConfiguration the insets of this toolkit's screen, in pixels.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.4



getScreenResolution
abstract public int getScreenResolution() throws HeadlessException(Code)
Returns the screen resolution in dots-per-inch. this toolkit's screen resolution, in dots-per-inch.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless



getScreenSize
abstract public Dimension getScreenSize() throws HeadlessException(Code)
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. the size of this toolkit's screen, in pixels.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsConfiguration.getBounds
See Also:   java.awt.GraphicsDevice.getDisplayMode
See Also:   java.awt.GraphicsEnvironment.isHeadless



getSystemClipboard
abstract public Clipboard getSystemClipboard() throws HeadlessException(Code)
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 formats specified in the flavormap.properties file, or other file specified by the AWT.DnD.flavorMapFileURL Toolkit property, text returned by the system Clipboard's getTransferData() method is available in the following flavors:

  • DataFlavor.stringFlavor
  • DataFlavor.plainTextFlavor (deprecated)
As with java.awt.datatransfer.StringSelection, if the requested flavor is DataFlavor.plainTextFlavor, or an equivalent flavor, a Reader is returned. Note: The behavior of the system Clipboard's getTransferData() method for DataFlavor.plainTextFlavor, and equivalent DataFlavors, is inconsistent with the definition of DataFlavor.plainTextFlavor . Because of this, support for DataFlavor.plainTextFlavor, and equivalent flavors, is deprecated.

Each actual implementation of this method should first check if there is a security manager installed. If there is, the method should call the security manager's checkSystemClipboardAccess method to ensure it's ok to to access the system clipboard. If the default implementation of checkSystemClipboardAccess is used (that is, that method is not overriden), then this results in a call to the security manager's checkPermission method with an AWTPermission("accessClipboard") permission. the system Clipboard
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
See Also:   java.awt.datatransfer.Clipboard
See Also:   java.awt.datatransfer.StringSelection
See Also:   java.awt.datatransfer.DataFlavor.stringFlavor
See Also:   java.awt.datatransfer.DataFlavor.plainTextFlavor
See Also:   java.io.Reader
See Also:   java.awt.AWTPermission
since:
   JDK1.1




getSystemEventQueue
final public EventQueue getSystemEventQueue()(Code)
Get the application's or applet's EventQueue instance. Depending on the Toolkit implementation, different EventQueues may be returned for different applets. Applets should therefore not assume that the EventQueue instance returned by this method will be shared by other applets or the system.

First, if there is a security manager, its checkAwtEventQueueAccess method is called. If the default implementation of checkAwtEventQueueAccess is used (that is, that method is not overriden), then this results in a call to the security manager's checkPermission method with an AWTPermission("accessEventQueue") permission. the EventQueue object
throws:
  SecurityException - if a security manager exists and its java.lang.SecurityManager.checkAwtEventQueueAccessmethod denies access to the EventQueue
See Also:   java.awt.AWTPermission




getSystemEventQueueImpl
abstract protected EventQueue getSystemEventQueueImpl()(Code)
Gets the application's or applet's EventQueue instance, without checking access. For security reasons, this can only be called from a Toolkit subclass. the EventQueue object



getSystemSelection
public Clipboard getSystemSelection() throws HeadlessException(Code)
Gets the singleton instance of the system selection as a Clipboard object. This allows an application to read and modify the current, system-wide selection.

An application is responsible for updating the system selection whenever the user selects text, using either the mouse or the keyboard. Typically, this is implemented by installing a FocusListener on all Components which support text selection, and, between FOCUS_GAINED and FOCUS_LOST events delivered to that Component, updating the system selection Clipboard when the selection changes inside the Component. Properly updating the system selection ensures that a Java application will interact correctly with native applications and other Java applications running simultaneously on the system. Note that java.awt.TextComponent and javax.swing.text.JTextComponent already adhere to this policy. When using these classes, and their subclasses, developers need not write any additional code.

Some platforms do not support a system selection Clipboard. On those platforms, this method will return null. In such a case, an application is absolved from its responsibility to update the system selection Clipboard as described above.

Each actual implementation of this method should first check if there is a SecurityManager installed. If there is, the method should call the SecurityManager's checkSystemClipboardAccess method to ensure that client code has access the system selection. If the default implementation of checkSystemClipboardAccess is used (that is, if the method is not overridden), then this results in a call to the SecurityManager's checkPermission method with an AWTPermission("accessClipboard") permission. the system selection as a Clipboard, ornull if the native platform does not support asystem selection Clipboard
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.datatransfer.Clipboard
See Also:   java.awt.event.FocusListener
See Also:   java.awt.event.FocusEvent.FOCUS_GAINED
See Also:   java.awt.event.FocusEvent.FOCUS_LOST
See Also:   TextComponent
See Also:   javax.swing.text.JTextComponent
See Also:   AWTPermission
See Also:   GraphicsEnvironment.isHeadless
since:
   1.4




initializeDesktopProperties
protected void initializeDesktopProperties()(Code)
initializeDesktopProperties



isAlwaysOnTopSupported
public boolean isAlwaysOnTopSupported()(Code)
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 Window.isAlwaysOnTopSupported . true, if current toolkit supports the always-on-top mode,otherwise returns false
See Also:   Window.isAlwaysOnTopSupported
See Also:   Window.setAlwaysOnTop(boolean)
since:
   1.6



isDynamicLayoutActive
public boolean isDynamicLayoutActive() throws HeadlessException(Code)
Returns whether dynamic layout of Containers on resize is currently active (both set in program ( isDynamicLayoutSet() ) , and supported by the underlying operating system and/or window manager). If dynamic layout is currently inactive then Containers re-layout their components when resizing is completed. As a result the Component.validate() method will be invoked only once per resize. If dynamic layout is currently active then Containers re-layout their components on every native resize event and the validate() method will be invoked each time. The OS/WM support can be queried using the getDesktopProperty("awt.dynamicLayoutSupported") method. true if dynamic layout of Containers on resize iscurrently active, false otherwise.
exception:
  HeadlessException - if the GraphicsEnvironment.isHeadless()method returns true
See Also:   Toolkit.setDynamicLayout(boolean dynamic)
See Also:   Toolkit.isDynamicLayoutSet()
See Also:   Toolkit.getDesktopProperty(String propertyName)
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.4



isDynamicLayoutSet
protected boolean isDynamicLayoutSet() throws HeadlessException(Code)
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"). true if validation of Containers is done dynamically,false if validation is done after resizing is finished.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   Toolkit.setDynamicLayout(boolean dynamic)
See Also:   Toolkit.isDynamicLayoutActive()
See Also:   Toolkit.getDesktopProperty(String propertyName)
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.4



isFrameStateSupported
public boolean isFrameStateSupported(int state) throws HeadlessException(Code)
Returns whether Toolkit supports this state for Frames. This method tells whether the UI concept of, say, maximization or iconification is supported. It will always return false for "compound" states like Frame.ICONIFIED|Frame.MAXIMIZED_VERT. In other words, the rule of thumb is that only queries with a single frame state constant as an argument are meaningful.
Parameters:
  state - one of named frame state constants. true is this frame state is supported bythis Toolkit implementation, false otherwise.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true.
See Also:   java.awt.Frame.setExtendedState
since:
   1.4



isModalExclusionTypeSupported
abstract public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType)(Code)
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 Dialog.ModalExclusionType.NO_EXCLUDE is used instead.
Parameters:
  modalExclusionType - modal exclusion type to be checked for support by this toolkit true, if current toolkit supports given modal exclusiontype, false otherwise
See Also:   java.awt.Dialog.ModalExclusionType
See Also:   java.awt.Window.getModalExclusionType
See Also:   java.awt.Window.setModalExclusionType
since:
   1.6



isModalityTypeSupported
abstract public boolean isModalityTypeSupported(Dialog.ModalityType modalityType)(Code)
Returns whether the given modality type is supported by this toolkit. If a dialog with unsupported modality type is created, then Dialog.ModalityType.MODELESS is used instead.
Parameters:
  modalityType - modality type to be checked for support by this toolkit true, if current toolkit supports given modalitytype, false otherwise
See Also:   java.awt.Dialog.ModalityType
See Also:   java.awt.Dialog.getModalityType
See Also:   java.awt.Dialog.setModalityType
since:
   1.6



lazilyLoadDesktopProperty
protected Object lazilyLoadDesktopProperty(String name)(Code)
an opportunity to lazily evaluate desktop property values.



loadLibraries
static void loadLibraries()(Code)



loadSystemColors
protected void loadSystemColors(int[] systemColors) throws HeadlessException(Code)
Fills in the integer array that is supplied as an argument with the current system color values.
Parameters:
  systemColors - an integer array.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   JDK1.1



mapInputMethodHighlight
abstract public Map<java.awt.font.TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) throws HeadlessException(Code)
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.
Parameters:
  highlight - input method highlight style attribute map, or null
exception:
  HeadlessException - ifGraphicsEnvironment.isHeadless returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.3



notifyAWTEventListeners
void notifyAWTEventListeners(AWTEvent theEvent)(Code)



prepareImage
abstract public boolean prepareImage(Image image, int width, int height, ImageObserver observer)(Code)
Prepares an image for rendering.

If the values of the width and height arguments are both -1, this method prepares the image for rendering on the default screen; otherwise, this method prepares an image for rendering on the default screen at the specified width and height.

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 prepareImage methods.

Information on the flags returned by this method can be found with the definition of the ImageObserver interface.
Parameters:
  image - the image for which to prepare ascreen representation.
Parameters:
  width - the width of the desired screenrepresentation, or -1.
Parameters:
  height - the height of the desired screenrepresentation, or -1.
Parameters:
  observer - the ImageObserverobject to be notified as theimage is being prepared. true if the image has already beenfully prepared; false otherwise.
See Also:   java.awt.Component.prepareImage(java.awt.Imagejava.awt.image.ImageObserver)
See Also:   java.awt.Component.prepareImage(java.awt.Imageintintjava.awt.image.ImageObserver)
See Also:   java.awt.image.ImageObserver




removeAWTEventListener
public void removeAWTEventListener(AWTEventListener listener)(Code)
Removes an AWTEventListener from receiving dispatched AWTEvents.

First, if there is a security manager, its checkPermission method is called with an AWTPermission("listenToAllAWTEvents") permission. This may result in a SecurityException.

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.
Parameters:
  listener - the event listener.
throws:
  SecurityException - if a security manager exists and its checkPermission method doesn't allow the operation.
See Also:   Toolkit.addAWTEventListener
See Also:   Toolkit.getAWTEventListeners
See Also:   SecurityManager.checkPermission
See Also:   java.awt.AWTEvent
See Also:   java.awt.AWTPermission
See Also:   java.awt.event.AWTEventListener
See Also:   java.awt.event.AWTEventListenerProxy
since:
   1.2




removePropertyChangeListener
public void removePropertyChangeListener(String name, PropertyChangeListener pcl)(Code)
Removes the specified property change listener for the named desktop property. If pcl is null, no exception is thrown and no action is performed.
Parameters:
  name - The name of the property to remove
Parameters:
  pcl - The property change listener
since:
   1.2



setDesktopProperty
final protected void setDesktopProperty(String name, Object newValue)(Code)
Sets the named desktop property to the specified value and fires a property change event to notify any listeners that the value has changed.



setDynamicLayout
public void setDynamicLayout(boolean dynamic) throws HeadlessException(Code)
Controls whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete. Use isDynamicLayoutActive() to detect if this feature enabled in this program and is supported by this operating system and/or window manager. Note that this feature is supported not on all platforms, and conversely, that this feature cannot be turned off on some platforms. On these platforms where dynamic layout during resizing is not supported (or is always supported), setting this property has no effect. Note that this feature can be set or unset as a property of the operating system or window manager on some platforms. On such platforms, the dynamic resize property must be set at the operating system or window manager level before this method can take effect. This method does not change support or settings of the underlying operating system or window manager. The OS/WM support can be queried using getDesktopProperty("awt.dynamicLayoutSupported") method.
Parameters:
  dynamic - If true, Containers should re-layout theircomponents as the Container is being resized. If false,the layout will be validated after resizing is completed.
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   Toolkit.isDynamicLayoutSet()
See Also:   Toolkit.isDynamicLayoutActive()
See Also:   Toolkit.getDesktopProperty(String propertyName)
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.4



setLockingKeyState
public void setLockingKeyState(int keyCode, boolean on) throws UnsupportedOperationException(Code)
Sets the state of the given locking key on the keyboard. Valid key codes are java.awt.event.KeyEvent.VK_CAPS_LOCK VK_CAPS_LOCK , java.awt.event.KeyEvent.VK_NUM_LOCK VK_NUM_LOCK , java.awt.event.KeyEvent.VK_SCROLL_LOCK VK_SCROLL_LOCK , and java.awt.event.KeyEvent.VK_KANA_LOCK VK_KANA_LOCK .

Depending on the platform, setting the state of a locking key may involve event processing and therefore may not be immediately observable through getLockingKeyState.
exception:
  java.lang.IllegalArgumentException - if keyCodeis not one of the valid key codes
exception:
  java.lang.UnsupportedOperationException - if the host system doesn'tallow setting the state of this key programmatically, or if the keyboarddoesn't have this key
exception:
  HeadlessException - if GraphicsEnvironment.isHeadless()returns true
See Also:   java.awt.GraphicsEnvironment.isHeadless
since:
   1.3




sync
abstract public void sync()(Code)
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.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.