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