KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwt > awt > event > ActionEvent


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: ActionEvent.java,v $
11    Revision 1.9 2004/05/04 10:06:52 bobintetley
12    Fixes to byte[] pixel data - added getModifiers() to ActionEvent
13
14    Revision 1.8 2004/01/20 07:38:05 bobintetley
15    Bug fixes and compatibility methods
16
17    Revision 1.7 2004/01/16 15:53:32 bobintetley
18    Many compatibility methods added to Container, Component, JInternalFrame,
19       UIManager, SwingUtilities, JTabbedPane, JPasswordField, JCheckBox
20       and JRadioButton.
21
22    Revision 1.6 2003/12/14 09:13:38 bobintetley
23    Added CVS log to source headers
24
25 */

26
27
28 package swingwt.awt.event;
29
30 import swingwt.awt.*;
31
32 /** Event class used for representing Action events
33  * Thank you to Diane Trout for submitting additional bits.
34  *
35  * @author Robin Rawson-Tetley
36  * @author Diane Trout
37  */

38 public class ActionEvent extends AWTEvent implements java.io.Serializable JavaDoc {
39      
40     public static final int SHIFT_MASK = InputEvent.SHIFT_MASK;
41     public static final int CTRL_MASK = InputEvent.CTRL_MASK;
42     public static final int META_MASK = InputEvent.META_MASK;
43     public static final int ALT_MASK = InputEvent.ALT_MASK;
44     public static final int ACTION_FIRST = 1001;
45     public static final int ACTION_LAST = 1001;
46     public static final int ACTION_PERFORMED = ACTION_FIRST;
47
48      private String JavaDoc command;
49      int modifiers;
50
51      public ActionEvent(Object JavaDoc source, int id) {
52          this(source, id, "", 0);
53      }
54      
55       /** Creates an ActionEvent from a source object and id
56        * @param source The source object generating the event
57        * @param id An id referencing the event
58        */

59      public ActionEvent(Object JavaDoc source, int id, String JavaDoc command) {
60        this(source, id, command, 0);
61      }
62
63      public ActionEvent(Object JavaDoc source, int id, String JavaDoc command, int modifiers) {
64          super(source, id);
65          this.command = command;
66          this.modifiers = modifiers;
67      }
68
69      public String JavaDoc getActionCommand() {
70        return this.command;
71      }
72      
73      public void setActionCommand(String JavaDoc command) {
74             this.command = command;
75      }
76
77      public int getModifiers() {
78          return modifiers;
79      }
80      
81 }
82
Popular Tags