jdk/src/share/classes/sun/awt/SunToolkit.java
changeset 2810 fa49c6a06baf
parent 2648 aa45a227fce3
child 3084 67ca55732362
equal deleted inserted replaced
2809:b373581f6507 2810:fa49c6a06baf
    86     private static Field menuComponentAppContextField;
    86     private static Field menuComponentAppContextField;
    87     private static Field isPostedField;
    87     private static Field isPostedField;
    88     /* The key to put()/get() the PostEventQueue into/from the AppContext.
    88     /* The key to put()/get() the PostEventQueue into/from the AppContext.
    89      */
    89      */
    90     private static final String POST_EVENT_QUEUE_KEY = "PostEventQueue";
    90     private static final String POST_EVENT_QUEUE_KEY = "PostEventQueue";
       
    91 
       
    92     /**
       
    93      * Number of buttons.
       
    94      * By default it's taken from the system. If system value does not
       
    95      * fit into int type range, use our own MAX_BUTTONS_SUPPORT value.
       
    96      */
       
    97     protected static int numberOfButtons = 0;
       
    98 
       
    99 
       
   100     /* XFree standard mention 24 buttons as maximum:
       
   101      * http://www.xfree86.org/current/mouse.4.html
       
   102      * We workaround systems supporting more than 24 buttons.
       
   103      * Otherwise, we have to use long type values as masks
       
   104      * which leads to API change.
       
   105      * InputEvent.BUTTON_DOWN_MASK may contain only 21 masks due to
       
   106      * the 4-bytes limit for the int type. (CR 6799099)
       
   107      * One more bit is reserved for FIRST_HIGH_BIT.
       
   108      */
       
   109     public final static int MAX_BUTTONS_SUPPORTED = 20;
    91 
   110 
    92     public SunToolkit() {
   111     public SunToolkit() {
    93         /* If awt.threadgroup is set to class name the instance of
   112         /* If awt.threadgroup is set to class name the instance of
    94          * this class is created (should be subclass of ThreadGroup)
   113          * this class is created (should be subclass of ThreadGroup)
    95          * and EventDispatchThread is created inside of it
   114          * and EventDispatchThread is created inside of it
  2077      */
  2096      */
  2078     public boolean needUpdateWindow() {
  2097     public boolean needUpdateWindow() {
  2079         return false;
  2098         return false;
  2080     }
  2099     }
  2081 
  2100 
       
  2101     /**
       
  2102      * Descendants of the SunToolkit should override and put their own logic here.
       
  2103      */
       
  2104     public int getNumberOfButtons(){
       
  2105         return 3;
       
  2106     }
  2082 } // class SunToolkit
  2107 } // class SunToolkit
  2083 
  2108 
  2084 
  2109 
  2085 /*
  2110 /*
  2086  * PostEventQueue is a Thread that runs in the same AppContext as the
  2111  * PostEventQueue is a Thread that runs in the same AppContext as the