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