1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package org.ximtec.igesture.tool.view.admin.action;
27
28 import java.awt.event.ActionEvent;
29
30 import javax.swing.tree.TreePath;
31
32 import org.ximtec.igesture.core.GestureClass;
33 import org.ximtec.igesture.core.GestureSet;
34 import org.ximtec.igesture.tool.GestureConstants;
35 import org.ximtec.igesture.tool.core.Controller;
36 import org.ximtec.igesture.tool.core.TreePathAction;
37
38 public class RemoveGestureClassAction extends TreePathAction {
39
40 public RemoveGestureClassAction(Controller controller, TreePath treePath) {
41 super(GestureConstants.GESTURE_CLASS_DEL, controller, treePath);
42 }
43
44 @Override
45 public void actionPerformed(ActionEvent arg0) {
46 GestureClass gestureClass = (GestureClass) getTreePath()
47 .getLastPathComponent();
48 GestureSet gestureSet = (GestureSet) getTreePath().getParentPath()
49 .getLastPathComponent();
50 gestureSet.removeGestureClass(gestureClass);
51
52 }
53
54 }