/[classpath]/classpath/java/awt/event/InputEvent.java
ViewVC logotype

Diff of /classpath/java/awt/event/InputEvent.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6.2.4 by gnu_andrew, Tue Aug 2 20:12:15 2005 UTC revision 1.6.2.5 by gnu_andrew, Tue Sep 20 18:46:26 2005 UTC
# Line 197  public abstract class InputEvent extends Line 197  public abstract class InputEvent extends
197    private final long when;    private final long when;
198    
199    /**    /**
200     * The modifiers in effect for this event. Package visible for use by     * The old-style modifiers in effect for this event. Package visible
201     * subclasses. The old style (bitmask 0x3f) should not be mixed with the     * for use by subclasses. The old style (bitmask 0x3f) should not be
202     * new style (bitmasks 0xffffffc0).     * mixed with the new style (bitmasks 0xffffffc0).
203     *     *
204     * @see #getModifiers()     * @see #getModifiers()
205     * @see MouseEvent     * @see MouseEvent
206     * @serial the modifier state, stored in the new style     * @serial the modifier state, stored in the old style
207     */     */
208    int modifiers;    int modifiers;
209    
210    /**    /**
211       * The new-style modifiers in effect for this event. Package visible
212       * for use by subclasses. The old style (bitmask 0x3f) should not be
213       * mixed with the new style (bitmasks 0xffffffc0).
214       *
215       * @see #getModifiersEx()
216       * @see MouseEvent
217       * @serial the modifier state, stored in the new style
218       */
219      int modifiersEx;
220    
221      /**
222     * Initializes a new instance of <code>InputEvent</code> with the specified     * Initializes a new instance of <code>InputEvent</code> with the specified
223     * source, id, timestamp, and modifiers. Note that an invalid id leads to     * source, id, timestamp, and modifiers. Note that an invalid id leads to
224     * unspecified results.     * unspecified results.
# Line 222  public abstract class InputEvent extends Line 233  public abstract class InputEvent extends
233    {    {
234      super(source, id);      super(source, id);
235      this.when = when;      this.when = when;
236      this.modifiers = EventModifier.extend(modifiers);      this.modifiers = modifiers & EventModifier.OLD_MASK;
237        this.modifiersEx = modifiers & EventModifier.NEW_MASK;
238    }    }
239    
240    /**    /**
# Line 232  public abstract class InputEvent extends Line 244  public abstract class InputEvent extends
244     */     */
245    public boolean isShiftDown()    public boolean isShiftDown()
246    {    {
247      return (modifiers & SHIFT_DOWN_MASK) != 0;      return ((modifiers & SHIFT_MASK) != 0)
248          || ((modifiersEx & SHIFT_DOWN_MASK) != 0);
249    }    }
250    
251    /**    /**
# Line 243  public abstract class InputEvent extends Line 256  public abstract class InputEvent extends
256     */     */
257    public boolean isControlDown()    public boolean isControlDown()
258    {    {
259      return (modifiers & CTRL_DOWN_MASK) != 0;      return ((modifiers & CTRL_MASK) != 0)
260          || ((modifiersEx & CTRL_DOWN_MASK) != 0);
261    }    }
262    
263    /**    /**
# Line 253  public abstract class InputEvent extends Line 267  public abstract class InputEvent extends
267     */     */
268    public boolean isMetaDown()    public boolean isMetaDown()
269    {    {
270      return (modifiers & META_DOWN_MASK) != 0;      return ((modifiers & META_MASK) != 0)
271          || ((modifiersEx & META_DOWN_MASK) != 0);
272    }    }
273    
274    /**    /**
# Line 263  public abstract class InputEvent extends Line 278  public abstract class InputEvent extends
278     */     */
279    public boolean isAltDown()    public boolean isAltDown()
280    {    {
281      return (modifiers & ALT_DOWN_MASK) != 0;      return ((modifiers & ALT_MASK) != 0)
282          || ((modifiersEx & ALT_DOWN_MASK) != 0);
283    }    }
284    
285    /**    /**
# Line 274  public abstract class InputEvent extends Line 290  public abstract class InputEvent extends
290     */     */
291    public boolean isAltGraphDown()    public boolean isAltGraphDown()
292    {    {
293      return (modifiers & ALT_GRAPH_DOWN_MASK) != 0;      return ((modifiers & ALT_GRAPH_MASK) != 0)
294          || ((modifiersEx & ALT_GRAPH_DOWN_MASK) != 0);
295    }    }
296    
297    /**    /**
# Line 300  public abstract class InputEvent extends Line 317  public abstract class InputEvent extends
317     */     */
318    public int getModifiers()    public int getModifiers()
319    {    {
320      return EventModifier.revert(modifiers);      return modifiers;
321    }    }
322    
323    /**    /**
# Line 321  public abstract class InputEvent extends Line 338  public abstract class InputEvent extends
338     */     */
339    public int getModifiersEx()    public int getModifiersEx()
340    {    {
341      return modifiers;      return modifiersEx;
342    }    }
343    
344    /**    /**

Legend:
Removed from v.1.6.2.4  
changed lines
  Added in v.1.6.2.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26