This document describes additional changes to the specification of JSR 337 which is defined by the Final Release in March 2014 and amended by the following Maintenance Releases:
When specification text is provided, insertions are shown on a light green background and deletions are shown struck through on a light red background. Links to pages outside of those explicitly changed by this specification may not be functional.
Send comments to java-se-mr-spec-comments@openjdk.org.
| Contents | |
|---|---|
| 1 | Version Identification |
| 2 | Modern Desktop Support |
There is no change to the values returned by the system properties
java.specification.version and
java.vm.specification.version. They continue to report
"1.8". The value returned by the system property
java.specification.maintenance.version is
"6".
Update the java.awt.Robot specification to describe how it
may operate in modern desktop environments which do not automatically
give applications full access to the screen.
Append the following text to the class specification:
Platforms and desktop environments may impose restrictions or limitations on the access required to implement all functionality in the Robot class. For example:
The Robot API specification requires that approvals for these be granted for full operation. If they are not granted, the API will be degraded as discussed here. Relevant specific API methods may document more specific limitations and requirements. Depending on the policies of the desktop environment, the approvals mentioned above may:
When such approvals need to given interactively, it may impede the normal operation of the application until approved, and if approval is denied or not possible, or cannot be made persistent then it will degrade the functionality of this class and in turn any part of the operation of the application which is dependent on it.
Augment the specification of mouseMove(int, int) to describe
acceptable behaviour:
The mouse pointer may not visually move on some platforms, while the subsequent mousePress and mouseRelease can be delivered to the correct location
Update the specification of getPixelColor(int, int) to allow
for degraded behaviour if the required permissions are missing:
Returns the color of a pixel at the given screen coordinates.
If the desktop environment requires that permissions be granted to
capture screen content, and the required permissions are not granted,
then a SecurityException may be thrown, or the content of
the returned Color is undefined.
It is recommended to avoid calling this method on the AWT Event Dispatch Thread since screen capture may be a lengthy operation, particularly if acquiring permissions is needed and involves user interaction.
SecurityException may be
thrown:
SecurityException - if readDisplayPixels
permission is not granted, or access to the screen is denied by the
desktop environment
Similarly, update the specification of
createScreenCapture(Rectangle) to allow for degraded
behaviour if the required permissions are missing:
Creates an image containing pixels read from the screen. This image does not include the mouse cursor.
If the desktop environment requires that permissions be granted to
capture screen content, and the required permissions are not granted,
then a SecurityException may be thrown, or the content of
the returned BufferedImage is undefined.
It is recommended to avoid calling this method on the AWT Event Dispatch Thread since screen capture may be a lengthy operation, particularly if acquiring permissions is needed and involves user interaction.
SecurityException:
SecurityException - if readDisplayPixels
permission is not
granted,
or access to the screen is denied by the desktop environment
The Change Specification Request (CSR) associated with these changes is
8331038. This
specification aligns with the
corresponding specification
in the
Final Release of Java SE 21
with the exception of changes to
createMultiResolutionScreenCapture(Rectangle) which does not
exist in Java SE 8.