root / trunk / extensions / extCAD / sm / PolygonCADTool.sm @ 4365
History | View | Annotate | Download (1.84 KB)
1 |
// -*- tab-width: 4; -*- |
---|---|
2 |
|
3 |
%{ |
4 |
// |
5 |
// Vicente Caballero Navarro |
6 |
%} |
7 |
|
8 |
%start Polygon::NumberOrCenterPoint |
9 |
%class PolygonCADTool |
10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 |
%import com.iver.cit.gvsig.gui.cad.tools.PolygonCADTool |
12 |
%import java.awt.event.InputEvent |
13 |
|
14 |
%map Polygon |
15 |
%% |
16 |
// A task begins life in suspended animation. |
17 |
|
18 |
NumberOrCenterPoint |
19 |
|
20 |
Entry { |
21 |
setQuestion("POLIGONO" + "\n" + |
22 |
"Insertar numero de lados<5>"); |
23 |
setDescription(new String[]{"Cancelar"}); |
24 |
} |
25 |
Exit{ |
26 |
} |
27 |
|
28 |
{ |
29 |
addValue(d:double) |
30 |
CenterPoint { |
31 |
setQuestion("Insertar punto central del poligono"); |
32 |
setDescription(new String[]{"Cancelar"}); |
33 |
addValue(d); |
34 |
} |
35 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
36 |
OptionOrRadiusOrPoint { |
37 |
setQuestion("Inscrito en el c?rculo[I] o Circunscrito[C]<C>"); |
38 |
setDescription(new String[]{"Inscrito","Circunscrito","Cancelar"}); |
39 |
addPoint( pointX,pointY,event); |
40 |
} |
41 |
|
42 |
} |
43 |
CenterPoint{ |
44 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
45 |
OptionOrRadiusOrPoint { |
46 |
setQuestion("Inscrito en el c?rculo[I] o Circunscrito[C]<C>"); |
47 |
setDescription(new String[]{"Inscrito","Circunscrito","Cancelar"}); |
48 |
addPoint( pointX,pointY,event); |
49 |
} |
50 |
} |
51 |
OptionOrRadiusOrPoint{ |
52 |
addOption(s:String) |
53 |
RadiusOrPoint { |
54 |
setQuestion("Precise r?dio(r)"); |
55 |
setDescription(new String[]{"Cancelar"}); |
56 |
addOption(s); |
57 |
} |
58 |
addValue(d:double) |
59 |
NumberOrCenterPoint{ |
60 |
addValue(d); |
61 |
end(); |
62 |
} |
63 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
64 |
NumberOrCenterPoint { |
65 |
addPoint( pointX,pointY,event); |
66 |
end(); |
67 |
} |
68 |
} |
69 |
RadiusOrPoint{ |
70 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
71 |
NumberOrCenterPoint { |
72 |
addPoint( pointX,pointY,event); |
73 |
end(); |
74 |
} |
75 |
addValue(d:double) |
76 |
NumberOrCenterPoint{ |
77 |
addValue(d); |
78 |
end(); |
79 |
} |
80 |
} |
81 |
|
82 |
Default |
83 |
{ |
84 |
addOption(s:String) |
85 |
[s.equals("Cancelar")] |
86 |
NumberOrCenterPoint{ |
87 |
end(); |
88 |
} |
89 |
} |
90 |
%% |