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