root / branches / v2_0_0_prep / extensions / extEditing / sm / EditVertexCADTool.sm @ 33205
History | View | Annotate | Download (3.22 KB)
1 | 4118 | caballero | // -*- 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 | 4365 | caballero | %import java.awt.event.InputEvent |
13 | 4583 | caballero | %import com.iver.andami.PluginServices |
14 | 4118 | caballero | |
15 | %map EditVertex |
||
16 | %% |
||
17 | // A task begins life in suspended animation. |
||
18 | |||
19 | SelectVertexOrDelete |
||
20 | Entry { |
||
21 | selection(); |
||
22 | 4892 | caballero | setQuestion( |
23 | 9121 | caballero | 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 | 4583 | caballero | setDescription(new String[]{"next","previous","add","del","cancel"}); |
34 | 4118 | caballero | |
35 | } |
||
36 | Exit{ |
||
37 | } |
||
38 | |||
39 | { |
||
40 | 4365 | caballero | addPoint( pointX:double,pointY:double,event:InputEvent) |
41 | SelectVertexOrDelete { |
||
42 | 4583 | caballero | setQuestion(PluginServices.getText(this,"select_from_point")); |
43 | setDescription(new String[]{"next","previous","add","del","cancel"}); |
||
44 | 4365 | caballero | addPoint( pointX,pointY,event); |
45 | } |
||
46 | 4118 | caballero | addOption(s:String) |
47 | 6159 | caballero | [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 | 4118 | caballero | SelectVertexOrDelete { |
57 | 9121 | caballero | 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 | 4583 | caballero | setDescription(new String[]{"next","previous","add","del","cancel"}); |
69 | 4118 | caballero | addOption(s); |
70 | } |
||
71 | } |
||
72 | |||
73 | 6159 | caballero | 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 | 4365 | caballero | |
82 | 4118 | caballero | Default |
83 | { |
||
84 | addOption(s:String) |
||
85 | 4583 | caballero | [s.equals(PluginServices.getText(this,"cancel"))] |
86 | 4118 | caballero | SelectVertexOrDelete{ |
87 | end(); |
||
88 | } |
||
89 | 5730 | caballero | 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 | 4118 | caballero | } |
102 | %% |