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