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