11 package com.generalrobotix.ui.item;
13 import java.util.Iterator;
14 import java.util.List;
16 import java.util.Vector;
18 import org.eclipse.jface.action.Action;
19 import org.eclipse.jface.dialogs.InputDialog;
20 import org.eclipse.jface.dialogs.MessageDialog;
21 import org.eclipse.osgi.util.NLS;
36 @SuppressWarnings(
"serial")
39 public static final String TITLE =
"ExtraJoint";
40 boolean isModel =
true;
43 static final String[] extrajointTypeComboItem_ =
new String[] {
"xyz",
"xy",
"z" };
47 setIcon(
"extraJoint.png");
56 if(extraJointInfo !=
null){
57 setProperty(
"link1Name", extraJointInfo.link[0]);
58 setProperty(
"link2Name", extraJointInfo.link[1]);
59 setDblAry(
"link1LocalPos", extraJointInfo.point[0], 4);
60 setDblAry(
"link2LocalPos", extraJointInfo.point[1], 4);
61 if(extraJointInfo.jointType == ExtraJointType.EJ_XYZ){
62 setProperty(
"jointType",
"xyz");
63 }
else if(extraJointInfo.jointType == ExtraJointType.EJ_XY){
64 setProperty(
"jointType",
"xy");
65 }
else if(extraJointInfo.jointType == ExtraJointType.EJ_Z){
66 setProperty(
"jointType",
"z");
68 setDblAry(
"jointAxis", extraJointInfo.axis, 4);
70 setProperty(
"link1Name",
"");
71 setProperty(
"link2Name",
"");
72 setProperty(
"link1LocalPos",
"0.0 0.0 0.0");
73 setProperty(
"link2LocalPos",
"0.0 0.0 0.0");
74 setProperty(
"jointType",
"xyz");
75 setProperty(
"jointAxis",
"0 0 1");
78 setIcon(
"extraJoint.png");
83 double[] newAxis = getDblAry(axis);
84 if (newAxis !=
null && newAxis.length == 3){
85 setDblAry(
"jointAxis", newAxis, 4);
91 double[] newPos = getDblAry(pos);
92 if (newPos !=
null && newPos.length == 3){
93 setDblAry(
"link1LocalPos", newPos, 4);
99 double[] newPos = getDblAry(pos);
100 if (newPos !=
null && newPos.length == 3){
101 setDblAry(
"link2LocalPos", newPos, 4);
107 if(key.equals(
"jointType"))
110 }
else if( key.equals(
"link1Name") || key.equals(
"link2Name") ){
111 String[] linkComboItem_ =
null;
114 linkComboItem_ = model_.
nameToLink_.keySet().toArray(
new String[0]);
117 if( key.equals(
"link1Name") ){
119 linkComboItem_ = model1_.
nameToLink_.keySet().toArray(
new String[0]);
122 if( key.equals(
"link2Name") ){
124 linkComboItem_ = model2_.
nameToLink_.keySet().toArray(
new String[0]);
128 if(linkComboItem_!=
null)
131 return super.GetValueEditType(key);
132 }
else if( key.equals(
"object1Name") || key.equals(
"object2Name") ){
134 Map<?, ?> m = manager_.pluginMap_.get((
GrxModelItem.class));
135 String[] modelComboItem_ = m.keySet().toArray(
new String[0]);
139 return super.GetValueEditType(key);
153 InputDialog dialog =
new InputDialog(
null,
getText(),
155 if ( dialog.open() == InputDialog.OK && dialog.getValue() !=
null)
156 rename( dialog.getValue() );
168 mes = NLS.bind(mes,
new String[]{getName()});
178 if (property.equals(
"name")){
180 }
else if(property.equals(
"link1Name")){
181 setProperty(
"link1Name", value);
183 }
else if(property.equals(
"link2Name")){
184 setProperty(
"link2Name", value);
186 }
else if(property.equals(
"link1LocalPos")){
187 link1LocalPos(value);
188 }
else if(property.equals(
"link2LocalPos")){
189 link2LocalPos(value);
190 }
else if(property.equals(
"jointType")){
191 setProperty(
"jointType", value);
193 }
else if(property.equals(
"jointAxis")){
195 }
else if(property.equals(
"object1Name")){
196 setProperty(
"object1Name", value);
198 }
else if(property.equals(
"object2Name")){
199 setProperty(
"object2Name", value);
206 public void delete(){
207 if(isModel && model_!=
null)
213 setProperty(
"object1Name",
"");
214 setProperty(
"object2Name",
"");
215 setProperty(
"link1Name",
"");
216 setProperty(
"link2Name",
"");
217 setProperty(
"link1LocalPos",
"0.0 0.0 0.0");
218 setProperty(
"link2LocalPos",
"0.0 0.0 0.0");
219 setProperty(
"jointType",
"xyz");
220 setProperty(
"jointAxis",
"0 0 1");
static final String get(String key)
#define null
our own NULL pointer
png_infop png_charpp name
item corresponds to a robot model
void notifyModified()
notify this model is modified
Map< String, GrxLinkItem > nameToLink_
void removeExtraJoint(GrxExtraJointItem extraJoint)
プラグイン管理クラス GrxUIの核になるクラス。プラグインのロード等の、初期化を実行する。 プラグインとそ...
def getText(self, nodes=None)