Statistics
| Revision:

svn-gvsig-desktop / tags / v1_9_RC1 / extensions / extCAD / sm / ArcCADTool.sm @ 43233

History | View | Annotate | Download (1.55 KB)

1
// -*- tab-width: 4; -*-
2

    
3
%{
4
//
5
// Vicente Caballero Navarro
6
%}
7

    
8
%start Arc::FirstPoint
9
%class ArcCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.ArcCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

    
15
%map Arc
16
%%
17
// A task begins life in suspended animation.
18

    
19
FirstPoint
20

    
21
	Entry {
22
		setQuestion(
23
		PluginServices.getText(this,"insert_first_point"));
24
		setDescription(new String[]{"cancel"});
25
		}
26
	Exit{
27
		}
28

    
29
	{
30
		addPoint( pointX:double,pointY:double,event:InputEvent)
31
			SecondPoint {
32
				setQuestion(PluginServices.getText(this,"insert_second_point"));
33
				setDescription(new String[]{"cancel"});
34
				addPoint( pointX,pointY,event);
35
				}
36

    
37
	}
38
SecondPoint{
39
	addPoint( pointX:double,pointY:double,event:InputEvent)
40
		ThirdPoint {
41
			setQuestion(PluginServices.getText(this,"insert_last_point"));
42
			setDescription(new String[]{"cancel"});
43
			addPoint( pointX,pointY,event);
44
			}
45
}
46
ThirdPoint{
47
	addPoint( pointX:double,pointY:double,event:InputEvent)
48
		FirstPoint {
49
			addPoint( pointX,pointY,event);
50
			}
51
}
52

    
53
Default
54
{
55
	addOption(s:String)
56
		[s.equals(PluginServices.getText(this,"cancel"))]
57
		FirstPoint{
58
			end();
59
			}
60
	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
}
73
%%