svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extEditing / sm / CircleCADTool.sm @ 39127
History | View | Annotate | Download (2.35 KB)
1 |
// -*- tab-width: 4; -*- |
---|---|
2 |
|
3 |
%{ |
4 |
// |
5 |
// Vicente Caballero Navarro |
6 |
%} |
7 |
|
8 |
%start Circle::CenterPointOr3p |
9 |
%class CircleCADTool |
10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 |
%import com.iver.cit.gvsig.gui.cad.tools.CircleCADTool |
12 |
%import java.awt.event.InputEvent |
13 |
%import com.iver.andami.PluginServices |
14 |
|
15 |
%map Circle |
16 |
%% |
17 |
// A task begins life in suspended animation. |
18 |
|
19 |
CenterPointOr3p |
20 |
|
21 |
Entry { |
22 |
setQuestion( |
23 |
PluginServices.getText(this,"insert_central_point_or_3p")+ |
24 |
"["+PluginServices.getText(this,"CircleCADTool.3p")+"]"); |
25 |
setDescription(new String[]{"cancel","3P"}); |
26 |
} |
27 |
Exit{ |
28 |
} |
29 |
|
30 |
{ |
31 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
32 |
PointOrRadius { |
33 |
setQuestion(PluginServices.getText(this,"insert_radius_or_second_point")); |
34 |
setDescription(new String[]{"cancel"}); |
35 |
addPoint( pointX,pointY,event); |
36 |
} |
37 |
addOption( s:String) |
38 |
[s.equalsIgnoreCase(PluginServices.getText(this,"CircleCADTool.3p"))] |
39 |
FirstPoint{ |
40 |
setQuestion(PluginServices.getText(this,"insert_first_point")); |
41 |
setDescription(new String[]{"cancel"}); |
42 |
addOption( s); |
43 |
} |
44 |
} |
45 |
PointOrRadius{ |
46 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
47 |
CenterPointOr3p { |
48 |
addPoint( pointX,pointY,event); |
49 |
} |
50 |
addValue( d:double) |
51 |
CenterPointOr3p { |
52 |
addValue( d); |
53 |
} |
54 |
} |
55 |
SecondPoint{ |
56 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
57 |
ThirdPoint { |
58 |
setQuestion(PluginServices.getText(this,"insert_third_point")); |
59 |
setDescription(new String[]{"cancel"}); |
60 |
addPoint( pointX,pointY,event); |
61 |
} |
62 |
} |
63 |
ThirdPoint{ |
64 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
65 |
CenterPointOr3p { |
66 |
addPoint( pointX,pointY,event); |
67 |
} |
68 |
} |
69 |
|
70 |
FirstPoint{ |
71 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
72 |
SecondPoint { |
73 |
setQuestion(PluginServices.getText(this,"insert_second_point")); |
74 |
setDescription(new String[]{"cancel"}); |
75 |
addPoint( pointX,pointY,event); |
76 |
} |
77 |
} |
78 |
|
79 |
Default |
80 |
{ |
81 |
addOption(s:String) |
82 |
[s.equals(PluginServices.getText(this,"cancel"))] |
83 |
CenterPointOr3p{ |
84 |
end(); |
85 |
} |
86 |
addOption(s:String) |
87 |
CenterPointOr3p{ |
88 |
throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
89 |
} |
90 |
addValue(d:double) |
91 |
CenterPointOr3p{ |
92 |
throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
93 |
} |
94 |
addPoint(pointX:double,pointY:double,event:InputEvent) |
95 |
CenterPointOr3p{ |
96 |
throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
97 |
} |
98 |
} |
99 |
%% |