1. /*
  2. * @(#)Event.java 1.65 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt;
  8. import java.awt.event.*;
  9. import java.io.*;
  10. /**
  11. * <code>Event</code> is a platform-independent class that
  12. * encapsulates events from the platform's Graphical User
  13. * Interface in the Java 1.0 event model. In Java 1.1
  14. * and later versions, the <code>Event</code> class is maintained
  15. * only for backwards compatibilty. The information in this
  16. * class description is provided to assist programmers in
  17. * converting Java 1.0 programs to the new event model.
  18. * <p>
  19. * In the Java 1.0 event model, an event contains an
  20. * {@link Event#id} field
  21. * that indicates what type of event it is and which other
  22. * <code>Event</code> variables are relevant for the event.
  23. * <p>
  24. * For keyboard events, {@link Event#key}
  25. * contains a value indicating which key was activated, and
  26. * {@link Event#modifiers} contains the
  27. * modifiers for that event. For the KEY_PRESS and KEY_RELEASE
  28. * event ids, the value of <code>key</code> is the unicode
  29. * character code for the key. For KEY_ACTION and
  30. * KEY_ACTION_RELEASE, the value of <code>key</code> is
  31. * one of the defined action-key identifiers in the
  32. * <code>Event</code> class (<code>PGUP</code>,
  33. * <code>PGDN</code>, <code>F1</code>, <code>F2</code>, etc).
  34. *
  35. * @version 1.65 11/29/01
  36. * @author Sami Shaio
  37. * @since JDK1.0
  38. */
  39. public class Event implements java.io.Serializable {
  40. private transient long data;
  41. /* Modifier constants */
  42. /**
  43. * This flag indicates that the Shift key was down when the event
  44. * occurred.
  45. */
  46. public static final int SHIFT_MASK = 1 << 0;
  47. /**
  48. * This flag indicates that the Control key was down when the event
  49. * occurred.
  50. */
  51. public static final int CTRL_MASK = 1 << 1;
  52. /**
  53. * This flag indicates that the Meta key was down when the event
  54. * occurred. For mouse events, this flag indicates that the right
  55. * button was pressed or released.
  56. */
  57. public static final int META_MASK = 1 << 2;
  58. /**
  59. * This flag indicates that the Alt key was down when
  60. * the event occurred. For mouse events, this flag indicates that the
  61. * middle mouse button was pressed or released.
  62. */
  63. public static final int ALT_MASK = 1 << 3;
  64. /* Action keys */
  65. /**
  66. * The Home key, a non-ASCII action key.
  67. */
  68. public static final int HOME = 1000;
  69. /**
  70. * The End key, a non-ASCII action key.
  71. */
  72. public static final int END = 1001;
  73. /**
  74. * The Page Up key, a non-ASCII action key.
  75. */
  76. public static final int PGUP = 1002;
  77. /**
  78. * The Page Down key, a non-ASCII action key.
  79. */
  80. public static final int PGDN = 1003;
  81. /**
  82. * The Up Arrow key, a non-ASCII action key.
  83. */
  84. public static final int UP = 1004;
  85. /**
  86. * The Down Arrow key, a non-ASCII action key.
  87. */
  88. public static final int DOWN = 1005;
  89. /**
  90. * The Left Arrow key, a non-ASCII action key.
  91. */
  92. public static final int LEFT = 1006;
  93. /**
  94. * The Right Arrow key, a non-ASCII action key.
  95. */
  96. public static final int RIGHT = 1007;
  97. /**
  98. * The F1 function key, a non-ASCII action key.
  99. */
  100. public static final int F1 = 1008;
  101. /**
  102. * The F2 function key, a non-ASCII action key.
  103. */
  104. public static final int F2 = 1009;
  105. /**
  106. * The F3 function key, a non-ASCII action key.
  107. */
  108. public static final int F3 = 1010;
  109. /**
  110. * The F4 function key, a non-ASCII action key.
  111. */
  112. public static final int F4 = 1011;
  113. /**
  114. * The F5 function key, a non-ASCII action key.
  115. */
  116. public static final int F5 = 1012;
  117. /**
  118. * The F6 function key, a non-ASCII action key.
  119. */
  120. public static final int F6 = 1013;
  121. /**
  122. * The F7 function key, a non-ASCII action key.
  123. */
  124. public static final int F7 = 1014;
  125. /**
  126. * The F8 function key, a non-ASCII action key.
  127. */
  128. public static final int F8 = 1015;
  129. /**
  130. * The F9 function key, a non-ASCII action key.
  131. */
  132. public static final int F9 = 1016;
  133. /**
  134. * The F10 function key, a non-ASCII action key.
  135. */
  136. public static final int F10 = 1017;
  137. /**
  138. * The F11 function key, a non-ASCII action key.
  139. */
  140. public static final int F11 = 1018;
  141. /**
  142. * The F12 function key, a non-ASCII action key.
  143. */
  144. public static final int F12 = 1019;
  145. /**
  146. * The Print Screen key, a non-ASCII action key.
  147. */
  148. public static final int PRINT_SCREEN = 1020;
  149. /**
  150. * The Scroll Lock key, a non-ASCII action key.
  151. */
  152. public static final int SCROLL_LOCK = 1021;
  153. /**
  154. * The Caps Lock key, a non-ASCII action key.
  155. */
  156. public static final int CAPS_LOCK = 1022;
  157. /**
  158. * The Num Lock key, a non-ASCII action key.
  159. */
  160. public static final int NUM_LOCK = 1023;
  161. /**
  162. * The Pause key, a non-ASCII action key.
  163. */
  164. public static final int PAUSE = 1024;
  165. /**
  166. * The Insert key, a non-ASCII action key.
  167. */
  168. public static final int INSERT = 1025;
  169. /* Non-action keys */
  170. /**
  171. * The Enter key.
  172. */
  173. public static final int ENTER = '\n';
  174. /**
  175. * The BackSpace key.
  176. */
  177. public static final int BACK_SPACE = '\b';
  178. /**
  179. * The Tab key.
  180. */
  181. public static final int TAB = '\t';
  182. /**
  183. * The Escape key.
  184. */
  185. public static final int ESCAPE = 27;
  186. /**
  187. * The Delete key.
  188. */
  189. public static final int DELETE = 127;
  190. /* Base for all window events. */
  191. private static final int WINDOW_EVENT = 200;
  192. /**
  193. * The user has asked the window manager to kill the window.
  194. */
  195. public static final int WINDOW_DESTROY = 1 + WINDOW_EVENT;
  196. /**
  197. * The user has asked the window manager to expose the window.
  198. */
  199. public static final int WINDOW_EXPOSE = 2 + WINDOW_EVENT;
  200. /**
  201. * The user has asked the window manager to iconify the window.
  202. */
  203. public static final int WINDOW_ICONIFY = 3 + WINDOW_EVENT;
  204. /**
  205. * The user has asked the window manager to de-iconify the window.
  206. */
  207. public static final int WINDOW_DEICONIFY = 4 + WINDOW_EVENT;
  208. /**
  209. * The user has asked the window manager to move the window.
  210. */
  211. public static final int WINDOW_MOVED = 5 + WINDOW_EVENT;
  212. /* Base for all keyboard events. */
  213. private static final int KEY_EVENT = 400;
  214. /**
  215. * The user has pressed a normal key.
  216. */
  217. public static final int KEY_PRESS = 1 + KEY_EVENT;
  218. /**
  219. * The user has released a normal key.
  220. */
  221. public static final int KEY_RELEASE = 2 + KEY_EVENT;
  222. /**
  223. * The user has pressed a non-ASCII <em>action</em> key.
  224. * The <code>key</code> field contains a value that indicates
  225. * that the event occurred on one of the action keys, which
  226. * comprise the 12 function keys, the arrow (cursor) keys,
  227. * Page Up, Page Down, Home, End, Print Screen, Scroll Lock,
  228. * Caps Lock, Num Lock, Pause, and Insert.
  229. */
  230. public static final int KEY_ACTION = 3 + KEY_EVENT;
  231. /**
  232. * The user has released a non-ASCII <em>action</em> key.
  233. * The <code>key</code> field contains a value that indicates
  234. * that the event occurred on one of the action keys, which
  235. * comprise the 12 function keys, the arrow (cursor) keys,
  236. * Page Up, Page Down, Home, End, Print Screen, Scroll Lock,
  237. * Caps Lock, Num Lock, Pause, and Insert.
  238. */
  239. public static final int KEY_ACTION_RELEASE = 4 + KEY_EVENT;
  240. /* Base for all mouse events. */
  241. private static final int MOUSE_EVENT = 500;
  242. /**
  243. * The user has pressed the mouse button. The <code>ALT_MASK</code>
  244. * flag indicates that the middle button has been pressed.
  245. * The <code>META_MASK</code>flag indicates that the
  246. * right button has been pressed.
  247. * @see java.awt.Event#ALT_MASK
  248. * @see java.awt.Event#META_MASK
  249. */
  250. public static final int MOUSE_DOWN = 1 + MOUSE_EVENT;
  251. /**
  252. * The user has released the mouse button. The <code>ALT_MASK</code>
  253. * flag indicates that the middle button has been released.
  254. * The <code>META_MASK</code>flag indicates that the
  255. * right button has been released.
  256. * @see java.awt.Event#ALT_MASK
  257. * @see java.awt.Event#META_MASK
  258. */
  259. public static final int MOUSE_UP = 2 + MOUSE_EVENT;
  260. /**
  261. * The mouse has moved with no button pressed.
  262. */
  263. public static final int MOUSE_MOVE = 3 + MOUSE_EVENT;
  264. /**
  265. * The mouse has entered a component.
  266. */
  267. public static final int MOUSE_ENTER = 4 + MOUSE_EVENT;
  268. /**
  269. * The mouse has exited a component.
  270. */
  271. public static final int MOUSE_EXIT = 5 + MOUSE_EVENT;
  272. /**
  273. * The user has moved the mouse with a button pressed. The
  274. * <code>ALT_MASK</code> flag indicates that the middle
  275. * button is being pressed. The <code>META_MASK</code> flag indicates
  276. * that the right button is being pressed.
  277. * @see java.awt.Event#ALT_MASK
  278. * @see java.awt.Event#META_MASK
  279. */
  280. public static final int MOUSE_DRAG = 6 + MOUSE_EVENT;
  281. /* Scrolling events */
  282. private static final int SCROLL_EVENT = 600;
  283. /**
  284. * The user has activated the <em>line up</em>
  285. * area of a scroll bar.
  286. */
  287. public static final int SCROLL_LINE_UP = 1 + SCROLL_EVENT;
  288. /**
  289. * The user has activated the <em>line down</em>
  290. * area of a scroll bar.
  291. */
  292. public static final int SCROLL_LINE_DOWN = 2 + SCROLL_EVENT;
  293. /**
  294. * The user has activated the <em>page up</em>
  295. * area of a scroll bar.
  296. */
  297. public static final int SCROLL_PAGE_UP = 3 + SCROLL_EVENT;
  298. /**
  299. * The user has activated the <em>page down</em>
  300. * area of a scroll bar.
  301. */
  302. public static final int SCROLL_PAGE_DOWN = 4 + SCROLL_EVENT;
  303. /**
  304. * The user has moved the bubble (thumb) in a scroll bar,
  305. * moving to an "absolute" position, rather than to
  306. * an offset from the last postion.
  307. */
  308. public static final int SCROLL_ABSOLUTE = 5 + SCROLL_EVENT;
  309. /**
  310. * The scroll begin event.
  311. */
  312. public static final int SCROLL_BEGIN = 6 + SCROLL_EVENT;
  313. /**
  314. * The scroll end event.
  315. */
  316. public static final int SCROLL_END = 7 + SCROLL_EVENT;
  317. /* List Events */
  318. private static final int LIST_EVENT = 700;
  319. /**
  320. * An item in a list has been selected.
  321. */
  322. public static final int LIST_SELECT = 1 + LIST_EVENT;
  323. /**
  324. * An item in a list has been deselected.
  325. */
  326. public static final int LIST_DESELECT = 2 + LIST_EVENT;
  327. /* Misc Event */
  328. private static final int MISC_EVENT = 1000;
  329. /**
  330. * This event indicates that the user wants some action to occur.
  331. */
  332. public static final int ACTION_EVENT = 1 + MISC_EVENT;
  333. /**
  334. * A file loading event.
  335. */
  336. public static final int LOAD_FILE = 2 + MISC_EVENT;
  337. /**
  338. * A file saving event.
  339. */
  340. public static final int SAVE_FILE = 3 + MISC_EVENT;
  341. /**
  342. * A component gained the focus.
  343. */
  344. public static final int GOT_FOCUS = 4 + MISC_EVENT;
  345. /**
  346. * A component lost the focus.
  347. */
  348. public static final int LOST_FOCUS = 5 + MISC_EVENT;
  349. /**
  350. * The target component. This indicates the component over which the
  351. * event occurred or with which the event is associated.
  352. * This object has been replaced by AWTEvent.getSource()
  353. *
  354. * @serial
  355. * @see java.awt.AWTEvent#getSource()
  356. */
  357. public Object target;
  358. /**
  359. * The time stamp.
  360. * Replaced by InputEvent.getWhen().
  361. *
  362. * @serial
  363. * @see java.awt.InputEvent#getWhen()
  364. */
  365. public long when;
  366. /**
  367. * Indicates which type of event the event is, and which
  368. * other <code>Event</code> variables are relevant for the event.
  369. * This has been replaced by AWTEvent.getID()
  370. *
  371. * @serial
  372. * @see java.awt.AWTEvent.getID()
  373. */
  374. public int id;
  375. /**
  376. * The <i>x</i> coordinate of the event.
  377. * Replaced by MouseEvent.getX()
  378. *
  379. * @serial
  380. * @see java.awt.MouseEvent#getX()
  381. */
  382. public int x;
  383. /**
  384. * The <i>y</i> coordinate of the event.
  385. * Replaced by MouseEvent.getY()
  386. *
  387. * @serial
  388. * @see java.awt.MouseEvent#getY()
  389. */
  390. public int y;
  391. /**
  392. * The key code of the key that was pressed in a keyboard event.
  393. * This has been replaced by KeyEvent.getKeyCode()
  394. *
  395. * @serial
  396. * @see java.awt.KeyEvent#getKeyCode()
  397. */
  398. public int key;
  399. /**
  400. * The key character that was pressed in a keyboard event.
  401. */
  402. // public char keyChar;
  403. /**
  404. * The state of the modifier keys.
  405. * This is replaced with InputEvent.getModifiers()
  406. * In java 1.1 MouseEvent and KeyEvent are subclasses
  407. * of InputEvent.
  408. *
  409. * @serial
  410. * @see java.awt.InputEvent#getModifiers()
  411. */
  412. public int modifiers;
  413. /**
  414. * For <code>MOUSE_DOWN</code> events, this field indicates the
  415. * number of consecutive clicks. For other events, its value is
  416. * <code>0</code>.
  417. * This field has been replaced by MouseEvent.getClickCount().
  418. *
  419. * @serial
  420. * @see java.awt.MouseEvent.getClickCount().
  421. */
  422. public int clickCount;
  423. /**
  424. * An arbitrary argument of the event. The value of this field
  425. * depends on the type of event.
  426. * <code>arg</code> has been replaced b event specific property.
  427. *
  428. * @serial
  429. */
  430. public Object arg;
  431. /**
  432. * The next event. This field is set when putting events into a
  433. * linked list.
  434. * This has been replaced by EventQueue.
  435. *
  436. * @serial
  437. * @see java.awt.EventQueue
  438. */
  439. public Event evt;
  440. /* table for mapping old Event action keys to KeyEvent virtual keys. */
  441. private static final int actionKeyCodes[][] = {
  442. /* virtual key action key */
  443. { KeyEvent.VK_HOME, Event.HOME },
  444. { KeyEvent.VK_END, Event.END },
  445. { KeyEvent.VK_PAGE_UP, Event.PGUP },
  446. { KeyEvent.VK_PAGE_DOWN, Event.PGDN },
  447. { KeyEvent.VK_UP, Event.UP },
  448. { KeyEvent.VK_DOWN, Event.DOWN },
  449. { KeyEvent.VK_LEFT, Event.LEFT },
  450. { KeyEvent.VK_RIGHT, Event.RIGHT },
  451. { KeyEvent.VK_F1, Event.F1 },
  452. { KeyEvent.VK_F2, Event.F2 },
  453. { KeyEvent.VK_F3, Event.F3 },
  454. { KeyEvent.VK_F4, Event.F4 },
  455. { KeyEvent.VK_F5, Event.F5 },
  456. { KeyEvent.VK_F6, Event.F6 },
  457. { KeyEvent.VK_F7, Event.F7 },
  458. { KeyEvent.VK_F8, Event.F8 },
  459. { KeyEvent.VK_F9, Event.F9 },
  460. { KeyEvent.VK_F10, Event.F10 },
  461. { KeyEvent.VK_F11, Event.F11 },
  462. { KeyEvent.VK_F12, Event.F12 },
  463. { KeyEvent.VK_PRINTSCREEN, Event.PRINT_SCREEN },
  464. { KeyEvent.VK_SCROLL_LOCK, Event.SCROLL_LOCK },
  465. { KeyEvent.VK_CAPS_LOCK, Event.CAPS_LOCK },
  466. { KeyEvent.VK_NUM_LOCK, Event.NUM_LOCK },
  467. { KeyEvent.VK_PAUSE, Event.PAUSE },
  468. { KeyEvent.VK_INSERT, Event.INSERT }
  469. };
  470. /**
  471. * This field controls whether or not the event is sent back
  472. * down to the peer once the target has processed it -
  473. * false means it's sent to the peer, true means it's not.
  474. *
  475. * @serial
  476. * @see isConsumed()
  477. */
  478. private boolean consumed = false;
  479. /*
  480. * JDK 1.1 serialVersionUID
  481. */
  482. private static final long serialVersionUID = 5488922509400504703L;
  483. static {
  484. /* ensure that the necessary native libraries are loaded */
  485. Toolkit.loadLibraries();
  486. initIDs();
  487. }
  488. /**
  489. * Initialize JNI field and method IDs for fields that may be
  490. accessed from C.
  491. */
  492. private static native void initIDs();
  493. /**
  494. * Creates an instance of <code>Event</code> with the specified target
  495. * component, time stamp, event type, <i>x</i> and <i>y</i>
  496. * coordinates, keyboard key, state of the modifier keys, and
  497. * argument.
  498. * @param target the target component.
  499. * @param when the time stamp.
  500. * @param id the event type.
  501. * @param x the <i>x</i> coordinate.
  502. * @param y the <i>y</i> coordinate.
  503. * @param key the key pressed in a keyboard event.
  504. * @param modifiers the state of the modifier keys.
  505. * @param arg the specified argument.
  506. */
  507. public Event(Object target, long when, int id, int x, int y, int key,
  508. int modifiers, Object arg) {
  509. this.target = target;
  510. this.when = when;
  511. this.id = id;
  512. this.x = x;
  513. this.y = y;
  514. this.key = key;
  515. this.modifiers = modifiers;
  516. this.arg = arg;
  517. this.data = 0;
  518. this.clickCount = 0;
  519. switch(id) {
  520. case ACTION_EVENT:
  521. case WINDOW_DESTROY:
  522. case WINDOW_ICONIFY:
  523. case WINDOW_DEICONIFY:
  524. case WINDOW_MOVED:
  525. case SCROLL_LINE_UP:
  526. case SCROLL_LINE_DOWN:
  527. case SCROLL_PAGE_UP:
  528. case SCROLL_PAGE_DOWN:
  529. case SCROLL_ABSOLUTE:
  530. case SCROLL_BEGIN:
  531. case SCROLL_END:
  532. case LIST_SELECT:
  533. case LIST_DESELECT:
  534. consumed = true; // these types are not passed back to peer
  535. break;
  536. default:
  537. }
  538. }
  539. /**
  540. * Creates an instance of <code>Event</code>, with the specified target
  541. * component, time stamp, event type, <i>x</i> and <i>y</i>
  542. * coordinates, keyboard key, state of the modifier keys, and an
  543. * argument set to <code>null</code>.
  544. * @param target the target component.
  545. * @param when the time stamp.
  546. * @param id the event type.
  547. * @param x the <i>x</i> coordinate.
  548. * @param y the <i>y</i> coordinate.
  549. * @param key the key pressed in a keyboard event.
  550. * @param modifiers the state of the modifier keys.
  551. */
  552. public Event(Object target, long when, int id, int x, int y, int key, int modifiers) {
  553. this(target, when, id, x, y, key, modifiers, null);
  554. }
  555. /**
  556. * Creates an instance of <code>Event</code> with the specified
  557. * target component, event type, and argument.
  558. * @param target the target component.
  559. * @param id the event type.
  560. * @param arg the specified argument.
  561. */
  562. public Event(Object target, int id, Object arg) {
  563. this(target, 0, id, 0, 0, 0, 0, arg);
  564. }
  565. /**
  566. * Translates this event so that its <i>x</i> and <i>y</i>
  567. * coordinates are increased by <i>dx</i> and <i>dy</i>,
  568. * respectively.
  569. * <p>
  570. * This method translates an event relative to the given component.
  571. * This involves, at a minimum, translating the coordinates into the
  572. * local coordinate system of the given component. It may also involve
  573. * translating a region in the case of an expose event.
  574. * @param dx the distance to translate the <i>x</i> coordinate.
  575. * @param dy the distance to translate the <i>y</i> coordinate.
  576. */
  577. public void translate(int x, int y) {
  578. this.x += x;
  579. this.y += y;
  580. }
  581. /**
  582. * Checks if the Shift key is down.
  583. * @return <code>true</code> if the key is down;
  584. * <code>false</code> otherwise.
  585. * @see java.awt.Event#modifiers
  586. * @see java.awt.Event#controlDown
  587. * @see java.awt.Event#metaDown
  588. */
  589. public boolean shiftDown() {
  590. return (modifiers & SHIFT_MASK) != 0;
  591. }
  592. /**
  593. * Checks if the Control key is down.
  594. * @return <code>true</code> if the key is down;
  595. * <code>false</code> otherwise.
  596. * @see java.awt.Event#modifiers
  597. * @see java.awt.Event#shiftDown
  598. * @see java.awt.Event#metaDown
  599. */
  600. public boolean controlDown() {
  601. return (modifiers & CTRL_MASK) != 0;
  602. }
  603. /**
  604. * Checks if the Meta key is down.
  605. * @return <code>true</code> if the key is down;
  606. * <code>false</code> otherwise.
  607. * @see java.awt.Event#modifiers
  608. * @see java.awt.Event#shiftDown
  609. * @see java.awt.Event#controlDown
  610. */
  611. public boolean metaDown() {
  612. return (modifiers & META_MASK) != 0;
  613. }
  614. void consume() {
  615. switch(id) {
  616. case KEY_PRESS:
  617. case KEY_RELEASE:
  618. case KEY_ACTION:
  619. case KEY_ACTION_RELEASE:
  620. consumed = true;
  621. break;
  622. default:
  623. // event type cannot be consumed
  624. }
  625. }
  626. boolean isConsumed() {
  627. return consumed;
  628. }
  629. /*
  630. * Returns the integer key-code associated with the key in this event,
  631. * as described in java.awt.Event.
  632. */
  633. static int getOldEventKey(KeyEvent e) {
  634. int keyCode = e.getKeyCode();
  635. for (int i = 0; i < actionKeyCodes.length; i++) {
  636. if (actionKeyCodes[i][0] == keyCode) {
  637. return actionKeyCodes[i][1];
  638. }
  639. }
  640. return (int)e.getKeyChar();
  641. }
  642. /*
  643. * Returns a new KeyEvent char which corresponds to the int key
  644. * of this old event.
  645. */
  646. char getKeyEventChar() {
  647. for (int i = 0; i < actionKeyCodes.length; i++) {
  648. if (actionKeyCodes[i][1] == key) {
  649. return KeyEvent.CHAR_UNDEFINED;
  650. }
  651. }
  652. return (char)key;
  653. }
  654. /**
  655. * Returns the parameter string representing this event.
  656. * This string is useful for debugging.
  657. * @return the parameter string of this event.
  658. */
  659. protected String paramString() {
  660. String str = "id=" + id + ",x=" + x + ",y=" + y;
  661. if (key != 0) {
  662. str += ",key=" + key;
  663. }
  664. if (shiftDown()) {
  665. str += ",shift";
  666. }
  667. if (controlDown()) {
  668. str += ",control";
  669. }
  670. if (metaDown()) {
  671. str += ",meta";
  672. }
  673. if (target != null) {
  674. str += ",target=" + target;
  675. }
  676. if (arg != null) {
  677. str += ",arg=" + arg;
  678. }
  679. return str;
  680. }
  681. /**
  682. * Returns a representation of this event's values as a string.
  683. * @return a string that represents the event and the values
  684. * of its member fields.
  685. * @see java.awt.Event#paramString
  686. * @since JDK1.1
  687. */
  688. public String toString() {
  689. return getClass().getName() + "[" + paramString() + "]";
  690. }
  691. }