svn-gvsig-desktop / tags / v1_1_Build_1003 / extensions / extCAD / sm / ArcCADTool.sm @ 12271
History | View | Annotate | Download (1.56 KB)
1 |
// -*- tab-width: 4; -*- |
---|---|
2 |
|
3 |
%{ |
4 |
// |
5 |
// Vicente Caballero Navarro |
6 |
%} |
7 |
|
8 |
%start Arc::FirstPoint |
9 |
%class ArcCADTool |
10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 |
%import com.iver.cit.gvsig.gui.cad.tools.ArcCADTool |
12 |
%import java.awt.event.InputEvent |
13 |
%import com.iver.andami.PluginServices |
14 |
|
15 |
%map Arc |
16 |
%% |
17 |
// A task begins life in suspended animation. |
18 |
|
19 |
FirstPoint |
20 |
|
21 |
Entry { |
22 |
setQuestion( |
23 |
PluginServices.getText(this,"insert_first_point")); |
24 |
setDescription(new String[]{"cancel"}); |
25 |
} |
26 |
Exit{ |
27 |
} |
28 |
|
29 |
{ |
30 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
31 |
SecondPoint { |
32 |
setQuestion(PluginServices.getText(this,"insert_second_point")); |
33 |
setDescription(new String[]{"cancel"}); |
34 |
addPoint( pointX,pointY,event); |
35 |
} |
36 |
|
37 |
} |
38 |
SecondPoint{ |
39 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
40 |
ThirdPoint { |
41 |
setQuestion(PluginServices.getText(this,"insert_last_point")); |
42 |
setDescription(new String[]{"cancel"}); |
43 |
addPoint( pointX,pointY,event); |
44 |
} |
45 |
} |
46 |
ThirdPoint{ |
47 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
48 |
FirstPoint { |
49 |
addPoint( pointX,pointY,event); |
50 |
end(); |
51 |
} |
52 |
} |
53 |
|
54 |
Default |
55 |
{ |
56 |
addOption(s:String) |
57 |
[s.equals(PluginServices.getText(this,"cancel"))] |
58 |
FirstPoint{ |
59 |
end(); |
60 |
} |
61 |
addOption(s:String) |
62 |
FirstPoint{ |
63 |
throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
64 |
} |
65 |
addValue(d:double) |
66 |
FirstPoint{ |
67 |
throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
68 |
} |
69 |
addPoint(pointX:double,pointY:double,event:InputEvent) |
70 |
FirstPoint{ |
71 |
throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
72 |
} |
73 |
} |
74 |
%% |