GUIAction.java
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
00003  * All rights reserved. This program is made available under the terms of the
00004  * Eclipse Public License v1.0 which accompanies this distribution, and is
00005  * available at http://www.eclipse.org/legal/epl-v10.html
00006  * Contributors:
00007  * General Robotix Inc.
00008  * National Institute of Advanced Industrial Science and Technology (AIST) 
00009  */
00017 package com.generalrobotix.ui.view.tdview;
00018 
00019 import java.awt.event.ActionEvent;
00020 import java.awt.event.ActionListener;
00021 import java.awt.AWTEventMulticaster;
00022 import javax.swing.AbstractAction;
00023 
00024 import com.generalrobotix.ui.util.IconProperties;
00025 import com.generalrobotix.ui.util.MessageBundle;
00026 
00027 
00028 
00032 @SuppressWarnings("serial")
00033 public class GUIAction extends AbstractAction {
00034     //public static final GUIAction EXIT  = new GUIAction("exit");
00035     //public static final GUIAction ABOUT = new GUIAction("about");
00036 
00038     //public static final GUIAction UNDO = new GUIAction("undo");
00039 
00041     //public static final GUIAction NEW_PROJECT     = new GUIAction("newProject");
00042     //public static final GUIAction OPEN_PROJECT    = new GUIAction("openProject");
00043     //public static final GUIAction SAVE_PROJECT    = new GUIAction("saveProject");
00044     //public static final GUIAction SAVE_PROJECT_AS = new GUIAction("saveProjectAs");
00045     //public static final GUIAction OPEN_LOG        = new GUIAction("openLog");
00046     //public static final GUIAction SAVE_LOG        = new GUIAction("saveLog");
00047     //public static final GUIAction SAVE_LOG_AS     = new GUIAction("saveLogAs");
00048     //public static final GUIAction SAVE_CSV        = new GUIAction("saveCSV");
00049 
00051     //public static final GUIAction ADD_ROBOT      = new GUIAction("addRobot");
00052     //public static final GUIAction ADD_ENV        = new GUIAction("addEnvironment");
00053     //public static final GUIAction REMOVE_OBJECT  = new GUIAction("removeObject");
00054     //public static final GUIAction SET_CONTROLLER = new GUIAction("setController");
00055 
00057     public static GUIAction ROOM_VIEW          = null;
00058     public static GUIAction WALK_VIEW          = null;
00059     public static GUIAction FRONT_VIEW         = null;
00060     public static GUIAction BACK_VIEW          = null;
00061     public static GUIAction LEFT_VIEW          = null;
00062     public static GUIAction RIGHT_VIEW         = null;
00063     public static GUIAction TOP_VIEW           = null;
00064     public static GUIAction BOTTOM_VIEW        = null;
00065     public static GUIAction VIEW_PAN_MODE      = null;
00066     public static GUIAction VIEW_ZOOM_MODE     = null;
00067     public static GUIAction VIEW_ROTATION_MODE = null;
00068     public static GUIAction WIRE_FRAME         = null;
00069     public static GUIAction BG_COLOR      = null;
00070     public static GUIAction CAPTURE      = null;
00071     
00073     public static GUIAction OBJECT_TRANSLATION = null;
00074     public static GUIAction OBJECT_ROTATION = null;
00075     public static GUIAction JOINT_ROTATION  = null;
00076     public static GUIAction FITTING_SRC     = null;
00077     public static GUIAction FITTING_DEST    = null;
00078     public static GUIAction DO_FIT          = null;
00079     public static GUIAction INV_KINEMA_FROM = null;
00080     public static GUIAction INV_KINEMA_TRANS = null;
00081     public static GUIAction INV_KINEMA_ROT  = null;
00082     public static GUIAction OPERATION_DISABLE = null;
00083 
00085     //public static final GUIAction START_SIMULATION = new GUIAction("startSimulation");
00086     //public static final GUIAction STOP_SIMULATION = new GUIAction("stopSimulation");
00087     //public static final GUIAction EDIT_MODE       = new GUIAction("editMode");
00088     //public static final GUIAction SPLIT_MODE      = new GUIAction("splitMode");
00089 
00091     //public static final GUIAction PLAY   = new GUIAction("play");
00092     //public static final GUIAction PAUSE  = new GUIAction("pause");
00093     //public static final GUIAction STOP   = new GUIAction("stop");
00094     //public static final GUIAction RECORD = new GUIAction("record");
00095     //public static final GUIAction COLLISION = new GUIAction("collision");
00096     //public static final GUIAction DELETE = new GUIAction("delete");
00097 
00099     //public static final GUIAction SLIDER_CHANGED = new GUIAction("sliderChanged");
00100     //public static final GUIAction RATE_CHANGED   = new GUIAction("rateChanged");
00101     //public static final GUIAction SET_IN_POINT   = new GUIAction("setInPoint");
00102     //public static final GUIAction SET_OUT_POINT  = new GUIAction("setOutPoint");
00103     //public static final GUIAction MOVIE_PLAYER   = new GUIAction("moviePlayer");
00104 
00105     //--------------------------------------------------------------------
00106     // Instance Valiables
00107     private String command_;
00108     private ActionListener listener_;
00109 
00110     //--------------------------------------------------------------------
00111     // Constructor
00112     public GUIAction(String command) {
00113 /*
00114         super(
00115             MessageBundle.get("action.text." + command),
00116             IconProperties.get("icon." + command)
00117         );
00118 */
00119 
00120         command_ = command;
00121         putValue(SHORT_DESCRIPTION, MessageBundle.get("action.text." + command));
00122         putValue(SMALL_ICON, IconProperties.get("icon." + command));
00123     }
00124 
00125     public String getActionCommand() { return command_; }
00126 
00127     public void addActionListener(ActionListener listener) {
00128         listener_ = AWTEventMulticaster.add(listener_, listener);
00129     }
00130 
00131     public void removeActionListener(ActionListener listener) {
00132         listener_ = AWTEventMulticaster.remove(listener_, listener);
00133     }
00134 
00135     public void actionPerformed(ActionEvent evt) {
00136         if (listener_ != null) {
00137             listener_.actionPerformed(
00138                 new ActionEvent(
00139                     this,
00140                     ActionEvent.ACTION_PERFORMED,
00141                     command_
00142                 )
00143             );
00144         }
00145     }
00146 
00147     public void fireAction() {
00148         if (listener_ != null) {
00149             listener_.actionPerformed(
00150                 new ActionEvent(
00151                     this,
00152                     ActionEvent.ACTION_PERFORMED,
00153                     command_
00154                 )
00155             );
00156         }
00157     }
00158 
00159     public String toString() {
00160         return (String)getValue(SHORT_DESCRIPTION);
00161     }
00162 }


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:16