jdk/src/share/classes/java/awt/Robot.java
changeset 2810 fa49c6a06baf
parent 1962 6c293d33645b
child 3232 aacdc74b37d2
equal deleted inserted replaced
2809:b373581f6507 2810:fa49c6a06baf
    94             throw new AWTException("headless environment");
    94             throw new AWTException("headless environment");
    95         }
    95         }
    96         init(GraphicsEnvironment.getLocalGraphicsEnvironment()
    96         init(GraphicsEnvironment.getLocalGraphicsEnvironment()
    97             .getDefaultScreenDevice());
    97             .getDefaultScreenDevice());
    98         int tmpMask = 0;
    98         int tmpMask = 0;
       
    99 
    99         if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){
   100         if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){
   100             for (int i = 0; i < peer.getNumberOfButtons(); i++){
   101             if (Toolkit.getDefaultToolkit() instanceof SunToolkit) {
   101                 tmpMask |= InputEvent.getMaskForButton(i+1);
   102                 final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
       
   103                 for (int i = 0; i < buttonsNumber; i++){
       
   104                     tmpMask |= InputEvent.getMaskForButton(i+1);
       
   105                 }
   102             }
   106             }
   103         }
   107         }
   104         tmpMask |= InputEvent.BUTTON1_MASK|
   108         tmpMask |= InputEvent.BUTTON1_MASK|
   105             InputEvent.BUTTON2_MASK|
   109             InputEvent.BUTTON2_MASK|
   106             InputEvent.BUTTON3_MASK|
   110             InputEvent.BUTTON3_MASK|