src/java.desktop/share/classes/java/awt/event/MouseEvent.java

Print this page




 606      * @param popupTrigger A boolean that equals {@code true} if this event
 607      *                     is a trigger for a popup menu
 608      * @throws IllegalArgumentException if {@code source} is null
 609      * @see #getSource()
 610      * @see #getID()
 611      * @see #getWhen()
 612      * @see #getModifiers()
 613      * @see #getX()
 614      * @see #getY()
 615      * @see #getClickCount()
 616      * @see #isPopupTrigger()
 617      */
 618      public MouseEvent(Component source, int id, long when, int modifiers,
 619                       int x, int y, int clickCount, boolean popupTrigger) {
 620         this(source, id, when, modifiers, x, y, clickCount, popupTrigger, NOBUTTON);
 621      }
 622 
 623 
 624     /* if the button is an extra button and it is released or clicked then in Xsystem its state
 625        is not modified. Exclude this button number from ExtModifiers mask.*/
 626     transient private boolean shouldExcludeButtonFromExtModifiers = false;
 627 
 628     /**
 629      * {@inheritDoc}
 630      */
 631     public int getModifiersEx() {
 632         int tmpModifiers = modifiers;
 633         if (shouldExcludeButtonFromExtModifiers) {
 634             tmpModifiers &= ~(InputEvent.getMaskForButton(getButton()));
 635         }
 636         return tmpModifiers & ~JDK_1_3_MODIFIERS;
 637     }
 638 
 639     /**
 640      * Constructs a {@code MouseEvent} object with the
 641      * specified source component,
 642      * type, time, modifiers, coordinates, absolute coordinates, click count, popupTrigger flag,
 643      * and button number.
 644      * <p>
 645      * Creating an invalid event (such
 646      * as by using more than one of the old _MASKs, or modifier/button




 606      * @param popupTrigger A boolean that equals {@code true} if this event
 607      *                     is a trigger for a popup menu
 608      * @throws IllegalArgumentException if {@code source} is null
 609      * @see #getSource()
 610      * @see #getID()
 611      * @see #getWhen()
 612      * @see #getModifiers()
 613      * @see #getX()
 614      * @see #getY()
 615      * @see #getClickCount()
 616      * @see #isPopupTrigger()
 617      */
 618      public MouseEvent(Component source, int id, long when, int modifiers,
 619                       int x, int y, int clickCount, boolean popupTrigger) {
 620         this(source, id, when, modifiers, x, y, clickCount, popupTrigger, NOBUTTON);
 621      }
 622 
 623 
 624     /* if the button is an extra button and it is released or clicked then in Xsystem its state
 625        is not modified. Exclude this button number from ExtModifiers mask.*/
 626     private transient boolean shouldExcludeButtonFromExtModifiers = false;
 627 
 628     /**
 629      * {@inheritDoc}
 630      */
 631     public int getModifiersEx() {
 632         int tmpModifiers = modifiers;
 633         if (shouldExcludeButtonFromExtModifiers) {
 634             tmpModifiers &= ~(InputEvent.getMaskForButton(getButton()));
 635         }
 636         return tmpModifiers & ~JDK_1_3_MODIFIERS;
 637     }
 638 
 639     /**
 640      * Constructs a {@code MouseEvent} object with the
 641      * specified source component,
 642      * type, time, modifiers, coordinates, absolute coordinates, click count, popupTrigger flag,
 643      * and button number.
 644      * <p>
 645      * Creating an invalid event (such
 646      * as by using more than one of the old _MASKs, or modifier/button