Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
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
00035
00036
00038
00039
00041
00042
00043
00044
00045
00046
00047
00048
00049
00051
00052
00053
00054
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
00086
00087
00088
00089
00091
00092
00093
00094
00095
00096
00097
00099
00100
00101
00102
00103
00104
00105
00106
00107 private String command_;
00108 private ActionListener listener_;
00109
00110
00111
00112 public GUIAction(String command) {
00113
00114
00115
00116
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 }