Statistics
| Revision:

root / trunk / extensions / extCAD / sm / RectangleCADTool.sm @ 3883

History | View | Annotate | Download (1.14 KB)

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

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

    
8
%start ExecuteMap::Initial
9
%class RectangleCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.RectangleCADTool
12

    
13
%map ExecuteMap
14
%%
15
// A task begins life in suspended animation.
16

    
17
Initial
18

    
19
	Entry {
20
		setQuestion("RECTANGULO" + "\n" +
21
		"Insertar primer punto de esquina");
22
		setDescription(new String[]{"Cancelar"});
23
		}
24
	Exit{
25
		}
26

    
27
	{
28

    
29
		addPoint(pointX:double,pointY:double)
30
			First {
31
				setQuestion("Insertar punto de esquina opuesta o Cuadrado[C]");
32
				setDescription(new String[]{"Cuadrado","Cancelar"});
33
				addPoint(pointX,pointY);
34
				}
35

    
36
	}
37
First{
38
	addPoint(pointX:double,pointY:double)
39
		Third {
40
			addPoint(pointX,pointY);
41
			end();
42
			}
43
	addOption(s:String)
44
		[s.equals("c") || s.equals("C") || s.equals("Cuadrado")]
45
		Second {
46
			setQuestion("Insertar esquina opuesta");
47
			setDescription(new String[]{"Cancelar"});
48
			addOption(s);
49
			}
50

    
51
}
52
Second{
53
	addPoint(pointX:double,pointY:double)
54
		Fourth {
55
			addPoint(pointX,pointY);
56
			end();
57
			}
58
}
59
Third{
60
}
61
Fourth{
62
}
63
Default
64
{
65
	addOption(s:String)
66
		[s.equals("Cancelar")]
67
		Initial{
68
			end();
69
			}
70
}
71
%%