Revision 5735 trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/smc/PointCADToolContext.java
PointCADToolContext.java | ||
---|---|---|
41 | 41 |
return; |
42 | 42 |
} |
43 | 43 |
|
44 |
public void addValue(double d) |
|
45 |
{ |
|
46 |
_transition = "addValue"; |
|
47 |
getState().addValue(this, d); |
|
48 |
_transition = ""; |
|
49 |
return; |
|
50 |
} |
|
51 |
|
|
44 | 52 |
public PointCADToolState getState() |
45 | 53 |
throws statemap.StateUndefinedException |
46 | 54 |
{ |
... | ... | |
93 | 101 |
Default(context); |
94 | 102 |
} |
95 | 103 |
|
104 |
protected void addValue(PointCADToolContext context, double d) |
|
105 |
{ |
|
106 |
Default(context); |
|
107 |
} |
|
108 |
|
|
96 | 109 |
protected void Default(PointCADToolContext context) |
97 | 110 |
{ |
98 | 111 |
throw ( |
... | ... | |
177 | 190 |
} |
178 | 191 |
else |
179 | 192 |
{ |
180 |
super.addOption(context, s); |
|
193 |
boolean loopbackFlag = |
|
194 |
context.getState().getName().equals( |
|
195 |
Point.FirstPoint.getName()); |
|
196 |
|
|
197 |
if (loopbackFlag == false) |
|
198 |
{ |
|
199 |
(context.getState()).Exit(context); |
|
200 |
} |
|
201 |
|
|
202 |
context.clearState(); |
|
203 |
try |
|
204 |
{ |
|
205 |
ctxt.throwOptionException(PluginServices.getText(this,"incorrect_option"), s); |
|
206 |
} |
|
207 |
finally |
|
208 |
{ |
|
209 |
context.setState(Point.FirstPoint); |
|
210 |
|
|
211 |
if (loopbackFlag == false) |
|
212 |
{ |
|
213 |
(context.getState()).Entry(context); |
|
214 |
} |
|
215 |
|
|
216 |
} |
|
181 | 217 |
} |
182 | 218 |
|
183 | 219 |
return; |
184 | 220 |
} |
185 | 221 |
|
222 |
protected void addValue(PointCADToolContext context, double d) |
|
223 |
{ |
|
224 |
PointCADTool ctxt = context.getOwner(); |
|
225 |
|
|
226 |
boolean loopbackFlag = |
|
227 |
context.getState().getName().equals( |
|
228 |
Point.FirstPoint.getName()); |
|
229 |
|
|
230 |
if (loopbackFlag == false) |
|
231 |
{ |
|
232 |
(context.getState()).Exit(context); |
|
233 |
} |
|
234 |
|
|
235 |
context.clearState(); |
|
236 |
try |
|
237 |
{ |
|
238 |
ctxt.throwValueException(PluginServices.getText(this,"incorrect_value"), d); |
|
239 |
} |
|
240 |
finally |
|
241 |
{ |
|
242 |
context.setState(Point.FirstPoint); |
|
243 |
|
|
244 |
if (loopbackFlag == false) |
|
245 |
{ |
|
246 |
(context.getState()).Entry(context); |
|
247 |
} |
|
248 |
|
|
249 |
} |
|
250 |
return; |
|
251 |
} |
|
252 |
|
|
253 |
protected void addPoint(PointCADToolContext context, double pointX, double pointY, InputEvent event) |
|
254 |
{ |
|
255 |
PointCADTool ctxt = context.getOwner(); |
|
256 |
|
|
257 |
boolean loopbackFlag = |
|
258 |
context.getState().getName().equals( |
|
259 |
Point.FirstPoint.getName()); |
|
260 |
|
|
261 |
if (loopbackFlag == false) |
|
262 |
{ |
|
263 |
(context.getState()).Exit(context); |
|
264 |
} |
|
265 |
|
|
266 |
context.clearState(); |
|
267 |
try |
|
268 |
{ |
|
269 |
ctxt.throwPointException(PluginServices.getText(this,"incorrect_point"), pointX, pointY); |
|
270 |
} |
|
271 |
finally |
|
272 |
{ |
|
273 |
context.setState(Point.FirstPoint); |
|
274 |
|
|
275 |
if (loopbackFlag == false) |
|
276 |
{ |
|
277 |
(context.getState()).Entry(context); |
|
278 |
} |
|
279 |
|
|
280 |
} |
|
281 |
return; |
|
282 |
} |
|
283 |
|
|
186 | 284 |
//----------------------------------------------------------- |
187 | 285 |
// Inner classse. |
188 | 286 |
// |
Also available in: Unified diff