1 /* Copyright (C) 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
9 package java
.awt
.event
;
13 * @author Tom Tromey <tromey@cygnus.com>
17 /* Status: Believed complete and correct to JDK 1.2. */
19 public class MouseEvent
extends InputEvent
21 public static final int MOUSE_CLICKED
= 500;
22 public static final int MOUSE_DRAGGED
= 506;
23 public static final int MOUSE_ENTERED
= 504;
24 public static final int MOUSE_EXITED
= 505;
25 public static final int MOUSE_FIRST
= 500;
26 public static final int MOUSE_LAST
= 506;
27 public static final int MOUSE_MOVED
= 503;
28 public static final int MOUSE_PRESSED
= 501;
29 public static final int MOUSE_RELEASED
= 502;
31 public MouseEvent (Component source
, int id
, long when
, int modifiers
,
32 int x
, int y
, int clickCount
, boolean popupTrigger
)
36 this.modifiers
= modifiers
;
39 this.clickCount
= clickCount
;
40 this.popupTrigger
= popupTrigger
;
43 public int getClickCount ()
48 public Point
getPoint ()
50 Point p
= ((Component
) source
).getLocation ();
58 return x
- ((Component
) source
).getX ();
63 return y
- ((Component
) source
).getY ();
66 public boolean isPopupTrigger ()
71 public String
paramString ()
73 return ("MouseEvent[" + when
+ "," + modifiers
74 + ",(" + x
+ "," + y
+ "),"
75 + clickCount
+ "," + popupTrigger
76 + ";" + super.paramString () + "]");
79 public void translatePoint (int x
, int y
)
86 private int modifiers
;
89 private int clickCount
;
90 private boolean popupTrigger
;