1 /* Copyright (C) 1999, 2000 Free Software Foundation
3 This file is part of libjava.
5 This software is copyrighted work licensed under the terms of the
6 Libjava License. Please consult the file "LIBJAVA_LICENSE" for
12 * Written using on-line Java Platform 1.2 API Specification, as well
13 * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
14 * Status: Believed complete and correct.
17 public class Event implements java.io.Serializable
19 public static final int SHIFT_MASK = 1,
24 public static final int ACTION_EVENT = 1001,
48 KEY_ACTION_RELEASE = 404,
69 SCROLL_ABSOLUTE = 605,
72 SCROLL_LINE_DOWN = 602,
75 SCROLL_PAGE_DOWN = 604,
79 WINDOW_DEICONIFY = 204,
86 public int clickCount;
87 boolean consumed; // Required by serialization spec.
97 public Event (Object target, int id, Object arg)
100 this.target = target;
104 public Event (Object target, long when, int id, int x, int y, int key,
107 this.target = target;
113 this.modifiers = modifiers;
116 public Event (Object target, long when, int id, int x, int y, int key,
117 int modifiers, Object arg)
119 this (target, when, id, x, y, key, modifiers);
123 public boolean controlDown ()
125 return ((modifiers & CTRL_MASK) == 0 ? false : true);
128 public boolean metaDown ()
130 return ((modifiers & META_MASK) == 0 ? false : true);
133 protected String paramString ()
135 return "id=" + id + ",x=" + x + ",y=" + y + "target=" + target;
138 public boolean shiftDown()
140 return ((modifiers & SHIFT_MASK) == 0 ? false : true);
143 public String toString()
145 return getClass().getName() + "[" + paramString() + "]";
148 public void translate (int x, int y)