svn-gvsig-desktop / trunk / extensions / extCAD / sm / RectangleCADTool.sm @ 4578
History | View | Annotate | Download (1.3 KB)
1 |
// -*- tab-width: 4; -*- |
---|---|
2 |
|
3 |
%{ |
4 |
// |
5 |
// Vicente Caballero Navarro |
6 |
%} |
7 |
|
8 |
%start Rectangle::FirstPoint |
9 |
%class RectangleCADTool |
10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 |
%import com.iver.cit.gvsig.gui.cad.tools.RectangleCADTool |
12 |
%import java.awt.event.InputEvent |
13 |
|
14 |
%map Rectangle |
15 |
%% |
16 |
// A task begins life in suspended animation. |
17 |
|
18 |
FirstPoint |
19 |
|
20 |
Entry { |
21 |
setQuestion("RECTANGULO" + "\n" + |
22 |
"Insertar primer punto de esquina"); |
23 |
setDescription(new String[]{"Cancelar"}); |
24 |
} |
25 |
Exit{ |
26 |
} |
27 |
|
28 |
{ |
29 |
|
30 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
31 |
SecondPointOrSquare { |
32 |
setQuestion("Insertar punto de esquina opuesta o Cuadrado[C]"); |
33 |
setDescription(new String[]{"Cuadrado","Cancelar"}); |
34 |
addPoint( pointX,pointY,event); |
35 |
} |
36 |
|
37 |
} |
38 |
SecondPointOrSquare{ |
39 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
40 |
FirstPoint { |
41 |
addPoint(pointX,pointY,event); |
42 |
end(); |
43 |
} |
44 |
addOption(s:String) |
45 |
[s.equals("c") || s.equals("C") || s.equals("Cuadrado")] |
46 |
SecondPointSquare { |
47 |
setQuestion("Insertar esquina opuesta"); |
48 |
setDescription(new String[]{"Cancelar"}); |
49 |
addOption(s); |
50 |
} |
51 |
|
52 |
} |
53 |
SecondPointSquare{ |
54 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
55 |
FirstPoint { |
56 |
addPoint( pointX,pointY,event); |
57 |
end(); |
58 |
} |
59 |
} |
60 |
|
61 |
Default |
62 |
{ |
63 |
addOption(s:String) |
64 |
[s.equals("Cancelar")] |
65 |
FirstPoint{ |
66 |
end(); |
67 |
} |
68 |
} |
69 |
%% |