Remove Dwarf2 restriction on EH frame generation
[official-gcc.git] / libjava / java / awt / event / MouseEvent.java
blob49e2eb8f9a41aca3fd379d2ec8e38231a9dc6a0f
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
7 details. */
9 package java.awt.event;
10 import java.awt.*;
12 /**
13 * @author Tom Tromey <tromey@cygnus.com>
14 * @date April 8, 2000
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)
34 super (source, id);
35 this.when = when;
36 this.modifiers = modifiers;
37 this.x = x;
38 this.y = y;
39 this.clickCount = clickCount;
40 this.popupTrigger = popupTrigger;
43 public int getClickCount ()
45 return clickCount;
48 public Point getPoint ()
50 Point p = ((Component) source).getLocation ();
51 p.x = x - p.x;
52 p.y = y - p.y;
53 return p;
56 public int getX ()
58 return x - ((Component) source).getX ();
61 public int getY ()
63 return y - ((Component) source).getY ();
66 public boolean isPopupTrigger ()
68 return popupTrigger;
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)
81 this.x += x;
82 this.y += y;
85 private long when;
86 private int modifiers;
87 private int x;
88 private int y;
89 private int clickCount;
90 private boolean popupTrigger;