View Javadoc

1   package fr.ove.openmath.mfd2.events;
2   
3   import java.util.EventObject;
4   
5   public class RequestContainingEvent extends EventObject {
6       /***
7       * The action to execute with the event.
8       */
9       private int action;
10  
11      /***
12      * The argument of the action to execute.
13      */
14      private Object argument;
15  
16      /***
17      * The constructor.
18      * @param src the object which produces this event.
19      */
20      public RequestContainingEvent(Object src) {
21          super(src);
22      }
23  
24      /***
25      * Sets the action and its argument, if necessary, to execute to the event.
26      * @param action the action to execute.
27      * @param argument the action argument. If the action don't need
28      * an argument, it must be sets to <CODE>null</CODE>.
29      */
30      public void setAction(int action, Object argument) {
31          this.action = action;
32          this.argument = argument;
33      }
34  
35      /***
36      * Returns the action associated with the event.
37      */
38      public int getAction() {
39          return action;
40      }
41  
42      /***
43      * Returns the argument of the action.
44      */
45      public Object getArgument() {
46          return argument;
47      }
48  
49      /***
50      * The different actions associated with the event.<BR>
51      */
52  
53      public static final int UPDATE_REQUEST  = 0;
54      public static final int UPDATE_RESULT   = 1;
55      public static final int UPDATE          = 2;
56  }