< prev index next >

modules/graphics/src/main/java/com/sun/glass/ui/View.java

Print this page




  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.glass.ui;
  26 
  27 import com.sun.glass.events.MouseEvent;
  28 import com.sun.glass.events.ViewEvent;
  29 
  30 import java.lang.ref.WeakReference;
  31 import java.security.AccessController;
  32 import java.security.PrivilegedAction;
  33 import java.util.Map;
  34 
  35 public abstract class View {
  36 
  37     public final static int GESTURE_NO_VALUE = Integer.MAX_VALUE;
  38     public final static double GESTURE_NO_DOUBLE_VALUE = Double.NaN;
  39 






  40     final static boolean accessible = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> {
  41         String force = System.getProperty("glass.accessible.force");
  42         if (force != null) return Boolean.parseBoolean(force);
  43 
  44         /* By default accessibility is enabled for Mac 10.9 or greater and Windows 7 or greater. */
  45         try {
  46             String platform = Platform.determinePlatform();
  47             String major = System.getProperty("os.version").replaceFirst("(\\d+)\\.\\d+.*", "$1");
  48             String minor = System.getProperty("os.version").replaceFirst("\\d+\\.(\\d+).*", "$1");
  49             int v = Integer.parseInt(major) * 100 + Integer.parseInt(minor);
  50             return (platform.equals(Platform.MAC) && v >= 1009) ||
  51                    (platform.equals(Platform.WINDOWS) && v >= 601);
  52         } catch (Exception e) {
  53             return false;
  54         }
  55     });
  56 
  57     public static class EventHandler {
  58         public void handleViewEvent(View view, long time, int type) {
  59         }




  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.glass.ui;
  26 
  27 import com.sun.glass.events.MouseEvent;
  28 import com.sun.glass.events.ViewEvent;
  29 
  30 import java.lang.ref.WeakReference;
  31 import java.security.AccessController;
  32 import java.security.PrivilegedAction;
  33 import java.util.Map;
  34 
  35 public abstract class View {
  36 
  37     public final static int GESTURE_NO_VALUE = Integer.MAX_VALUE;
  38     public final static double GESTURE_NO_DOUBLE_VALUE = Double.NaN;
  39 
  40     public final static byte IME_ATTR_INPUT                 = 0x00;
  41     public final static byte IME_ATTR_TARGET_CONVERTED      = 0x01;
  42     public final static byte IME_ATTR_CONVERTED             = 0x02;
  43     public final static byte IME_ATTR_TARGET_NOTCONVERTED   = 0x03;
  44     public final static byte IME_ATTR_INPUT_ERROR           = 0x04;
  45 
  46     final static boolean accessible = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> {
  47         String force = System.getProperty("glass.accessible.force");
  48         if (force != null) return Boolean.parseBoolean(force);
  49 
  50         /* By default accessibility is enabled for Mac 10.9 or greater and Windows 7 or greater. */
  51         try {
  52             String platform = Platform.determinePlatform();
  53             String major = System.getProperty("os.version").replaceFirst("(\\d+)\\.\\d+.*", "$1");
  54             String minor = System.getProperty("os.version").replaceFirst("\\d+\\.(\\d+).*", "$1");
  55             int v = Integer.parseInt(major) * 100 + Integer.parseInt(minor);
  56             return (platform.equals(Platform.MAC) && v >= 1009) ||
  57                    (platform.equals(Platform.WINDOWS) && v >= 601);
  58         } catch (Exception e) {
  59             return false;
  60         }
  61     });
  62 
  63     public static class EventHandler {
  64         public void handleViewEvent(View view, long time, int type) {
  65         }


< prev index next >