Statistics
| Revision:

svn-gvsig-desktop / tags / v1_0_2_Build_901 / extensions / extCAD / sm / EditVertexCADTool.sm @ 10571

History | View | Annotate | Download (2.19 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 4583 caballero
		PluginServices.getText(this,"next_previous_add_del_cancel"));
24
		setDescription(new String[]{"next","previous","add","del","cancel"});
25 4118 caballero
26
		}
27
	Exit{
28
		}
29
30
	{
31 4365 caballero
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			SelectVertexOrDelete {
33 4583 caballero
				setQuestion(PluginServices.getText(this,"select_from_point"));
34
				setDescription(new String[]{"next","previous","add","del","cancel"});
35 4365 caballero
				addPoint( pointX,pointY,event);
36
				}
37 4118 caballero
		addOption(s:String)
38 6159 caballero
		[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 4118 caballero
			SelectVertexOrDelete {
48 4583 caballero
				setQuestion(PluginServices.getText(this,"next_previous_add_del_cancel"));
49
				setDescription(new String[]{"next","previous","add","del","cancel"});
50 4118 caballero
				addOption(s);
51
				}
52
	}
53
54 6159 caballero
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 4365 caballero
63 4118 caballero
Default
64
{
65
	addOption(s:String)
66 4583 caballero
		[s.equals(PluginServices.getText(this,"cancel"))]
67 4118 caballero
		SelectVertexOrDelete{
68
			end();
69
			}
70 5730 caballero
	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 4118 caballero
}
83
%%