svn-gvsig-desktop / tags / v1_0_2_Build_901 / extensions / extCAD / sm / EditVertexCADTool.sm @ 10571
History | View | Annotate | Download (2.19 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,"next_previous_add_del_cancel")); |
24 |
setDescription(new String[]{"next","previous","add","del","cancel"}); |
25 |
|
26 |
} |
27 |
Exit{ |
28 |
} |
29 |
|
30 |
{ |
31 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
32 |
SelectVertexOrDelete { |
33 |
setQuestion(PluginServices.getText(this,"select_from_point")); |
34 |
setDescription(new String[]{"next","previous","add","del","cancel"}); |
35 |
addPoint( pointX,pointY,event); |
36 |
} |
37 |
addOption(s:String) |
38 |
[s.equals("i") || s.equals("I") || s.equals(PluginServices.getText(this,"add"))] |
39 |
AddVertex { |
40 |
setQuestion(PluginServices.getText(this,"add_vertex")); |
41 |
setDescription(new String[]{"cancel"}); |
42 |
addOption(s); |
43 |
} |
44 |
addOption(s:String) |
45 |
[!s.equals("i") && !s.equals("I") && !s.equals(PluginServices.getText(this,"add"))] |
46 |
|
47 |
SelectVertexOrDelete { |
48 |
setQuestion(PluginServices.getText(this,"next_previous_add_del_cancel")); |
49 |
setDescription(new String[]{"next","previous","add","del","cancel"}); |
50 |
addOption(s); |
51 |
} |
52 |
} |
53 |
|
54 |
AddVertex{ |
55 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
56 |
SelectVertexOrDelete { |
57 |
setQuestion(PluginServices.getText(this,"select_from_point")); |
58 |
setDescription(new String[]{"next","previous","add","del","cancel"}); |
59 |
addPoint( pointX,pointY,event); |
60 |
} |
61 |
} |
62 |
|
63 |
Default |
64 |
{ |
65 |
addOption(s:String) |
66 |
[s.equals(PluginServices.getText(this,"cancel"))] |
67 |
SelectVertexOrDelete{ |
68 |
end(); |
69 |
} |
70 |
addOption(s:String) |
71 |
SelectVertexOrDelete{ |
72 |
throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
73 |
} |
74 |
addValue(d:double) |
75 |
SelectVertexOrDelete{ |
76 |
throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
77 |
} |
78 |
addPoint(pointX:double,pointY:double,event:InputEvent) |
79 |
SelectVertexOrDelete{ |
80 |
throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
81 |
} |
82 |
} |
83 |
%% |