Statistics
| Revision:

svn-gvsig-desktop / tags / v1_9_Build_1226 / extensions / extCAD / sm / ArcCADTool.sm @ 43874

History | View | Annotate | Download (1.55 KB)

1 3782 caballero
// -*- tab-width: 4; -*-
2
3
%{
4
//
5
// Vicente Caballero Navarro
6
%}
7
8 3978 caballero
%start Arc::FirstPoint
9 3782 caballero
%class ArcCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.ArcCADTool
12 4324 caballero
%import java.awt.event.InputEvent
13 4583 caballero
%import com.iver.andami.PluginServices
14 3782 caballero
15 3978 caballero
%map Arc
16 3782 caballero
%%
17
// A task begins life in suspended animation.
18
19 3978 caballero
FirstPoint
20 3782 caballero
21
	Entry {
22 4892 caballero
		setQuestion(
23 4583 caballero
		PluginServices.getText(this,"insert_first_point"));
24
		setDescription(new String[]{"cancel"});
25 3782 caballero
		}
26
	Exit{
27
		}
28
29
	{
30 4324 caballero
		addPoint( pointX:double,pointY:double,event:InputEvent)
31 3978 caballero
			SecondPoint {
32 4583 caballero
				setQuestion(PluginServices.getText(this,"insert_second_point"));
33
				setDescription(new String[]{"cancel"});
34 4365 caballero
				addPoint( pointX,pointY,event);
35 3782 caballero
				}
36
37
	}
38 3978 caballero
SecondPoint{
39 4324 caballero
	addPoint( pointX:double,pointY:double,event:InputEvent)
40 3978 caballero
		ThirdPoint {
41 4583 caballero
			setQuestion(PluginServices.getText(this,"insert_last_point"));
42
			setDescription(new String[]{"cancel"});
43 4365 caballero
			addPoint( pointX,pointY,event);
44 3782 caballero
			}
45
}
46 3978 caballero
ThirdPoint{
47 4324 caballero
	addPoint( pointX:double,pointY:double,event:InputEvent)
48 3978 caballero
		FirstPoint {
49 4365 caballero
			addPoint( pointX,pointY,event);
50 3782 caballero
			}
51
}
52 3978 caballero
53 3782 caballero
Default
54
{
55 3883 caballero
	addOption(s:String)
56 4583 caballero
		[s.equals(PluginServices.getText(this,"cancel"))]
57 3978 caballero
		FirstPoint{
58 3883 caballero
			end();
59
			}
60 5730 caballero
	addOption(s:String)
61
		FirstPoint{
62
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
63
			}
64
	addValue(d:double)
65
		FirstPoint{
66
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
67
			}
68
	addPoint(pointX:double,pointY:double,event:InputEvent)
69
		FirstPoint{
70
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
71
			}
72 3782 caballero
}
73
%%