View Javadoc

1   /*
2    * @(#)$Id: EditMappingAction.java 689 2009-07-22 00:10:27Z bsigner $
3    *
4    * Author       :   Michele Croci, mcroci@gmail.com
5    *
6    * Purpose      :   Map gesture to custom action
7    *
8    * -----------------------------------------------------------------------
9    *
10   * Revision Information:
11   *
12   * Date             Who         Reason
13   *
14   * Nov 19, 2007     crocimi     Initial Release
15   *
16   * -----------------------------------------------------------------------
17   *
18   * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
19   *
20   * This software is the proprietary information of ETH Zurich.
21   * Use is subject to license terms.
22   * 
23   */
24  
25  
26  package org.ximtec.igesture.geco.gui.action;
27  
28  import java.awt.event.ActionEvent;
29  
30  import org.sigtec.graphix.widget.BasicAction;
31  import org.ximtec.igesture.geco.gui.MainView;
32  import org.ximtec.igesture.geco.mapping.GestureToActionMapping;
33  import org.ximtec.igesture.geco.util.Constant;
34  import org.ximtec.igesture.geco.util.GuiBundleTool;
35  
36  
37  /**
38   * Map gesture to custom action
39   * 
40   * @version 1.0, Nov 2006
41   * @author Michele Croci, mcroci@gmail.com
42   */
43  public class EditMappingAction extends BasicAction {
44  
45     private MainView mainView;
46     private GestureToActionMapping currentMapping;
47  
48  
49     public EditMappingAction(MainView mainView) {
50        super(Constant.EDIT, GuiBundleTool.getBundle());
51        this.mainView = mainView;
52     }
53  
54  
55     /**
56      * Show a dialog
57      * 
58      * @param event the action event.
59      */
60     public void actionPerformed(ActionEvent event) {
61        currentMapping = mainView.getSelectedMapping();
62        mainView.getComponentHandler().getMappingDialog().showDialog(
63              currentMapping.getGestureClass());
64     } // actionPerformed
65  
66  }