< prev index next >

src/java.desktop/share/classes/java/awt/Toolkit.java

Print this page

        

*** 67,77 **** import javax.accessibility.AccessibilityProvider; /** * This class is the abstract superclass of all actual * implementations of the Abstract Window Toolkit. Subclasses of ! * the <code>Toolkit</code> class are used to bind the various components * to particular native toolkit implementations. * <p> * Many GUI events may be delivered to user * asynchronously, if the opposite is not specified explicitly. * As well as --- 67,77 ---- import javax.accessibility.AccessibilityProvider; /** * This class is the abstract superclass of all actual * implementations of the Abstract Window Toolkit. Subclasses of ! * the {@code Toolkit} class are used to bind the various components * to particular native toolkit implementations. * <p> * Many GUI events may be delivered to user * asynchronously, if the opposite is not specified explicitly. * As well as
*** 80,120 **** * the state immediately queried, the returned value may not yet * reflect the requested change. This behavior includes, but is not * limited to: * <ul> * <li>Scrolling to a specified position. ! * <br>For example, calling <code>ScrollPane.setScrollPosition</code> ! * and then <code>getScrollPosition</code> may return an incorrect * value if the original request has not yet been processed. * * <li>Moving the focus from one component to another. * <br>For more information, see * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html#transferTiming">Timing * Focus Transfers</a>, a section in * <a href="http://java.sun.com/docs/books/tutorial/uiswing/">The Swing * Tutorial</a>. * * <li>Making a top-level container visible. ! * <br>Calling <code>setVisible(true)</code> on a <code>Window</code>, ! * <code>Frame</code> or <code>Dialog</code> may occur * asynchronously. * * <li>Setting the size or location of a top-level container. ! * <br>Calls to <code>setSize</code>, <code>setBounds</code> or ! * <code>setLocation</code> on a <code>Window</code>, ! * <code>Frame</code> or <code>Dialog</code> are forwarded * to the underlying window management system and may be * ignored or modified. See {@link java.awt.Window} for * more information. * </ul> * <p> * Most applications should not call any of the methods in this ! * class directly. The methods defined by <code>Toolkit</code> are * the "glue" that joins the platform-independent classes in the ! * <code>java.awt</code> package with their counterparts in ! * <code>java.awt.peer</code>. Some methods defined by ! * <code>Toolkit</code> query the native operating system directly. * * @author Sami Shaio * @author Arthur van Hoff * @author Fred Ecks * @since 1.0 --- 80,120 ---- * the state immediately queried, the returned value may not yet * reflect the requested change. This behavior includes, but is not * limited to: * <ul> * <li>Scrolling to a specified position. ! * <br>For example, calling {@code ScrollPane.setScrollPosition} ! * and then {@code getScrollPosition} may return an incorrect * value if the original request has not yet been processed. * * <li>Moving the focus from one component to another. * <br>For more information, see * <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html#transferTiming">Timing * Focus Transfers</a>, a section in * <a href="http://java.sun.com/docs/books/tutorial/uiswing/">The Swing * Tutorial</a>. * * <li>Making a top-level container visible. ! * <br>Calling {@code setVisible(true)} on a {@code Window}, ! * {@code Frame} or {@code Dialog} may occur * asynchronously. * * <li>Setting the size or location of a top-level container. ! * <br>Calls to {@code setSize}, {@code setBounds} or ! * {@code setLocation} on a {@code Window}, ! * {@code Frame} or {@code Dialog} are forwarded * to the underlying window management system and may be * ignored or modified. See {@link java.awt.Window} for * more information. * </ul> * <p> * Most applications should not call any of the methods in this ! * class directly. The methods defined by {@code Toolkit} are * the "glue" that joins the platform-independent classes in the ! * {@code java.awt} package with their counterparts in ! * {@code java.awt.peer}. Some methods defined by ! * {@code Toolkit} query the native operating system directly. * * @author Sami Shaio * @author Arthur van Hoff * @author Fred Ecks * @since 1.0
*** 245,256 **** } /** * Gets the size of the screen. On systems with multiple displays, the * primary display is used. Multi-screen aware display dimensions are ! * available from <code>GraphicsConfiguration</code> and ! * <code>GraphicsDevice</code>. * @return the size of this toolkit's screen, in pixels. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsConfiguration#getBounds * @see java.awt.GraphicsDevice#getDisplayMode --- 245,256 ---- } /** * Gets the size of the screen. On systems with multiple displays, the * primary display is used. Multi-screen aware display dimensions are ! * available from {@code GraphicsConfiguration} and ! * {@code GraphicsDevice}. * @return the size of this toolkit's screen, in pixels. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsConfiguration#getBounds * @see java.awt.GraphicsDevice#getDisplayMode
*** 269,279 **** public abstract int getScreenResolution() throws HeadlessException; /** * Gets the insets of the screen. ! * @param gc a <code>GraphicsConfiguration</code> * @return the insets of this toolkit's screen, in pixels. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.4 --- 269,279 ---- public abstract int getScreenResolution() throws HeadlessException; /** * Gets the insets of the screen. ! * @param gc a {@code GraphicsConfiguration} * @return the insets of this toolkit's screen, in pixels. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.4
*** 289,306 **** } /** * Determines the color model of this toolkit's screen. * <p> ! * <code>ColorModel</code> 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. * <p> * This toolkit method is called by the ! * <code>getColorModel</code> method ! * of the <code>Component</code> class. * @return the color model of this toolkit's screen. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.image.ColorModel --- 289,306 ---- } /** * Determines the color model of this toolkit's screen. * <p> ! * {@code 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. * <p> * This toolkit method is called by the ! * {@code getColorModel} method ! * of the {@code Component} class. * @return the color model of this toolkit's screen. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.image.ColorModel
*** 330,341 **** /** * Gets the screen device metrics for rendering of the font. * @param font a font * @return the screen metrics of the specified font in this toolkit ! * @deprecated As of JDK version 1.2, replaced by the <code>Font</code> ! * method <code>getLineMetrics</code>. * @see java.awt.font.LineMetrics * @see java.awt.Font#getLineMetrics * @see java.awt.GraphicsEnvironment#getScreenDevices */ @Deprecated --- 330,341 ---- /** * Gets the screen device metrics for rendering of the font. * @param font a font * @return the screen metrics of the specified font in this toolkit ! * @deprecated As of JDK version 1.2, replaced by the {@code Font} ! * method {@code getLineMetrics}. * @see java.awt.font.LineMetrics * @see java.awt.Font#getLineMetrics * @see java.awt.GraphicsEnvironment#getScreenDevices */ @Deprecated
*** 604,629 **** * 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. * <p> * Since the mechanism required to facilitate this sharing of ! * <code>Image</code> 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 {@link #createImage(java.lang.String) createImage} * variant wherever available. * If the image data contained in the specified file changes, ! * the <code>Image</code> 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 {@link Image#flush flush} method on the ! * returned <code>Image</code>. * <p> * This method first checks if there is a security manager installed. * If so, the method calls the security manager's ! * <code>checkRead</code> method with the file specified to ensure * that the access to the image is allowed. * @param filename the name of a file containing pixel data * in a recognized file format. * @return an image which gets its pixel data from * the specified file. --- 604,629 ---- * 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. * <p> * Since the mechanism required to facilitate this sharing of ! * {@code 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 {@link #createImage(java.lang.String) createImage} * variant wherever available. * If the image data contained in the specified file changes, ! * the {@code 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 {@link Image#flush flush} method on the ! * returned {@code Image}. * <p> * This method first checks if there is a security manager installed. * If so, the method calls the security manager's ! * {@code checkRead} method with the file specified to ensure * that the access to the image is allowed. * @param filename the name of a file containing pixel data * in a recognized file format. * @return an image which gets its pixel data from * the specified file.
*** 639,669 **** * 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. * <p> * Since the mechanism required to facilitate this sharing of ! * <code>Image</code> 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 {@link #createImage(java.net.URL) createImage} * variant wherever available. * If the image data stored at the specified URL changes, ! * the <code>Image</code> 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 {@link Image#flush flush} method on the ! * returned <code>Image</code>. * <p> * This method first checks if there is a security manager installed. * If so, the method calls the security manager's ! * <code>checkPermission</code> 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 ! * <code>FilePermission</code> or <code>SocketPermission</code>, ! * the method throws the <code>SecurityException</code> * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission. * @param url the URL to use in fetching the pixel data. * @return an image which gets its pixel data from * the specified URL. --- 639,669 ---- * 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. * <p> * Since the mechanism required to facilitate this sharing of ! * {@code 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 {@link #createImage(java.net.URL) createImage} * variant wherever available. * If the image data stored at the specified URL changes, ! * the {@code 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 {@link Image#flush flush} method on the ! * returned {@code Image}. * <p> * This method first checks if there is a security manager installed. * If so, the method calls the security manager's ! * {@code 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 ! * {@code FilePermission} or {@code SocketPermission}, ! * the method throws the {@code SecurityException} * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission. * @param url the URL to use in fetching the pixel data. * @return an image which gets its pixel data from * the specified URL.
*** 679,689 **** * The returned Image is a new object which will not be shared * with any other caller of this method or its getImage variant. * <p> * This method first checks if there is a security manager installed. * If so, the method calls the security manager's ! * <code>checkRead</code> method with the specified file to ensure * that the image creation is allowed. * @param filename the name of a file containing pixel data * in a recognized file format. * @return an image which gets its pixel data from * the specified file. --- 679,689 ---- * The returned Image is a new object which will not be shared * with any other caller of this method or its getImage variant. * <p> * This method first checks if there is a security manager installed. * If so, the method calls the security manager's ! * {@code checkRead} method with the specified file to ensure * that the image creation is allowed. * @param filename the name of a file containing pixel data * in a recognized file format. * @return an image which gets its pixel data from * the specified file.
*** 698,713 **** * The returned Image is a new object which will not be shared * with any other caller of this method or its getImage variant. * <p> * This method first checks if there is a security manager installed. * If so, the method calls the security manager's ! * <code>checkPermission</code> 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 ! * <code>FilePermission</code> or <code>SocketPermission</code>, ! * the method throws <code>SecurityException</code> * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission. * @param url the URL to use in fetching the pixel data. * @return an image which gets its pixel data from * the specified URL. --- 698,713 ---- * The returned Image is a new object which will not be shared * with any other caller of this method or its getImage variant. * <p> * This method first checks if there is a security manager installed. * If so, the method calls the security manager's ! * {@code 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 ! * {@code FilePermission} or {@code SocketPermission}, ! * the method throws {@code SecurityException} * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission. * @param url the URL to use in fetching the pixel data. * @return an image which gets its pixel data from * the specified URL.
*** 720,754 **** /** * Prepares an image for rendering. * <p> * If the values of the width and height arguments are both ! * <code>-1</code>, 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. * <p> * The image data is downloaded asynchronously in another thread, * and an appropriately scaled screen representation of the image is * generated. * <p> ! * This method is called by components <code>prepareImage</code> * methods. * <p> * Information on the flags returned by this method can be found ! * with the definition of the <code>ImageObserver</code> interface. * @param image the image for which to prepare a * screen representation. * @param width the width of the desired screen ! * representation, or <code>-1</code>. * @param height the height of the desired screen ! * representation, or <code>-1</code>. ! * @param observer the <code>ImageObserver</code> * object to be notified as the * image is being prepared. ! * @return <code>true</code> if the image has already been ! * fully prepared; <code>false</code> otherwise. * @see java.awt.Component#prepareImage(java.awt.Image, * java.awt.image.ImageObserver) * @see java.awt.Component#prepareImage(java.awt.Image, * int, int, java.awt.image.ImageObserver) * @see java.awt.image.ImageObserver --- 720,754 ---- /** * Prepares an image for rendering. * <p> * If the values of the width and height arguments are both ! * {@code -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. * <p> * The image data is downloaded asynchronously in another thread, * and an appropriately scaled screen representation of the image is * generated. * <p> ! * This method is called by components {@code prepareImage} * methods. * <p> * Information on the flags returned by this method can be found ! * with the definition of the {@code ImageObserver} interface. * @param image the image for which to prepare a * screen representation. * @param width the width of the desired screen ! * representation, or {@code -1}. * @param height the height of the desired screen ! * representation, or {@code -1}. ! * @param observer the {@code ImageObserver} * object to be notified as the * image is being prepared. ! * @return {@code true} if the image has already been ! * fully prepared; {@code false} otherwise. * @see java.awt.Component#prepareImage(java.awt.Image, * java.awt.image.ImageObserver) * @see java.awt.Component#prepareImage(java.awt.Image, * int, int, java.awt.image.ImageObserver) * @see java.awt.image.ImageObserver
*** 759,792 **** /** * Indicates the construction status of a specified image that is * being prepared for display. * <p> * If the values of the width and height arguments are both ! * <code>-1</code>, 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. * <p> * This method does not cause the image to begin loading. ! * An application must call <code>prepareImage</code> to force * the loading of an image. * <p> ! * This method is called by the component's <code>checkImage</code> * methods. * <p> * Information on the flags returned by this method can be found ! * with the definition of the <code>ImageObserver</code> interface. * @param image the image whose status is being checked. * @param width the width of the scaled version whose status is ! * being checked, or <code>-1</code>. * @param height the height of the scaled version whose status ! * is being checked, or <code>-1</code>. ! * @param observer the <code>ImageObserver</code> object to be * notified as the image is being prepared. * @return the bitwise inclusive <strong>OR</strong> of the ! * <code>ImageObserver</code> flags for the * image data that is currently available. * @see java.awt.Toolkit#prepareImage(java.awt.Image, * int, int, java.awt.image.ImageObserver) * @see java.awt.Component#checkImage(java.awt.Image, * java.awt.image.ImageObserver) --- 759,792 ---- /** * Indicates the construction status of a specified image that is * being prepared for display. * <p> * If the values of the width and height arguments are both ! * {@code -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. * <p> * This method does not cause the image to begin loading. ! * An application must call {@code prepareImage} to force * the loading of an image. * <p> ! * This method is called by the component's {@code checkImage} * methods. * <p> * Information on the flags returned by this method can be found ! * with the definition of the {@code ImageObserver} interface. * @param image the image whose status is being checked. * @param width the width of the scaled version whose status is ! * being checked, or {@code -1}. * @param height the height of the scaled version whose status ! * is being checked, or {@code -1}. ! * @param observer the {@code ImageObserver} object to be * notified as the image is being prepared. * @return the bitwise inclusive <strong>OR</strong> of the ! * {@code ImageObserver} flags for the * image data that is currently available. * @see java.awt.Toolkit#prepareImage(java.awt.Image, * int, int, java.awt.image.ImageObserver) * @see java.awt.Component#checkImage(java.awt.Image, * java.awt.image.ImageObserver)
*** 838,858 **** public abstract Image createImage(byte[] imagedata, int imageoffset, int imagelength); /** ! * Gets a <code>PrintJob</code> object which is the result of initiating * a print operation on the toolkit's platform. * <p> * 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 <code>checkPrintJobAccess</code> method to * ensure initiation of a print operation is allowed. If the default ! * implementation of <code>checkPrintJobAccess</code> is used (that is, * that method is not overriden), then this results in a call to the ! * security manager's <code>checkPermission</code> method with a <code> ! * RuntimePermission("queuePrintJob")</code> permission. * * @param frame the parent of the print dialog. May not be null. * @param jobtitle the title of the PrintJob. A null title is equivalent * to "". * @param props a Properties object containing zero or more properties. --- 838,858 ---- public abstract Image createImage(byte[] imagedata, int imageoffset, int imagelength); /** ! * Gets a {@code PrintJob} object which is the result of initiating * a print operation on the toolkit's platform. * <p> * 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 {@code checkPrintJobAccess} method to * ensure initiation of a print operation is allowed. If the default ! * implementation of {@code checkPrintJobAccess} is used (that is, * that method is not overriden), then this results in a call to the ! * security manager's {@code checkPermission} method with a ! * {@code RuntimePermission("queuePrintJob")} permission. * * @param frame the parent of the print dialog. May not be null. * @param jobtitle the title of the PrintJob. A null title is equivalent * to "". * @param props a Properties object containing zero or more properties.
*** 860,870 **** * implementations. Because of this, PrintJobs which require job * and page control should use the version of this function which * takes JobAttributes and PageAttributes objects. This object * may be updated to reflect the user's job choices on exit. May * be null. ! * @return a <code>PrintJob</code> object, or <code>null</code> if the * user cancelled the print job. * @throws NullPointerException if frame is null * @throws SecurityException if this thread is not allowed to initiate a * print job request * @see java.awt.GraphicsEnvironment#isHeadless --- 860,870 ---- * implementations. Because of this, PrintJobs which require job * and page control should use the version of this function which * takes JobAttributes and PageAttributes objects. This object * may be updated to reflect the user's job choices on exit. May * be null. ! * @return a {@code PrintJob} object, or {@code null} if the * user cancelled the print job. * @throws NullPointerException if frame is null * @throws SecurityException if this thread is not allowed to initiate a * print job request * @see java.awt.GraphicsEnvironment#isHeadless
*** 874,894 **** */ public abstract PrintJob getPrintJob(Frame frame, String jobtitle, Properties props); /** ! * Gets a <code>PrintJob</code> object which is the result of initiating * a print operation on the toolkit's platform. * <p> * 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 <code>checkPrintJobAccess</code> method to * ensure initiation of a print operation is allowed. If the default ! * implementation of <code>checkPrintJobAccess</code> is used (that is, * that method is not overriden), then this results in a call to the ! * security manager's <code>checkPermission</code> method with a <code> ! * RuntimePermission("queuePrintJob")</code> permission. * * @param frame the parent of the print dialog. May not be null. * @param jobtitle the title of the PrintJob. A null title is equivalent * to "". * @param jobAttributes a set of job attributes which will control the --- 874,894 ---- */ public abstract PrintJob getPrintJob(Frame frame, String jobtitle, Properties props); /** ! * Gets a {@code PrintJob} object which is the result of initiating * a print operation on the toolkit's platform. * <p> * 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 {@code checkPrintJobAccess} method to * ensure initiation of a print operation is allowed. If the default ! * implementation of {@code checkPrintJobAccess} is used (that is, * that method is not overriden), then this results in a call to the ! * security manager's {@code checkPermission} method with a ! * {@code RuntimePermission("queuePrintJob")} permission. * * @param frame the parent of the print dialog. May not be null. * @param jobtitle the title of the PrintJob. A null title is equivalent * to "". * @param jobAttributes a set of job attributes which will control the
*** 898,908 **** * @param pageAttributes a set of page attributes which will control the * PrintJob. The attributes will be applied to every page in the * job. The attributes will be updated to reflect the user's * choices as outlined in the PageAttributes documentation. May be * null. ! * @return a <code>PrintJob</code> object, or <code>null</code> if the * user cancelled the print job. * @throws NullPointerException if frame is null * @throws IllegalArgumentException if pageAttributes specifies differing * cross feed and feed resolutions. Also if this thread has * access to the file system and jobAttributes specifies --- 898,908 ---- * @param pageAttributes a set of page attributes which will control the * PrintJob. The attributes will be applied to every page in the * job. The attributes will be updated to reflect the user's * choices as outlined in the PageAttributes documentation. May be * null. ! * @return a {@code PrintJob} object, or {@code null} if the * user cancelled the print job. * @throws NullPointerException if frame is null * @throws IllegalArgumentException if pageAttributes specifies differing * cross feed and feed resolutions. Also if this thread has * access to the file system and jobAttributes specifies
*** 950,973 **** * with clipboard facilities provided by the native platform. This * clipboard enables data transfer between Java programs and native * applications which use native clipboard facilities. * <p> * In addition to any and all default formats text returned by the system ! * Clipboard's <code>getTransferData()</code> method is available in the * following flavors: * <ul> * <li>DataFlavor.stringFlavor</li> * <li>DataFlavor.plainTextFlavor (<b>deprecated</b>)</li> * </ul> ! * As with <code>java.awt.datatransfer.StringSelection</code>, if the ! * requested flavor is <code>DataFlavor.plainTextFlavor</code>, or an * equivalent flavor, a Reader is returned. <b>Note:</b> The behavior of ! * the system Clipboard's <code>getTransferData()</code> method for <code> ! * DataFlavor.plainTextFlavor</code>, and equivalent DataFlavors, is ! * inconsistent with the definition of <code>DataFlavor.plainTextFlavor ! * </code>. Because of this, support for <code> ! * DataFlavor.plainTextFlavor</code>, and equivalent flavors, is * <b>deprecated</b>. * <p> * 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 {@link SecurityManager#checkPermission --- 950,973 ---- * with clipboard facilities provided by the native platform. This * clipboard enables data transfer between Java programs and native * applications which use native clipboard facilities. * <p> * In addition to any and all default formats text returned by the system ! * Clipboard's {@code getTransferData()} method is available in the * following flavors: * <ul> * <li>DataFlavor.stringFlavor</li> * <li>DataFlavor.plainTextFlavor (<b>deprecated</b>)</li> * </ul> ! * As with {@code java.awt.datatransfer.StringSelection}, if the ! * requested flavor is {@code DataFlavor.plainTextFlavor}, or an * equivalent flavor, a Reader is returned. <b>Note:</b> The behavior of ! * the system Clipboard's {@code getTransferData()} method for ! * {@code DataFlavor.plainTextFlavor}, and equivalent DataFlavors, is ! * inconsistent with the definition of {@code DataFlavor.plainTextFlavor}. ! * Because of this, support for ! * {@code DataFlavor.plainTextFlavor}, and equivalent flavors, is * <b>deprecated</b>. * <p> * 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 {@link SecurityManager#checkPermission
*** 988,1028 **** public abstract Clipboard getSystemClipboard() throws HeadlessException; /** * Gets the singleton instance of the system selection as a ! * <code>Clipboard</code> object. This allows an application to read and * modify the current, system-wide selection. * <p> * 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 ! * <code>FocusListener</code> on all <code>Component</code>s which support ! * text selection, and, between <code>FOCUS_GAINED</code> and ! * <code>FOCUS_LOST</code> events delivered to that <code>Component</code>, ! * updating the system selection <code>Clipboard</code> when the selection ! * changes inside the <code>Component</code>. 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 <code>java.awt.TextComponent</code> and ! * <code>javax.swing.text.JTextComponent</code> already adhere to this * policy. When using these classes, and their subclasses, developers need * not write any additional code. * <p> ! * Some platforms do not support a system selection <code>Clipboard</code>. ! * On those platforms, this method will return <code>null</code>. In such a * case, an application is absolved from its responsibility to update the ! * system selection <code>Clipboard</code> as described above. * <p> * 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 {@link SecurityManager#checkPermission * checkPermission} method to check {@code AWTPermission("accessClipboard")}. * ! * @return the system selection as a <code>Clipboard</code>, or ! * <code>null</code> if the native platform does not support a ! * system selection <code>Clipboard</code> * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * * @see java.awt.datatransfer.Clipboard * @see java.awt.event.FocusListener --- 988,1028 ---- public abstract Clipboard getSystemClipboard() throws HeadlessException; /** * Gets the singleton instance of the system selection as a ! * {@code Clipboard} object. This allows an application to read and * modify the current, system-wide selection. * <p> * 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 ! * {@code FocusListener} on all {@code Component}s which support ! * text selection, and, between {@code FOCUS_GAINED} and ! * {@code FOCUS_LOST} events delivered to that {@code Component}, ! * updating the system selection {@code Clipboard} when the selection ! * changes inside the {@code 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 {@code java.awt.TextComponent} and ! * {@code javax.swing.text.JTextComponent} already adhere to this * policy. When using these classes, and their subclasses, developers need * not write any additional code. * <p> ! * Some platforms do not support a system selection {@code Clipboard}. ! * On those platforms, this method will return {@code null}. In such a * case, an application is absolved from its responsibility to update the ! * system selection {@code Clipboard} as described above. * <p> * 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 {@link SecurityManager#checkPermission * checkPermission} method to check {@code AWTPermission("accessClipboard")}. * ! * @return the system selection as a {@code Clipboard}, or ! * {@code null} if the native platform does not support a ! * system selection {@code Clipboard} * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * * @see java.awt.datatransfer.Clipboard * @see java.awt.event.FocusListener
*** 1048,1064 **** /** * Determines which modifier key is the appropriate accelerator * key for menu shortcuts. * <p> * Menu shortcuts, which are embodied in the ! * <code>MenuShortcut</code> class, are handled by the ! * <code>MenuBar</code> class. * <p> ! * By default, this method returns <code>Event.CTRL_MASK</code>. * Toolkit implementations should override this method if the * <b>Control</b> key isn't the correct key for accelerators. ! * @return the modifier mask on the <code>Event</code> class * that is used for menu shortcuts on this toolkit. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.MenuBar --- 1048,1064 ---- /** * Determines which modifier key is the appropriate accelerator * key for menu shortcuts. * <p> * Menu shortcuts, which are embodied in the ! * {@code MenuShortcut} class, are handled by the ! * {@code MenuBar} class. * <p> ! * By default, this method returns {@code Event.CTRL_MASK}. * Toolkit implementations should override this method if the * <b>Control</b> key isn't the correct key for accelerators. ! * @return the modifier mask on the {@code Event} class * that is used for menu shortcuts on this toolkit. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.MenuBar
*** 1081,1091 **** * {@link java.awt.event.KeyEvent#VK_KANA_LOCK VK_KANA_LOCK}. * * @param keyCode the key code * @return {@code true} if the given key is currently in its "on" state; * otherwise {@code false} ! * @exception java.lang.IllegalArgumentException if <code>keyCode</code> * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow getting the state of this key programmatically, or if the keyboard * doesn't have this key * @exception HeadlessException if GraphicsEnvironment.isHeadless() --- 1081,1091 ---- * {@link java.awt.event.KeyEvent#VK_KANA_LOCK VK_KANA_LOCK}. * * @param keyCode the key code * @return {@code true} if the given key is currently in its "on" state; * otherwise {@code false} ! * @exception java.lang.IllegalArgumentException if {@code keyCode} * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow getting the state of this key programmatically, or if the keyboard * doesn't have this key * @exception HeadlessException if GraphicsEnvironment.isHeadless()
*** 1117,1127 **** * involve event processing and therefore may not be immediately * observable through getLockingKeyState. * * @param keyCode the key code * @param on the state of the key ! * @exception java.lang.IllegalArgumentException if <code>keyCode</code> * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow setting the state of this key programmatically, or if the keyboard * doesn't have this key * @exception HeadlessException if GraphicsEnvironment.isHeadless() --- 1117,1127 ---- * involve event processing and therefore may not be immediately * observable through getLockingKeyState. * * @param keyCode the key code * @param on the state of the key ! * @exception java.lang.IllegalArgumentException if {@code keyCode} * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow setting the state of this key programmatically, or if the keyboard * doesn't have this key * @exception HeadlessException if GraphicsEnvironment.isHeadless()
*** 1161,1171 **** * method to hang. * * @param cursor the image to display when the cursor is activated * @param hotSpot the X and Y of the large cursor's hot spot; the * hotSpot values must be less than the Dimension returned by ! * <code>getBestCursorSize</code> * @param name a localized description of the cursor, for Java Accessibility use * @exception IndexOutOfBoundsException if the hotSpot values are outside * the bounds of the cursor * @return the cursor created * @exception HeadlessException if GraphicsEnvironment.isHeadless() --- 1161,1171 ---- * method to hang. * * @param cursor the image to display when the cursor is activated * @param hotSpot the X and Y of the large cursor's hot spot; the * hotSpot values must be less than the Dimension returned by ! * {@code getBestCursorSize} * @param name a localized description of the cursor, for Java Accessibility use * @exception IndexOutOfBoundsException if the hotSpot values are outside * the bounds of the cursor * @return the cursor created * @exception HeadlessException if GraphicsEnvironment.isHeadless()
*** 1250,1263 **** } } /** * Returns whether Toolkit supports this state for ! * <code>Frame</code>s. This method tells whether the <em>UI * concept</em> of, say, maximization or iconification is * supported. It will always return false for "compound" states ! * like <code>Frame.ICONIFIED|Frame.MAXIMIZED_VERT</code>. * In other words, the rule of thumb is that only queries with a * single frame state constant as an argument are meaningful. * <p>Note that supporting a given concept is a platform- * dependent feature. Due to native limitations the Toolkit * object may report a particular state as supported, however at --- 1250,1263 ---- } } /** * Returns whether Toolkit supports this state for ! * {@code Frame}s. This method tells whether the <em>UI * concept</em> of, say, maximization or iconification is * supported. It will always return false for "compound" states ! * like {@code 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. * <p>Note that supporting a given concept is a platform- * dependent feature. Due to native limitations the Toolkit * object may report a particular state as supported, however at
*** 1278,1292 **** * will be definitely applied. For more information see the * documentation for the {@link Frame#setExtendedState} method. * </ul> * * @param state one of named frame state constants. ! * @return <code>true</code> is this frame state is supported by ! * this Toolkit implementation, <code>false</code> otherwise. * @exception HeadlessException ! * if <code>GraphicsEnvironment.isHeadless()</code> ! * returns <code>true</code>. * @see java.awt.Window#addWindowStateListener * @since 1.4 */ public boolean isFrameStateSupported(int state) throws HeadlessException --- 1278,1292 ---- * will be definitely applied. For more information see the * documentation for the {@link Frame#setExtendedState} method. * </ul> * * @param state one of named frame state constants. ! * @return {@code true} is this frame state is supported by ! * this Toolkit implementation, {@code false} otherwise. * @exception HeadlessException ! * if {@code GraphicsEnvironment.isHeadless()} ! * returns {@code true}. * @see java.awt.Window#addWindowStateListener * @since 1.4 */ public boolean isFrameStateSupported(int state) throws HeadlessException
*** 1429,1439 **** * * <p> If there is a security manager then its * {@link SecurityManager#checkPermission checkPermission} method * is called to check {@code AWTPermission("accessEventQueue")}. * ! * @return the <code>EventQueue</code> object * @throws SecurityException * if a security manager is set and it denies access to * the {@code EventQueue} * @see java.awt.AWTPermission */ --- 1429,1439 ---- * * <p> If there is a security manager then its * {@link SecurityManager#checkPermission checkPermission} method * is called to check {@code AWTPermission("accessEventQueue")}. * ! * @return the {@code EventQueue} object * @throws SecurityException * if a security manager is set and it denies access to * the {@code EventQueue} * @see java.awt.AWTPermission */
*** 1444,1457 **** } return getSystemEventQueueImpl(); } /** ! * Gets the application's or applet's <code>EventQueue</code> * instance, without checking access. For security reasons, ! * this can only be called from a <code>Toolkit</code> subclass. ! * @return the <code>EventQueue</code> object */ protected abstract EventQueue getSystemEventQueueImpl(); /* Accessor method for use by AWT package routines. */ static EventQueue getEventQueue() { --- 1444,1457 ---- } return getSystemEventQueueImpl(); } /** ! * Gets the application's or applet's {@code EventQueue} * instance, without checking access. For security reasons, ! * this can only be called from a {@code Toolkit} subclass. ! * @return the {@code EventQueue} object */ protected abstract EventQueue getSystemEventQueueImpl(); /* Accessor method for use by AWT package routines. */ static EventQueue getEventQueue() {
*** 1662,1673 **** /** * 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 {@link Window#isAlwaysOnTopSupported}. ! * @return <code>true</code>, if current toolkit supports the always-on-top mode, ! * otherwise returns <code>false</code> * @see Window#isAlwaysOnTopSupported * @see Window#setAlwaysOnTop(boolean) * @since 1.6 */ public boolean isAlwaysOnTopSupported() { --- 1662,1673 ---- /** * 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 {@link Window#isAlwaysOnTopSupported}. ! * @return {@code true}, if current toolkit supports the always-on-top mode, ! * otherwise returns {@code false} * @see Window#isAlwaysOnTopSupported * @see Window#setAlwaysOnTop(boolean) * @since 1.6 */ public boolean isAlwaysOnTopSupported() {
*** 1675,1690 **** } /** * Returns whether the given modality type is supported by this toolkit. If * a dialog with unsupported modality type is created, then ! * <code>Dialog.ModalityType.MODELESS</code> is used instead. * * @param modalityType modality type to be checked for support by this toolkit * ! * @return <code>true</code>, if current toolkit supports given modality ! * type, <code>false</code> otherwise * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#getModalityType * @see java.awt.Dialog#setModalityType * --- 1675,1690 ---- } /** * Returns whether the given modality type is supported by this toolkit. If * a dialog with unsupported modality type is created, then ! * {@code Dialog.ModalityType.MODELESS} is used instead. * * @param modalityType modality type to be checked for support by this toolkit * ! * @return {@code true}, if current toolkit supports given modality ! * type, {@code false} otherwise * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#getModalityType * @see java.awt.Dialog#setModalityType *
*** 1693,1708 **** public abstract boolean isModalityTypeSupported(Dialog.ModalityType modalityType); /** * 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 <code>Dialog.ModalExclusionType.NO_EXCLUDE</code> is used instead. * * @param modalExclusionType modal exclusion type to be checked for support by this toolkit * ! * @return <code>true</code>, if current toolkit supports given modal exclusion ! * type, <code>false</code> otherwise * * @see java.awt.Dialog.ModalExclusionType * @see java.awt.Window#getModalExclusionType * @see java.awt.Window#setModalExclusionType * --- 1693,1708 ---- public abstract boolean isModalityTypeSupported(Dialog.ModalityType modalityType); /** * 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 {@code Dialog.ModalExclusionType.NO_EXCLUDE} is used instead. * * @param modalExclusionType modal exclusion type to be checked for support by this toolkit * ! * @return {@code true}, if current toolkit supports given modal exclusion ! * type, {@code false} otherwise * * @see java.awt.Dialog.ModalExclusionType * @see java.awt.Window#getModalExclusionType * @see java.awt.Window#setModalExclusionType *
*** 1737,1756 **** return localL; } /** * Adds an AWTEventListener to receive all AWTEvents dispatched ! * system-wide that conform to the given <code>eventMask</code>. * <p> ! * First, if there is a security manager, its <code>checkPermission</code> * method is called with an ! * <code>AWTPermission("listenToAllAWTEvents")</code> permission. * This may result in a SecurityException. * <p> ! * <code>eventMask</code> is a bitmask of event types to receive. * It is constructed by bitwise OR-ing together the event masks ! * defined in <code>AWTEvent</code>. * <p> * 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. --- 1737,1756 ---- return localL; } /** * Adds an AWTEventListener to receive all AWTEvents dispatched ! * system-wide that conform to the given {@code eventMask}. * <p> ! * First, if there is a security manager, its {@code checkPermission} * method is called with an ! * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * <p> ! * {@code eventMask} is a bitmask of event types to receive. * It is constructed by bitwise OR-ing together the event masks ! * defined in {@code AWTEvent}. * <p> * 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.
*** 1759,1769 **** * * @param listener the event listener. * @param eventMask the bitmask of event types to receive * @throws SecurityException * if a security manager exists and its ! * <code>checkPermission</code> method doesn't allow the operation. * @see #removeAWTEventListener * @see #getAWTEventListeners * @see SecurityManager#checkPermission * @see java.awt.AWTEvent * @see java.awt.AWTPermission --- 1759,1769 ---- * * @param listener the event listener. * @param eventMask the bitmask of event types to receive * @throws SecurityException * if a security manager exists and its ! * {@code checkPermission} method doesn't allow the operation. * @see #removeAWTEventListener * @see #getAWTEventListeners * @see SecurityManager#checkPermission * @see java.awt.AWTEvent * @see java.awt.AWTPermission
*** 1813,1825 **** } /** * Removes an AWTEventListener from receiving dispatched AWTEvents. * <p> ! * First, if there is a security manager, its <code>checkPermission</code> * method is called with an ! * <code>AWTPermission("listenToAllAWTEvents")</code> permission. * This may result in a SecurityException. * <p> * Note: event listener use is not recommended for normal * application use, but are intended solely to support special * purpose facilities including support for accessibility, --- 1813,1825 ---- } /** * Removes an AWTEventListener from receiving dispatched AWTEvents. * <p> ! * First, if there is a security manager, its {@code checkPermission} * method is called with an ! * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * <p> * Note: event listener use is not recommended for normal * application use, but are intended solely to support special * purpose facilities including support for accessibility,
*** 1828,1838 **** * If listener is null, no exception is thrown and no action is performed. * * @param listener the event listener. * @throws SecurityException * if a security manager exists and its ! * <code>checkPermission</code> method doesn't allow the operation. * @see #addAWTEventListener * @see #getAWTEventListeners * @see SecurityManager#checkPermission * @see java.awt.AWTEvent * @see java.awt.AWTPermission --- 1828,1838 ---- * If listener is null, no exception is thrown and no action is performed. * * @param listener the event listener. * @throws SecurityException * if a security manager exists and its ! * {@code checkPermission} method doesn't allow the operation. * @see #addAWTEventListener * @see #getAWTEventListeners * @see SecurityManager#checkPermission * @see java.awt.AWTEvent * @see java.awt.AWTPermission
*** 1882,1908 **** } ci--; return calls[ci]; } /** ! * Returns an array of all the <code>AWTEventListener</code>s * registered on this toolkit. * If there is a security manager, its {@code checkPermission} * method is called with an * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * Listeners can be returned ! * within <code>AWTEventListenerProxy</code> 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. * ! * @return all of the <code>AWTEventListener</code>s or an empty * array if no listeners are currently registered * @throws SecurityException * if a security manager exists and its ! * <code>checkPermission</code> method doesn't allow the operation. * @see #addAWTEventListener * @see #removeAWTEventListener * @see SecurityManager#checkPermission * @see java.awt.AWTEvent * @see java.awt.AWTPermission --- 1882,1908 ---- } ci--; return calls[ci]; } /** ! * Returns an array of all the {@code AWTEventListener}s * registered on this toolkit. * If there is a security manager, its {@code checkPermission} * method is called with an * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * Listeners can be returned ! * within {@code 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. * ! * @return all of the {@code AWTEventListener}s or an empty * array if no listeners are currently registered * @throws SecurityException * if a security manager exists and its ! * {@code checkPermission} method doesn't allow the operation. * @see #addAWTEventListener * @see #removeAWTEventListener * @see SecurityManager#checkPermission * @see java.awt.AWTEvent * @see java.awt.AWTPermission
*** 1930,1960 **** return ret; } } /** ! * Returns an array of all the <code>AWTEventListener</code>s * registered on this toolkit which listen to all of the event * types specified in the {@code eventMask} argument. * If there is a security manager, its {@code checkPermission} * method is called with an * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * Listeners can be returned ! * within <code>AWTEventListenerProxy</code> 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. * * @param eventMask the bitmask of event types to listen for ! * @return all of the <code>AWTEventListener</code>s registered * on this toolkit for the specified * event types, or an empty array if no such listeners * are currently registered * @throws SecurityException * if a security manager exists and its ! * <code>checkPermission</code> method doesn't allow the operation. * @see #addAWTEventListener * @see #removeAWTEventListener * @see SecurityManager#checkPermission * @see java.awt.AWTEvent * @see java.awt.AWTPermission --- 1930,1960 ---- return ret; } } /** ! * Returns an array of all the {@code AWTEventListener}s * registered on this toolkit which listen to all of the event * types specified in the {@code eventMask} argument. * If there is a security manager, its {@code checkPermission} * method is called with an * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * Listeners can be returned ! * within {@code 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. * * @param eventMask the bitmask of event types to listen for ! * @return all of the {@code AWTEventListener}s registered * on this toolkit for the specified * event types, or an empty array if no such listeners * are currently registered * @throws SecurityException * if a security manager exists and its ! * {@code checkPermission} method doesn't allow the operation. * @see #addAWTEventListener * @see #removeAWTEventListener * @see SecurityManager#checkPermission * @see java.awt.AWTEvent * @see java.awt.AWTPermission
*** 2165,2177 **** * 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. * @param highlight input method highlight ! * @return style attribute map, or <code>null</code> * @exception HeadlessException if ! * <code>GraphicsEnvironment.isHeadless</code> returns true * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.3 */ public abstract Map<java.awt.font.TextAttribute,?> mapInputMethodHighlight(InputMethodHighlight highlight) --- 2165,2177 ---- * 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. * @param highlight input method highlight ! * @return style attribute map, or {@code null} * @exception HeadlessException if ! * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.3 */ public abstract Map<java.awt.font.TextAttribute,?> mapInputMethodHighlight(InputMethodHighlight highlight)
< prev index next >