Statistics
| Revision:

svn-gvsig-desktop / trunk / extensions / extCAD / sm / LineCADTool.sm @ 4475

History | View | Annotate | Download (1.58 KB)

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

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

    
8
%start Line::FirstPoint
9
%class LineCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.LineCADTool
12
%import java.awt.event.InputEvent
13

    
14
%map Line
15
%%
16
// A task begins life in suspended animation.
17

    
18
FirstPoint
19

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

    
28
	{
29

    
30
		addPoint( pointX:double,pointY:double,event:InputEvent)
31
			SecondPointOrAngle {
32
				setQuestion("Insertar segundo punto o angulo");
33
				setDescription(new String[]{"Cancelar"});
34
				addPoint( pointX,pointY,event);
35
				}
36

    
37
	}
38
SecondPointOrAngle{
39
	addPoint( pointX:double,pointY:double,event:InputEvent)
40
		SecondPointOrAngle {
41
			setQuestion("Insertar segundo punto o angulo");
42
			setDescription(new String[]{"Cancelar"});
43
			addPoint( pointX,pointY,event);
44
			}
45
	addValue( d:double)
46
		LenghtOrPoint {
47
			setQuestion("Insertar longitud o punto");
48
			setDescription(new String[]{"Cancelar"});
49
			addValue( d);
50
			}
51

    
52
}
53
LenghtOrPoint{
54
	addPoint( pointX:double,pointY:double,event:InputEvent)
55
		SecondPointOrAngle {
56
			setQuestion("Insertar segundo punto o angulo");
57
			setDescription(new String[]{"Cancelar"});
58
			addPoint( pointX,pointY,event);
59
			}
60
	addValue( d:double)
61
		SecondPointOrAngle {
62
			setQuestion("Insertar segundo punto o angulo");
63
			setDescription(new String[]{"Cancelar"});
64
			addValue( d);
65
			}
66
	}
67
Default
68
{
69
	addOption(s:String)
70
		[s.equals("Cancelar")]
71
		FirstPoint{
72
			end();
73
			}
74
	addOption(s:String)
75
		[s.equals("")]
76
		FirstPoint{
77
			end();
78
			}
79
			
80
}
81
%%