Statistics
| Revision:

svn-gvsig-desktop / tags / tmp_build / extensions / extCAD / sm / ArcCADTool.sm @ 18485

History | View | Annotate | Download (1.56 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
			end();
51
			}
52
}
53 3978 caballero
54 3782 caballero
Default
55
{
56 3883 caballero
	addOption(s:String)
57 4583 caballero
		[s.equals(PluginServices.getText(this,"cancel"))]
58 3978 caballero
		FirstPoint{
59 3883 caballero
			end();
60
			}
61 5730 caballero
	addOption(s:String)
62
		FirstPoint{
63
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
64
			}
65
	addValue(d:double)
66
		FirstPoint{
67
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
68
			}
69
	addPoint(pointX:double,pointY:double,event:InputEvent)
70
		FirstPoint{
71
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
72
			}
73 3782 caballero
}
74
%%