1 package fr.ove.openmath.jome.ctrlview.events;
2
3 import java.util.EventObject;
4
5 /***
6 * The event to send to all objects that implements the interface ControlListener
7 * and which want to execute the control actions.
8 *
9 * @author © 1998 DIRAT Laurent
10 * @version 1.0 09/07/98
11 */
12 public class ControlEvent extends EventObject {
13 /***
14 * The action to execute with the event.
15 */
16 private int action;
17
18 /***
19 * The argument of the action to execute.
20 */
21 private Object argument;
22
23 /***
24 * The constructor.
25 * @param src the object which produces this event.
26 */
27 public ControlEvent(Object src) {
28 super(src);
29 }
30
31 /***
32 * Sets the action and its argument, if necessary, to execute to the event.
33 * @param action the action to execute.
34 * @param argument the action argument. If the action don't need
35 * an argument, it must be sets to <CODE>null</CODE>.
36 */
37 public void setAction(int action, Object argument) {
38 this.action = action;
39 this.argument = argument;
40 }
41
42 /***
43 * Returns the action associated with the event.
44 */
45 public int getAction() {
46 return action;
47 }
48
49 /***
50 * Returns the argument of the action.
51 */
52 public Object getArgument() {
53 return argument;
54 }
55
56 /***
57 * The different actions associated with the event.<BR>
58 */
59
60 /***
61 * Add the element which produces the event.
62 */
63 public static final int ADD = 0;
64
65 /***
66 * Remove the element which produces the event.
67 */
68 public static final int REMOVE = 1;
69
70 /***
71 * Iconify the element which produces the event.
72 */
73 public static final int ICONIFY = 2;
74
75 /***
76 * Uniconify the element which produces the event.
77 */
78 public static final int UNICONIFY = 3;
79
80 /***
81 * Recursive iconification
82 */
83 public static final int UNICONIFY_ALL = 4;
84
85 /***
86 * Substitue the selection by a friendly name.
87 */
88 public static final int SUBSTITUTE = 5;
89
90 /***
91 * Ask the OpenMath object of the formula.
92 */
93 public static final int GIVE_OPENMATH = 6;
94
95
96
97
98 public static final int GIVE_MAPLE = 7;
99
100 }