changeset 7354:a4b44bda860f

RT-37702: [Accessibility] enable a11y by default on supported platforms
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Wed, 25 Jun 2014 09:21:15 -0700
parents a193ba23a602
children 758e1f790da3
files modules/graphics/src/main/java/com/sun/glass/ui/View.java
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/View.java	Wed Jun 25 18:09:35 2014 +0400
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/View.java	Wed Jun 25 09:21:15 2014 -0700
@@ -39,20 +39,17 @@
     public final static double GESTURE_NO_DOUBLE_VALUE = Double.NaN;
 
     final static boolean accessible = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> {
-        boolean force = Boolean.getBoolean("javafx.accessible.force");
-        if (force) return true;
+        String force = System.getProperty("glass.accessible.force");
+        if (force != null) return Boolean.parseBoolean(force);
 
-        /* Only enable accessibility for Mac 10.9 and Windows 8 or greater.
-         * All other platforms must use the force flag.
-         */
+        /* By default accessibility is enabled for Mac 10.9 or greater and Windows 7 or greater. */
         try {
             String platform = Platform.determinePlatform();
-            String version = System.getProperty("os.version").replaceFirst("(\\d+\\.\\d+).*", "$1");
-            float v = Float.parseFloat(version);
-            boolean allowedPlatform = (platform.equals(Platform.MAC) && v >= 10.9f) ||
-                                      (platform.equals(Platform.WINDOWS) && v >= 6.2f);
-
-            return allowedPlatform ? Boolean.getBoolean("javafx.accessible") : false;
+            String major = System.getProperty("os.version").replaceFirst("(\\d+)\\.\\d+.*", "$1");
+            String minor = System.getProperty("os.version").replaceFirst("\\d+\\.(\\d+).*", "$1");
+            int v = Integer.parseInt(major) * 100 + Integer.parseInt(minor);
+            return (platform.equals(Platform.MAC) && v >= 1009) ||
+                   (platform.equals(Platform.WINDOWS) && v >= 601);
         } catch (Exception e) {
             return false;
         }