src/share/classes/java/awt/event/InputEvent.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 231,241 ****
* It returns masks for a limited number of buttons only. The maximum number is
* implementation dependent and may vary.
* This limit is defined by the relevant number
* of buttons that may hypothetically exist on the mouse but it is greater than the
* {@link java.awt.MouseInfo#getNumberOfButtons() MouseInfo.getNumberOfButtons()}.
! * <p>
* @throws IllegalArgumentException if {@code button} is less than zero or greater than the number
* of button masks reserved for buttons
* @since 7.0
* @see java.awt.MouseInfo#getNumberOfButtons()
* @see Toolkit#areExtraMouseButtonsEnabled()
--- 231,242 ----
* It returns masks for a limited number of buttons only. The maximum number is
* implementation dependent and may vary.
* This limit is defined by the relevant number
* of buttons that may hypothetically exist on the mouse but it is greater than the
* {@link java.awt.MouseInfo#getNumberOfButtons() MouseInfo.getNumberOfButtons()}.
! *
! * @return a mask for an existing mouse button.
* @throws IllegalArgumentException if {@code button} is less than zero or greater than the number
* of button masks reserved for buttons
* @since 7.0
* @see java.awt.MouseInfo#getNumberOfButtons()
* @see Toolkit#areExtraMouseButtonsEnabled()
*** 366,418 ****
--- 367,426 ----
return b;
}
/**
* Returns whether or not the Shift modifier is down on this event.
+ * @return whether or not the Shift modifier is down on this event
*/
public boolean isShiftDown() {
return (modifiers & SHIFT_MASK) != 0;
}
/**
* Returns whether or not the Control modifier is down on this event.
+ * @return whether or not the Control modifier is down on this event
*/
public boolean isControlDown() {
return (modifiers & CTRL_MASK) != 0;
}
/**
* Returns whether or not the Meta modifier is down on this event.
+ * @return whether or not the Meta modifier is down on this event
*/
public boolean isMetaDown() {
return (modifiers & META_MASK) != 0;
}
/**
* Returns whether or not the Alt modifier is down on this event.
+ * @return whether or not the Alt modifier is down on this event
*/
public boolean isAltDown() {
return (modifiers & ALT_MASK) != 0;
}
/**
* Returns whether or not the AltGraph modifier is down on this event.
+ * @return whether or not the AltGraph modifier is down on this event
*/
public boolean isAltGraphDown() {
return (modifiers & ALT_GRAPH_MASK) != 0;
}
/**
* Returns the difference in milliseconds between the timestamp of when this event occurred and
* midnight, January 1, 1970 UTC.
+ * @return the difference in milliseconds between the timestamp and midnight, January 1, 1970 UTC
*/
public long getWhen() {
return when;
}
/**
* Returns the modifier mask for this event.
+ * @return the modifier mask for this event
*/
public int getModifiers() {
return modifiers & (JDK_1_3_MODIFIERS | HIGH_MODIFIERS);
}
*** 449,458 ****
--- 457,467 ----
* ...
* }
* </PRE>
* The above code will work even if new modifiers are added.
*
+ * @return the extended modifier mask for this event
* @since 1.4
*/
public int getModifiersEx() {
return modifiers & ~JDK_1_3_MODIFIERS;
}
*** 465,474 ****
--- 474,484 ----
consumed = true;
}
/**
* Returns whether or not this event has been consumed.
+ * @return whether or not this event has been consumed
* @see #consume
*/
public boolean isConsumed() {
return consumed;
}
*** 485,494 ****
--- 495,507 ----
* Note that passing negative parameter is incorrect,
* and will cause the returning an unspecified string.
* Zero parameter means that no modifiers were passed and will
* cause the returning an empty string.
*
+ * @return a String describing the extended modifier keys and
+ * mouse buttons
+ *
* @param modifiers a modifier mask describing the extended
* modifier keys and mouse buttons for the event
* @return a text description of the combination of extended
* modifier keys and mouse buttons that were held down
* during the event.