GUIAction.java
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * General Robotix Inc.
8  * National Institute of Advanced Industrial Science and Technology (AIST)
9  */
17 package com.generalrobotix.ui.view.tdview;
18 
19 import java.awt.event.ActionEvent;
20 import java.awt.event.ActionListener;
21 import java.awt.AWTEventMulticaster;
22 import javax.swing.AbstractAction;
23 
26 
27 
28 
32 @SuppressWarnings("serial")
33 public class GUIAction extends AbstractAction {
34  //public static final GUIAction EXIT = new GUIAction("exit");
35  //public static final GUIAction ABOUT = new GUIAction("about");
36 
38  //public static final GUIAction UNDO = new GUIAction("undo");
39 
41  //public static final GUIAction NEW_PROJECT = new GUIAction("newProject");
42  //public static final GUIAction OPEN_PROJECT = new GUIAction("openProject");
43  //public static final GUIAction SAVE_PROJECT = new GUIAction("saveProject");
44  //public static final GUIAction SAVE_PROJECT_AS = new GUIAction("saveProjectAs");
45  //public static final GUIAction OPEN_LOG = new GUIAction("openLog");
46  //public static final GUIAction SAVE_LOG = new GUIAction("saveLog");
47  //public static final GUIAction SAVE_LOG_AS = new GUIAction("saveLogAs");
48  //public static final GUIAction SAVE_CSV = new GUIAction("saveCSV");
49 
51  //public static final GUIAction ADD_ROBOT = new GUIAction("addRobot");
52  //public static final GUIAction ADD_ENV = new GUIAction("addEnvironment");
53  //public static final GUIAction REMOVE_OBJECT = new GUIAction("removeObject");
54  //public static final GUIAction SET_CONTROLLER = new GUIAction("setController");
55 
57  public static GUIAction ROOM_VIEW = null;
58  public static GUIAction WALK_VIEW = null;
59  public static GUIAction FRONT_VIEW = null;
60  public static GUIAction BACK_VIEW = null;
61  public static GUIAction LEFT_VIEW = null;
62  public static GUIAction RIGHT_VIEW = null;
63  public static GUIAction TOP_VIEW = null;
64  public static GUIAction BOTTOM_VIEW = null;
65  public static GUIAction VIEW_PAN_MODE = null;
66  public static GUIAction VIEW_ZOOM_MODE = null;
67  public static GUIAction VIEW_ROTATION_MODE = null;
68  public static GUIAction WIRE_FRAME = null;
69  public static GUIAction BG_COLOR = null;
70  public static GUIAction CAPTURE = null;
71 
73  public static GUIAction OBJECT_TRANSLATION = null;
74  public static GUIAction OBJECT_ROTATION = null;
75  public static GUIAction JOINT_ROTATION = null;
76  public static GUIAction FITTING_SRC = null;
77  public static GUIAction FITTING_DEST = null;
78  public static GUIAction DO_FIT = null;
79  public static GUIAction INV_KINEMA_FROM = null;
80  public static GUIAction INV_KINEMA_TRANS = null;
81  public static GUIAction INV_KINEMA_ROT = null;
82  public static GUIAction OPERATION_DISABLE = null;
83 
85  //public static final GUIAction START_SIMULATION = new GUIAction("startSimulation");
86  //public static final GUIAction STOP_SIMULATION = new GUIAction("stopSimulation");
87  //public static final GUIAction EDIT_MODE = new GUIAction("editMode");
88  //public static final GUIAction SPLIT_MODE = new GUIAction("splitMode");
89 
91  //public static final GUIAction PLAY = new GUIAction("play");
92  //public static final GUIAction PAUSE = new GUIAction("pause");
93  //public static final GUIAction STOP = new GUIAction("stop");
94  //public static final GUIAction RECORD = new GUIAction("record");
95  //public static final GUIAction COLLISION = new GUIAction("collision");
96  //public static final GUIAction DELETE = new GUIAction("delete");
97 
99  //public static final GUIAction SLIDER_CHANGED = new GUIAction("sliderChanged");
100  //public static final GUIAction RATE_CHANGED = new GUIAction("rateChanged");
101  //public static final GUIAction SET_IN_POINT = new GUIAction("setInPoint");
102  //public static final GUIAction SET_OUT_POINT = new GUIAction("setOutPoint");
103  //public static final GUIAction MOVIE_PLAYER = new GUIAction("moviePlayer");
104 
105  //--------------------------------------------------------------------
106  // Instance Valiables
107  private String command_;
108  private ActionListener listener_;
109 
110  //--------------------------------------------------------------------
111  // Constructor
112  public GUIAction(String command) {
113 /*
114  super(
115  MessageBundle.get("action.text." + command),
116  IconProperties.get("icon." + command)
117  );
118 */
119 
120  command_ = command;
121  putValue(SHORT_DESCRIPTION, MessageBundle.get("action.text." + command));
122  putValue(SMALL_ICON, IconProperties.get("icon." + command));
123  }
124 
125  public String getActionCommand() { return command_; }
126 
127  public void addActionListener(ActionListener listener) {
128  listener_ = AWTEventMulticaster.add(listener_, listener);
129  }
130 
131  public void removeActionListener(ActionListener listener) {
132  listener_ = AWTEventMulticaster.remove(listener_, listener);
133  }
134 
135  public void actionPerformed(ActionEvent evt) {
136  if (listener_ != null) {
137  listener_.actionPerformed(
138  new ActionEvent(
139  this,
140  ActionEvent.ACTION_PERFORMED,
141  command_
142  )
143  );
144  }
145  }
146 
147  public void fireAction() {
148  if (listener_ != null) {
149  listener_.actionPerformed(
150  new ActionEvent(
151  this,
152  ActionEvent.ACTION_PERFORMED,
153  command_
154  )
155  );
156  }
157  }
158 
159  public String toString() {
160  return (String)getValue(SHORT_DESCRIPTION);
161  }
162 }
static final String get(String key)
void addActionListener(ActionListener listener)
Definition: GUIAction.java:127
#define null
our own NULL pointer
Definition: IceTypes.h:57
void removeActionListener(ActionListener listener)
Definition: GUIAction.java:131


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:03