Revision 3978
trunk/extensions/extCAD/sm/RectangleCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Rectangle::FirstPoint
|
|
9 | 9 |
%class RectangleCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.RectangleCADTool |
12 | 12 |
|
13 |
%map ExecuteMap
|
|
13 |
%map Rectangle
|
|
14 | 14 |
%% |
15 | 15 |
// A task begins life in suspended animation. |
16 | 16 |
|
17 |
Initial
|
|
17 |
FirstPoint
|
|
18 | 18 |
|
19 | 19 |
Entry { |
20 | 20 |
setQuestion("RECTANGULO" + "\n" + |
... | ... | |
27 | 27 |
{ |
28 | 28 |
|
29 | 29 |
addPoint(pointX:double,pointY:double) |
30 |
First {
|
|
30 |
SecondPointOrSquare {
|
|
31 | 31 |
setQuestion("Insertar punto de esquina opuesta o Cuadrado[C]"); |
32 | 32 |
setDescription(new String[]{"Cuadrado","Cancelar"}); |
33 | 33 |
addPoint(pointX,pointY); |
34 | 34 |
} |
35 | 35 |
|
36 | 36 |
} |
37 |
First{
|
|
37 |
SecondPointOrSquare{
|
|
38 | 38 |
addPoint(pointX:double,pointY:double) |
39 |
Third {
|
|
39 |
FirstPoint {
|
|
40 | 40 |
addPoint(pointX,pointY); |
41 | 41 |
end(); |
42 | 42 |
} |
43 | 43 |
addOption(s:String) |
44 | 44 |
[s.equals("c") || s.equals("C") || s.equals("Cuadrado")] |
45 |
Second { |
|
45 |
SecondPointSquare {
|
|
46 | 46 |
setQuestion("Insertar esquina opuesta"); |
47 | 47 |
setDescription(new String[]{"Cancelar"}); |
48 | 48 |
addOption(s); |
49 | 49 |
} |
50 | 50 |
|
51 | 51 |
} |
52 |
Second{ |
|
52 |
SecondPointSquare{
|
|
53 | 53 |
addPoint(pointX:double,pointY:double) |
54 |
Fourth {
|
|
54 |
FirstPoint {
|
|
55 | 55 |
addPoint(pointX,pointY); |
56 | 56 |
end(); |
57 | 57 |
} |
58 | 58 |
} |
59 |
Third{ |
|
60 |
} |
|
61 |
Fourth{ |
|
62 |
} |
|
59 |
|
|
63 | 60 |
Default |
64 | 61 |
{ |
65 | 62 |
addOption(s:String) |
66 | 63 |
[s.equals("Cancelar")] |
67 |
Initial{
|
|
64 |
FirstPoint{
|
|
68 | 65 |
end(); |
69 | 66 |
} |
70 | 67 |
} |
trunk/extensions/extCAD/sm/ArcCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Arc::FirstPoint
|
|
9 | 9 |
%class ArcCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.ArcCADTool |
12 | 12 |
|
13 |
%map ExecuteMap
|
|
13 |
%map Arc
|
|
14 | 14 |
%% |
15 | 15 |
// A task begins life in suspended animation. |
16 | 16 |
|
17 |
Initial
|
|
17 |
FirstPoint
|
|
18 | 18 |
|
19 | 19 |
Entry { |
20 | 20 |
setQuestion("ARCO" + "\n"+ |
... | ... | |
26 | 26 |
|
27 | 27 |
{ |
28 | 28 |
addPoint( pointX:double,pointY:double) |
29 |
First {
|
|
29 |
SecondPoint {
|
|
30 | 30 |
setQuestion("Insertar segundo punto"); |
31 | 31 |
setDescription(new String[]{"Cancelar"}); |
32 | 32 |
addPoint( pointX,pointY); |
33 | 33 |
} |
34 | 34 |
|
35 | 35 |
} |
36 |
First{
|
|
36 |
SecondPoint{
|
|
37 | 37 |
addPoint( pointX:double,pointY:double) |
38 |
Second {
|
|
38 |
ThirdPoint {
|
|
39 | 39 |
setQuestion("Insertar ultimo punto"); |
40 | 40 |
setDescription(new String[]{"Cancelar"}); |
41 | 41 |
addPoint( pointX,pointY); |
42 | 42 |
} |
43 | 43 |
} |
44 |
Second{
|
|
44 |
ThirdPoint{
|
|
45 | 45 |
addPoint( pointX:double,pointY:double) |
46 |
Third {
|
|
46 |
FirstPoint {
|
|
47 | 47 |
addPoint(pointX,pointY); |
48 | 48 |
end(); |
49 | 49 |
} |
50 | 50 |
} |
51 |
Third{ |
|
52 |
} |
|
51 |
|
|
53 | 52 |
Default |
54 | 53 |
{ |
55 | 54 |
addOption(s:String) |
56 | 55 |
[s.equals("Cancelar")] |
57 |
Initial{
|
|
56 |
FirstPoint{
|
|
58 | 57 |
end(); |
59 | 58 |
} |
60 | 59 |
} |
trunk/extensions/extCAD/sm/SelectionCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Selection::FirstPoint
|
|
9 | 9 |
%class SelectionCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.SelectionCADTool |
12 | 12 |
%import com.iver.cit.gvsig.fmap.layers.FBitSet |
13 | 13 |
|
14 |
%map ExecuteMap
|
|
14 |
%map Selection
|
|
15 | 15 |
%% |
16 | 16 |
// A task begins life in suspended animation. |
17 | 17 |
|
18 |
Initial
|
|
18 |
FirstPoint
|
|
19 | 19 |
|
20 | 20 |
Entry { |
21 | 21 |
setQuestion("SELECCION" + "\n" + |
... | ... | |
28 | 28 |
{ |
29 | 29 |
addPoint(pointX:double,pointY:double) |
30 | 30 |
[!ctxt.isSelected(pointX,pointY)] |
31 |
First {
|
|
31 |
SecondPoint{
|
|
32 | 32 |
setQuestion("Precise segundo punto del rect?ngulo de seleccion"); |
33 | 33 |
setDescription(new String[]{"Cancelar"}); |
34 | 34 |
addPoint(pointX,pointY); |
35 | 35 |
} |
36 | 36 |
addPoint(pointX:double,pointY:double) |
37 | 37 |
[ctxt.isSelected(pointX,pointY)] |
38 |
Second {
|
|
38 |
EndPoint {
|
|
39 | 39 |
setQuestion("Precise punto destino"); |
40 | 40 |
setDescription(new String[]{"Cancelar"}); |
41 | 41 |
addPoint(pointX,pointY); |
42 | 42 |
} |
43 | 43 |
} |
44 | 44 |
|
45 |
First{
|
|
45 |
SecondPoint{
|
|
46 | 46 |
addPoint(pointX:double,pointY:double) |
47 |
Initial {
|
|
47 |
FirstPoint {
|
|
48 | 48 |
setQuestion("Precise punto de estiramiento"); |
49 | 49 |
setDescription(new String[]{"Cancelar"}); |
50 | 50 |
addPoint(pointX,pointY); |
... | ... | |
53 | 53 |
|
54 | 54 |
|
55 | 55 |
} |
56 |
Second{
|
|
56 |
EndPoint{
|
|
57 | 57 |
addPoint(pointX:double,pointY:double) |
58 |
Third {
|
|
58 |
FirstPoint {
|
|
59 | 59 |
setQuestion("Precise punto destino"); |
60 | 60 |
setDescription(new String[]{"Cancelar"}); |
61 | 61 |
addPoint(pointX,pointY); |
... | ... | |
63 | 63 |
refresh(); |
64 | 64 |
} |
65 | 65 |
} |
66 |
Third{ |
|
67 |
} |
|
66 |
|
|
68 | 67 |
Default |
69 | 68 |
{ |
70 | 69 |
addOption(s:String) |
71 | 70 |
[s.equals("Cancelar")] |
72 |
Initial{
|
|
71 |
FirstPoint{
|
|
73 | 72 |
end(); |
74 | 73 |
} |
75 | 74 |
} |
trunk/extensions/extCAD/sm/LineCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Line::FirstPoint
|
|
9 | 9 |
%class LineCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.LineCADTool |
12 | 12 |
|
13 |
%map ExecuteMap
|
|
13 |
%map Line
|
|
14 | 14 |
%% |
15 | 15 |
// A task begins life in suspended animation. |
16 | 16 |
|
17 |
Initial
|
|
17 |
FirstPoint
|
|
18 | 18 |
|
19 | 19 |
Entry { |
20 | 20 |
setQuestion("LINEA" + "\n" + |
... | ... | |
27 | 27 |
{ |
28 | 28 |
|
29 | 29 |
addPoint( pointX:double,pointY:double) |
30 |
First {
|
|
30 |
SecondPointOrAngle {
|
|
31 | 31 |
setQuestion("Insertar segundo punto o angulo"); |
32 | 32 |
setDescription(new String[]{"Cancelar"}); |
33 | 33 |
addPoint( pointX,pointY); |
34 | 34 |
} |
35 | 35 |
|
36 | 36 |
} |
37 |
First{
|
|
37 |
SecondPointOrAngle{
|
|
38 | 38 |
addPoint( pointX:double,pointY:double) |
39 |
First {
|
|
39 |
SecondPointOrAngle {
|
|
40 | 40 |
setQuestion("Insertar segundo punto o angulo"); |
41 | 41 |
setDescription(new String[]{"Cancelar"}); |
42 | 42 |
addPoint( pointX,pointY); |
43 | 43 |
} |
44 | 44 |
addValue( d:double) |
45 |
Second {
|
|
45 |
LenghtOrPoint {
|
|
46 | 46 |
setQuestion("Insertar longitud o punto"); |
47 | 47 |
setDescription(new String[]{"Cancelar"}); |
48 | 48 |
addValue( d); |
49 | 49 |
} |
50 | 50 |
|
51 | 51 |
} |
52 |
Second{
|
|
52 |
LenghtOrPoint{
|
|
53 | 53 |
addPoint( pointX:double,pointY:double) |
54 |
First {
|
|
54 |
SecondPointOrAngle {
|
|
55 | 55 |
setQuestion("Insertar segundo punto o angulo"); |
56 | 56 |
setDescription(new String[]{"Cancelar"}); |
57 | 57 |
addPoint( pointX,pointY); |
58 | 58 |
} |
59 | 59 |
addValue( d:double) |
60 |
First {
|
|
60 |
SecondPointOrAngle {
|
|
61 | 61 |
setQuestion("Insertar segundo punto o angulo"); |
62 | 62 |
setDescription(new String[]{"Cancelar"}); |
63 | 63 |
addValue( d); |
... | ... | |
67 | 67 |
{ |
68 | 68 |
addOption(s:String) |
69 | 69 |
[s.equals("Cancelar")] |
70 |
Initial{
|
|
70 |
FirstPoint{
|
|
71 | 71 |
end(); |
72 | 72 |
} |
73 | 73 |
} |
trunk/extensions/extCAD/sm/PolygonCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Polygon::NumberOrCenterPoint
|
|
9 | 9 |
%class PolygonCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.PolygonCADTool |
12 | 12 |
|
13 |
%map ExecuteMap
|
|
13 |
%map Polygon
|
|
14 | 14 |
%% |
15 | 15 |
// A task begins life in suspended animation. |
16 | 16 |
|
17 |
Initial
|
|
17 |
NumberOrCenterPoint
|
|
18 | 18 |
|
19 | 19 |
Entry { |
20 | 20 |
setQuestion("POLIGONO" + "\n" + |
... | ... | |
26 | 26 |
|
27 | 27 |
{ |
28 | 28 |
addValue(d:double) |
29 |
First {
|
|
29 |
CenterPoint {
|
|
30 | 30 |
setQuestion("Insertar punto central del poligono"); |
31 | 31 |
setDescription(new String[]{"Cancelar"}); |
32 | 32 |
addValue(d); |
33 | 33 |
} |
34 | 34 |
addPoint(pointX:double,pointY:double) |
35 |
Second {
|
|
35 |
OptionOrRadiusOrPoint {
|
|
36 | 36 |
setQuestion("Inscrito en el c?rculo[I] o Circunscrito[C]<C>"); |
37 | 37 |
setDescription(new String[]{"Inscrito","Circunscrito","Cancelar"}); |
38 | 38 |
addPoint(pointX,pointY); |
39 | 39 |
} |
40 | 40 |
|
41 | 41 |
} |
42 |
First{
|
|
42 |
CenterPoint{
|
|
43 | 43 |
addPoint(pointX:double,pointY:double) |
44 |
Second {
|
|
44 |
OptionOrRadiusOrPoint {
|
|
45 | 45 |
setQuestion("Inscrito en el c?rculo[I] o Circunscrito[C]<C>"); |
46 | 46 |
setDescription(new String[]{"Inscrito","Circunscrito","Cancelar"}); |
47 | 47 |
addPoint(pointX,pointY); |
48 | 48 |
} |
49 | 49 |
} |
50 |
Second{
|
|
50 |
OptionOrRadiusOrPoint{
|
|
51 | 51 |
addOption(s:String) |
52 |
Third {
|
|
52 |
RadiusOrPoint {
|
|
53 | 53 |
setQuestion("Precise r?dio(r)"); |
54 | 54 |
setDescription(new String[]{"Cancelar"}); |
55 | 55 |
addOption(s); |
56 | 56 |
} |
57 | 57 |
addValue(d:double) |
58 |
Fourth{
|
|
58 |
NumberOrCenterPoint{
|
|
59 | 59 |
addValue(d); |
60 | 60 |
end(); |
61 | 61 |
} |
62 | 62 |
addPoint(pointX:double,pointY:double) |
63 |
Fourth {
|
|
63 |
NumberOrCenterPoint {
|
|
64 | 64 |
addPoint(pointX,pointY); |
65 | 65 |
end(); |
66 | 66 |
} |
67 | 67 |
} |
68 |
Third{
|
|
68 |
RadiusOrPoint{
|
|
69 | 69 |
addPoint(pointX:double,pointY:double) |
70 |
Fourth {
|
|
70 |
NumberOrCenterPoint {
|
|
71 | 71 |
addPoint(pointX,pointY); |
72 | 72 |
end(); |
73 | 73 |
} |
74 | 74 |
addValue(d:double) |
75 |
Fourth{
|
|
75 |
NumberOrCenterPoint{
|
|
76 | 76 |
addValue(d); |
77 | 77 |
end(); |
78 | 78 |
} |
79 | 79 |
} |
80 |
Fourth{ |
|
81 |
} |
|
80 |
|
|
82 | 81 |
Default |
83 | 82 |
{ |
84 | 83 |
addOption(s:String) |
85 | 84 |
[s.equals("Cancelar")] |
86 |
Initial{
|
|
85 |
NumberOrCenterPoint{
|
|
87 | 86 |
end(); |
88 | 87 |
} |
89 | 88 |
} |
trunk/extensions/extCAD/sm/ScaleCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Scale::PointMain
|
|
9 | 9 |
%class ScaleCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.ScaleCADTool |
12 | 12 |
|
13 |
%map ExecuteMap
|
|
13 |
%map Scale
|
|
14 | 14 |
%% |
15 | 15 |
// A task begins life in suspended animation. |
16 | 16 |
|
17 |
Initial
|
|
17 |
PointMain
|
|
18 | 18 |
Entry { |
19 | 19 |
selection(); |
20 | 20 |
setQuestion("ESCALAR" + "\n" + |
... | ... | |
27 | 27 |
|
28 | 28 |
{ |
29 | 29 |
addPoint(pointX:double,pointY:double) |
30 |
First {
|
|
30 |
ScaleFactorOrReference {
|
|
31 | 31 |
setQuestion("Precise factor de escala<2> o Referencia[R]"); |
32 | 32 |
setDescription(new String[]{"Referencia","Cancelar"}); |
33 | 33 |
addPoint(pointX,pointY); |
34 | 34 |
} |
35 | 35 |
} |
36 |
First{
|
|
36 |
ScaleFactorOrReference{
|
|
37 | 37 |
addValue(d:double) |
38 |
Last{
|
|
38 |
PointMain{
|
|
39 | 39 |
addValue(d); |
40 | 40 |
end(); |
41 | 41 |
refresh(); |
42 | 42 |
} |
43 | 43 |
addOption(s:String) |
44 | 44 |
[s.equals(null) || s.equals("")] |
45 |
Last{
|
|
45 |
PointMain{
|
|
46 | 46 |
addOption(s); |
47 | 47 |
end(); |
48 | 48 |
refresh(); |
49 | 49 |
} |
50 | 50 |
addOption(s:String) |
51 | 51 |
[s.equals("R") || s.equals("r") || s.equals("Referencia")] |
52 |
Second{
|
|
52 |
PointOriginOrScaleFactor{
|
|
53 | 53 |
setQuestion("Precise punto origen recta referencia o Factor de escala[F]"); |
54 | 54 |
setDescription(new String[]{"Factor escala","Cancelar"}); |
55 | 55 |
addOption(s); |
56 | 56 |
} |
57 | 57 |
addPoint(pointX:double,pointY:double) |
58 |
Last {
|
|
58 |
PointMain {
|
|
59 | 59 |
addPoint(pointX,pointY); |
60 | 60 |
end(); |
61 | 61 |
refresh(); |
62 | 62 |
} |
63 | 63 |
} |
64 |
Second{
|
|
64 |
PointOriginOrScaleFactor{
|
|
65 | 65 |
addOption(s:String) |
66 | 66 |
[s.equals("F") || s.equals("f") || s.equals("Factor escala")] |
67 |
Initial{
|
|
67 |
PointMain{
|
|
68 | 68 |
setQuestion("Precise factor de escala<2> o Referencia[R]"); |
69 | 69 |
setDescription(new String[]{"Referencia","Cancelar"}); |
70 | 70 |
addOption(s); |
71 | 71 |
} |
72 | 72 |
addPoint(pointX:double,pointY:double) |
73 |
Third {
|
|
73 |
EndPointReference {
|
|
74 | 74 |
setQuestion("Precise punto final recta referencia"); |
75 | 75 |
setDescription(new String[]{"Cancelar"}); |
76 | 76 |
addPoint(pointX,pointY); |
77 | 77 |
} |
78 | 78 |
} |
79 |
Third{
|
|
79 |
EndPointReference{
|
|
80 | 80 |
addPoint(pointX:double,pointY:double) |
81 |
Fourth {
|
|
81 |
OriginPointScale {
|
|
82 | 82 |
setQuestion("Precise punto origen recta escala"); |
83 | 83 |
setDescription(new String[]{"Cancelar"}); |
84 | 84 |
addPoint(pointX,pointY); |
85 | 85 |
} |
86 | 86 |
} |
87 |
Fourth{
|
|
87 |
OriginPointScale{
|
|
88 | 88 |
addPoint(pointX:double,pointY:double) |
89 |
Fiveth {
|
|
89 |
EndPointScale {
|
|
90 | 90 |
setQuestion("Precise punto final recta escala"); |
91 | 91 |
setDescription(new String[]{"Cancelar"}); |
92 | 92 |
addPoint(pointX,pointY); |
93 | 93 |
} |
94 | 94 |
} |
95 |
Fiveth{
|
|
95 |
EndPointScale{
|
|
96 | 96 |
addPoint(pointX:double,pointY:double) |
97 |
Last {
|
|
97 |
PointMain {
|
|
98 | 98 |
addPoint(pointX,pointY); |
99 | 99 |
end(); |
100 | 100 |
refresh(); |
101 | 101 |
} |
102 | 102 |
} |
103 |
Last{ |
|
104 |
} |
|
103 |
|
|
105 | 104 |
Default |
106 | 105 |
{ |
107 | 106 |
addOption(s:String) |
108 | 107 |
[s.equals("Cancelar")] |
109 |
Initial{
|
|
108 |
PointMain{
|
|
110 | 109 |
end(); |
111 | 110 |
} |
112 | 111 |
} |
trunk/extensions/extCAD/sm/PointCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Point::FirstPoint
|
|
9 | 9 |
%class PointCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.PointCADTool |
12 | 12 |
|
13 | 13 |
|
14 |
%map ExecuteMap
|
|
14 |
%map Point
|
|
15 | 15 |
%% |
16 | 16 |
// A task begins life in suspended animation. |
17 | 17 |
|
18 |
Initial
|
|
18 |
FirstPoint
|
|
19 | 19 |
|
20 | 20 |
Entry { |
21 | 21 |
setQuestion("PUNTO" + "\n" + |
... | ... | |
28 | 28 |
{ |
29 | 29 |
|
30 | 30 |
addPoint( pointX:double,pointY:double) |
31 |
First { |
|
31 |
FirstPoint {
|
|
32 | 32 |
setQuestion("Insertar punto"); |
33 | 33 |
setDescription(new String[]{"Cancelar"}); |
34 | 34 |
addPoint( pointX,pointY); |
35 | 35 |
} |
36 | 36 |
} |
37 |
First{ |
|
38 |
addPoint( pointX:double,pointY:double) |
|
39 |
First { |
|
40 |
setQuestion("Insertar punto"); |
|
41 |
setDescription(new String[]{"Cancelar"}); |
|
42 |
addPoint( pointX,pointY); |
|
43 |
} |
|
44 |
} |
|
37 |
|
|
45 | 38 |
Default |
46 | 39 |
{ |
47 | 40 |
addOption(s:String) |
48 | 41 |
[s.equals("Cancelar")] |
49 |
Initial{
|
|
42 |
FirstPoint{
|
|
50 | 43 |
end(); |
51 | 44 |
} |
52 | 45 |
} |
trunk/extensions/extCAD/sm/CopyCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Copy::FirstPointToMove
|
|
9 | 9 |
%class CopyCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.CopyCADTool |
12 | 12 |
|
13 |
%map ExecuteMap
|
|
13 |
%map Copy
|
|
14 | 14 |
%% |
15 | 15 |
// A task begins life in suspended animation. |
16 | 16 |
|
17 |
Initial
|
|
17 |
FirstPointToMove
|
|
18 | 18 |
Entry { |
19 | 19 |
selection(); |
20 | 20 |
setQuestion("COPIAR" + "\n" + |
... | ... | |
27 | 27 |
|
28 | 28 |
{ |
29 | 29 |
addPoint(pointX:double,pointY:double) |
30 |
First {
|
|
30 |
SecondPointToMove {
|
|
31 | 31 |
setQuestion("Precisar segundo punto del desplazamiento"); |
32 | 32 |
setDescription(new String[]{"Cancelar"}); |
33 | 33 |
addPoint(pointX,pointY); |
34 | 34 |
} |
35 | 35 |
} |
36 |
First{
|
|
36 |
SecondPointToMove{
|
|
37 | 37 |
addPoint(pointX:double,pointY:double) |
38 |
Second {
|
|
38 |
FirstPointToMove {
|
|
39 | 39 |
setDescription(new String[]{"Cancelar"}); |
40 | 40 |
addPoint(pointX,pointY); |
41 | 41 |
end(); |
42 | 42 |
refresh(); |
43 | 43 |
} |
44 | 44 |
} |
45 |
Second{ |
|
46 |
} |
|
45 |
|
|
47 | 46 |
Default |
48 | 47 |
{ |
49 | 48 |
addOption(s:String) |
50 | 49 |
[s.equals("Cancelar")] |
51 |
Initial{
|
|
50 |
FirstPointToMove{
|
|
52 | 51 |
end(); |
53 | 52 |
} |
54 | 53 |
} |
trunk/extensions/extCAD/sm/PolylineCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Polyline::FirstPoint
|
|
9 | 9 |
%class PolylineCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.PolylineCADTool |
12 | 12 |
|
13 |
%map ExecuteMap
|
|
13 |
%map Polyline
|
|
14 | 14 |
%% |
15 | 15 |
// A task begins life in suspended animation. |
16 | 16 |
|
17 |
Initial
|
|
17 |
FirstPoint
|
|
18 | 18 |
|
19 | 19 |
Entry { |
20 | 20 |
setQuestion("POLILINEA" + "\n" + |
... | ... | |
26 | 26 |
|
27 | 27 |
{ |
28 | 28 |
addPoint(pointX:double,pointY:double) |
29 |
First {
|
|
29 |
NextPointOrArcOrClose{
|
|
30 | 30 |
setQuestion("Insertar siguiente punto, Arco[A] o Cerrar[C]"); |
31 | 31 |
setDescription(new String[]{"Arco","Cerrar","Cancelar"}); |
32 | 32 |
addPoint(pointX,pointY); |
33 | 33 |
} |
34 | 34 |
} |
35 |
First{
|
|
35 |
NextPointOrArcOrClose{
|
|
36 | 36 |
|
37 | 37 |
addOption(s:String) |
38 | 38 |
[s.equals("A") || s.equals("a") || s.equals("Arco")] |
39 |
Second {
|
|
39 |
NextPointOrLineOrClose {
|
|
40 | 40 |
setQuestion("Insertar punto siguiente, Linea[N] o Cerrar[C]"); |
41 | 41 |
setDescription(new String[]{"Linea","Cerrar","Cancelar"}); |
42 | 42 |
addOption(s); |
43 | 43 |
} |
44 | 44 |
addOption(s:String) |
45 | 45 |
[s.equals("C") || s.equals("c") || s.equals("Cerrar")] |
46 |
Third {
|
|
46 |
FirstPoint {
|
|
47 | 47 |
addOption(s); |
48 | 48 |
closeGeometry(); |
49 | 49 |
endGeometry(); |
50 | 50 |
end(); |
51 | 51 |
} |
52 | 52 |
addPoint(pointX:double,pointY:double) |
53 |
First {
|
|
53 |
NextPointOrArcOrClose {
|
|
54 | 54 |
setQuestion("Insertar siguiente punto, Arco[A] o Cerrar[C]"); |
55 | 55 |
setDescription(new String[]{"Arco","Cerrar","Cancelar"}); |
56 | 56 |
addPoint(pointX,pointY); |
57 | 57 |
} |
58 | 58 |
} |
59 |
Second{
|
|
59 |
NextPointOrLineOrClose{
|
|
60 | 60 |
addPoint(pointX:double,pointY:double) |
61 |
Second {
|
|
61 |
NextPointOrLineOrClose {
|
|
62 | 62 |
setQuestion("Insertar punto siguiente, Linea[N] o Cerrar[C]"); |
63 | 63 |
setDescription(new String[]{"Linea","Cerrar","Cancelar"}); |
64 | 64 |
addPoint(pointX,pointY); |
65 | 65 |
} |
66 | 66 |
addOption(s:String) |
67 | 67 |
[s.equals("N") || s.equals("n") || s.equals("Linea")] |
68 |
First {
|
|
68 |
NextPointOrArcOrClose {
|
|
69 | 69 |
setQuestion("Insertar siguiente punto, Arco[A] o Cerrar[C]"); |
70 | 70 |
setDescription(new String[]{"Arco","Cerrar","Cancelar"}); |
71 | 71 |
addOption(s); |
72 | 72 |
} |
73 | 73 |
addOption(s:String) |
74 | 74 |
[s.equals("C") || s.equals("c") || s.equals("Cerrar")] |
75 |
Third {
|
|
75 |
FirstPoint {
|
|
76 | 76 |
addOption(s); |
77 | 77 |
closeGeometry(); |
78 | 78 |
endGeometry(); |
79 | 79 |
end(); |
80 | 80 |
} |
81 | 81 |
} |
82 |
Third{ |
|
83 |
} |
|
84 |
Fourth{ |
|
85 |
} |
|
82 |
|
|
86 | 83 |
Default |
87 | 84 |
{ |
88 | 85 |
addOption(s:String) |
89 | 86 |
[s.equals("Cancelar")] |
90 |
Initial{
|
|
87 |
FirstPoint{
|
|
91 | 88 |
cancel(); |
92 | 89 |
end(); |
93 | 90 |
} |
trunk/extensions/extCAD/sm/EllipseCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Ellipse::FirstPointAxis
|
|
9 | 9 |
%class EllipseCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.EllipseCADTool |
12 | 12 |
|
13 |
%map ExecuteMap
|
|
13 |
%map Ellipse
|
|
14 | 14 |
%% |
15 | 15 |
// A task begins life in suspended animation. |
16 | 16 |
|
17 |
Initial
|
|
17 |
FirstPointAxis
|
|
18 | 18 |
|
19 | 19 |
Entry { |
20 | 20 |
setQuestion("ELIPSE" + "\n" + |
... | ... | |
26 | 26 |
|
27 | 27 |
{ |
28 | 28 |
addPoint( pointX:double,pointY:double) |
29 |
First {
|
|
29 |
SecondPointAxis {
|
|
30 | 30 |
setQuestion("Insertar punto final de eje de elipse"); |
31 | 31 |
setDescription(new String[]{"Cancelar"}); |
32 | 32 |
addPoint( pointX,pointY); |
33 | 33 |
} |
34 | 34 |
|
35 | 35 |
} |
36 |
First{
|
|
36 |
SecondPointAxis{
|
|
37 | 37 |
addPoint( pointX:double,pointY:double) |
38 |
Second {
|
|
38 |
DistanceOtherAxis {
|
|
39 | 39 |
setQuestion("Insertar distancia al otro eje"); |
40 | 40 |
setDescription(new String[]{"Cancelar"}); |
41 | 41 |
addPoint( pointX,pointY); |
42 | 42 |
} |
43 | 43 |
|
44 | 44 |
} |
45 |
Second{
|
|
45 |
DistanceOtherAxis{
|
|
46 | 46 |
addPoint( pointX:double,pointY:double) |
47 |
Third {
|
|
47 |
FirstPointAxis {
|
|
48 | 48 |
addPoint( pointX,pointY); |
49 | 49 |
end(); |
50 | 50 |
} |
51 | 51 |
addValue( d:double) |
52 |
Fourth {
|
|
52 |
FirstPointAxis {
|
|
53 | 53 |
addValue( d); |
54 | 54 |
end(); |
55 | 55 |
} |
56 | 56 |
} |
57 |
Third{ |
|
58 |
} |
|
59 |
Fourth{ |
|
60 |
} |
|
57 |
|
|
61 | 58 |
Default |
62 | 59 |
{ |
63 | 60 |
addOption(s:String) |
64 | 61 |
[s.equals("Cancelar")] |
65 |
Initial{
|
|
62 |
FirstPointAxis{
|
|
66 | 63 |
end(); |
67 | 64 |
} |
68 | 65 |
} |
trunk/extensions/extCAD/sm/RotateCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Rotate::PointMain
|
|
9 | 9 |
%class RotateCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.RotateCADTool |
12 | 12 |
|
13 |
%map ExecuteMap
|
|
13 |
%map Rotate
|
|
14 | 14 |
%% |
15 | 15 |
// A task begins life in suspended animation. |
16 | 16 |
|
17 |
Initial
|
|
17 |
PointMain
|
|
18 | 18 |
Entry { |
19 | 19 |
selection(); |
20 | 20 |
setQuestion("ROTAR" + "\n" + |
... | ... | |
27 | 27 |
|
28 | 28 |
{ |
29 | 29 |
addPoint(pointX:double,pointY:double) |
30 |
First {
|
|
30 |
AngleOrPoint {
|
|
31 | 31 |
setQuestion("Precise angulo de rotacion"); |
32 | 32 |
setDescription(new String[]{"Cancelar"}); |
33 | 33 |
addPoint(pointX,pointY); |
34 | 34 |
} |
35 | 35 |
} |
36 |
First{
|
|
36 |
AngleOrPoint{
|
|
37 | 37 |
addValue(d:double) |
38 |
Second{
|
|
38 |
PointMain{
|
|
39 | 39 |
setDescription(new String[]{"Cancelar"}); |
40 | 40 |
addValue(d); |
41 | 41 |
end(); |
42 | 42 |
refresh(); |
43 | 43 |
} |
44 | 44 |
addPoint(pointX:double,pointY:double) |
45 |
Second {
|
|
45 |
PointMain {
|
|
46 | 46 |
setDescription(new String[]{"Cancelar"}); |
47 | 47 |
addPoint(pointX,pointY); |
48 | 48 |
end(); |
49 | 49 |
refresh(); |
50 | 50 |
} |
51 | 51 |
} |
52 |
Second{ |
|
53 |
} |
|
52 |
|
|
54 | 53 |
Default |
55 | 54 |
{ |
56 | 55 |
addOption(s:String) |
57 | 56 |
[s.equals("Cancelar")] |
58 |
Initial{
|
|
57 |
PointMain{
|
|
59 | 58 |
end(); |
60 | 59 |
} |
61 | 60 |
} |
trunk/extensions/extCAD/sm/CircleCADTool.sm | ||
---|---|---|
5 | 5 |
// Vicente Caballero Navarro |
6 | 6 |
%} |
7 | 7 |
|
8 |
%start ExecuteMap::Initial
|
|
8 |
%start Circle::CenterPointOr3p
|
|
9 | 9 |
%class CircleCADTool |
10 | 10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 | 11 |
%import com.iver.cit.gvsig.gui.cad.tools.CircleCADTool |
12 | 12 |
|
13 | 13 |
|
14 |
%map ExecuteMap
|
|
14 |
%map Circle
|
|
15 | 15 |
%% |
16 | 16 |
// A task begins life in suspended animation. |
17 | 17 |
|
18 |
Initial
|
|
18 |
CenterPointOr3p
|
|
19 | 19 |
|
20 | 20 |
Entry { |
21 | 21 |
setQuestion("CIRCULO" + "\n" + |
... | ... | |
27 | 27 |
|
28 | 28 |
{ |
29 | 29 |
addPoint( pointX:double,pointY:double) |
30 |
First {
|
|
30 |
PointOrRadius {
|
|
31 | 31 |
setQuestion("Insertar radio o segundo punto"); |
32 | 32 |
setDescription(new String[]{"Cancelar"}); |
33 | 33 |
addPoint( pointX,pointY); |
34 | 34 |
} |
35 | 35 |
addOption( s:String) |
36 | 36 |
[s.equals("3p") || s.equals("3P")] |
37 |
Seventh{
|
|
37 |
FirstPoint{
|
|
38 | 38 |
setQuestion("Insertar primer punto"); |
39 | 39 |
setDescription(new String[]{"Cancelar"}); |
40 | 40 |
addOption( s); |
41 | 41 |
} |
42 | 42 |
} |
43 |
First{
|
|
43 |
PointOrRadius{
|
|
44 | 44 |
addPoint( pointX:double,pointY:double) |
45 |
Sixth {
|
|
45 |
CenterPointOr3p {
|
|
46 | 46 |
addPoint( pointX,pointY); |
47 | 47 |
end(); |
48 | 48 |
} |
49 | 49 |
addValue( d:double) |
50 |
Fiveth {
|
|
50 |
CenterPointOr3p {
|
|
51 | 51 |
addValue( d); |
52 | 52 |
end(); |
53 | 53 |
} |
54 | 54 |
} |
55 |
Second{ |
|
55 |
SecondPoint{
|
|
56 | 56 |
addPoint( pointX:double,pointY:double) |
57 |
Third { |
|
57 |
ThirdPoint {
|
|
58 | 58 |
setQuestion("Insertar tercer punto"); |
59 | 59 |
setDescription(new String[]{"Cancelar"}); |
60 | 60 |
addPoint( pointX,pointY); |
61 | 61 |
} |
62 | 62 |
} |
63 |
Third{ |
|
63 |
ThirdPoint{
|
|
64 | 64 |
addPoint( pointX:double,pointY:double) |
65 |
Fourth {
|
|
65 |
CenterPointOr3p {
|
|
66 | 66 |
addPoint( pointX,pointY); |
67 | 67 |
end(); |
68 | 68 |
} |
69 | 69 |
} |
70 | 70 |
|
71 |
Fourth{ |
|
72 |
} |
|
73 |
Fiveth{ |
|
74 |
} |
|
75 |
Sixth{ |
|
76 |
} |
|
77 |
Seventh{ |
|
71 |
FirstPoint{ |
|
78 | 72 |
addPoint( pointX:double,pointY:double) |
79 |
Second { |
|
73 |
SecondPoint {
|
|
80 | 74 |
setQuestion("Insertar segundo punto"); |
81 | 75 |
setDescription(new String[]{"Cancelar"}); |
82 | 76 |
addPoint( pointX,pointY); |
... | ... | |
87 | 81 |
{ |
88 | 82 |
addOption(s:String) |
89 | 83 |
[s.equals("Cancelar")] |
90 |
Initial{
|
|
84 |
CenterPointOr3p{
|
|
91 | 85 |
end(); |
92 | 86 |
} |
93 | 87 |
} |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/UndoCommandExtension.java | ||
---|---|---|
71 | 71 |
*/ |
72 | 72 |
public void execute(String s) { |
73 | 73 |
View vista = (View) PluginServices.getMDIManager().getActiveView(); |
74 |
MapControl mapControl = (MapControl) vista.getMapControl(); |
|
75 | 74 |
|
75 |
|
|
76 | 76 |
if (s.compareTo("UNDO") == 0) { |
77 |
try { |
|
78 |
FLayers layers=mapControl.getMapContext().getLayers(); |
|
79 |
for (int i=0;i<layers.getLayersCount();i++){ |
|
80 |
if (layers.getLayer(i) instanceof FLyrVect && layers.getLayer(i).isEditing()){ |
|
81 |
VectorialEditableAdapter vea=(VectorialEditableAdapter)((FLyrVect)layers.getLayer(i)).getSource(); |
|
82 |
vea.undo(); |
|
83 |
} |
|
77 |
undo(vista); |
|
78 |
} |
|
79 |
} |
|
80 |
|
|
81 |
private void undo(View vista) { |
|
82 |
MapControl mapControl = (MapControl) vista.getMapControl(); |
|
83 |
try { |
|
84 |
FLayers layers=mapControl.getMapContext().getLayers(); |
|
85 |
for (int i=0;i<layers.getLayersCount();i++){ |
|
86 |
if (layers.getLayer(i) instanceof FLyrVect && layers.getLayer(i).isEditing()){ |
|
87 |
VectorialEditableAdapter vea=(VectorialEditableAdapter)((FLyrVect)layers.getLayer(i)).getSource(); |
|
88 |
vea.undo(); |
|
84 | 89 |
} |
85 |
} catch (DriverIOException e) { |
|
86 |
NotificationManager.addError("Error accediendo a los Drivers para deshacer un comando", |
|
87 |
e); |
|
88 |
} catch (IOException e) { |
|
89 |
NotificationManager.addError("Error accediendo al fichero para deshacer un comando", |
|
90 |
e); |
|
91 | 90 |
} |
91 |
} catch (DriverIOException e) { |
|
92 |
NotificationManager.addError("Error accediendo a los Drivers para deshacer un comando", |
|
93 |
e); |
|
94 |
} catch (IOException e) { |
|
95 |
NotificationManager.addError("Error accediendo al fichero para deshacer un comando", |
|
96 |
e); |
|
97 |
} |
|
98 |
//vista.getMapControl().cancelDrawing(); |
|
99 |
vista.getMapControl().drawMap(false); |
|
92 | 100 |
|
93 |
vista.getMapControl().drawMap(false); |
|
94 |
} |
|
95 | 101 |
} |
96 | 102 |
|
97 | 103 |
/** |
... | ... | |
102 | 108 |
MapControl mapControl = (MapControl) vista.getMapControl(); |
103 | 109 |
FLayers layers=mapControl.getMapContext().getLayers(); |
104 | 110 |
for (int i=0;i<layers.getLayersCount();i++){ |
105 |
if (layers.getLayer(i) instanceof FLyrVect && layers.getLayer(i).isEditing()){ |
|
111 |
if (layers.getLayer(i) instanceof FLyrVect && ((FLyrVect)layers.getLayer(i)).getSource() instanceof VectorialEditableAdapter && layers.getLayer(i).isEditing()){
|
|
106 | 112 |
VectorialEditableAdapter vea=(VectorialEditableAdapter)((FLyrVect)layers.getLayer(i)).getSource(); |
107 | 113 |
if (vea==null)return false; |
108 | 114 |
return vea.moreUndoCommands(); |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/LineCADTool.java | ||
---|---|---|
111 | 111 |
LineCADToolState actualState = (LineCADToolState) _fsm.getPreviousState(); |
112 | 112 |
String status = actualState.getName(); |
113 | 113 |
|
114 |
if (status.equals("ExecuteMap.Initial")) {
|
|
114 |
if (status.equals("Line.FirstPoint")) {
|
|
115 | 115 |
firstPoint = new Point2D.Double(x, y); |
116 |
} else if (status == "ExecuteMap.First") {
|
|
116 |
} else if (status == "Line.SecondPointOrAngle") {
|
|
117 | 117 |
lastPoint = new Point2D.Double(x, y); |
118 | 118 |
|
119 | 119 |
GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, |
... | ... | |
122 | 122 |
elShape.lineTo(lastPoint.getX(), lastPoint.getY()); |
123 | 123 |
addGeometry(ShapeFactory.createPolyline2D(elShape)); |
124 | 124 |
firstPoint = (Point2D) lastPoint.clone(); |
125 |
} else if (status == "ExecuteMap.Fourth") {
|
|
125 |
} else if (status == "Line.LenghtOrPoint") {
|
|
126 | 126 |
length = firstPoint.distance(x, y); |
127 | 127 |
|
128 | 128 |
double w = (Math.cos(Math.toRadians(angle))) * length; |
... | ... | |
154 | 154 |
LineCADToolState actualState = _fsm.getState(); |
155 | 155 |
String status = actualState.getName(); |
156 | 156 |
|
157 |
if ((status != "ExecuteMap.Initial")) { // || (status == "5")) {
|
|
157 |
if ((status != "Line.FirstPoint")) { // || (status == "5")) {
|
|
158 | 158 |
|
159 | 159 |
if (firstPoint != null) { |
160 | 160 |
drawLine((Graphics2D) g, firstPoint, new Point2D.Double(x, y)); |
... | ... | |
179 | 179 |
LineCADToolState actualState = (LineCADToolState) _fsm.getPreviousState(); |
180 | 180 |
String status = actualState.getName(); |
181 | 181 |
|
182 |
if (status == "ExecuteMap.Second") {
|
|
182 |
if (status == "Line.SecondPointOrAngle") {
|
|
183 | 183 |
angle = d; |
184 |
} else if (status == "ExecuteMap.Third") {
|
|
184 |
} else if (status == "Line.LenghtOrPoint") {
|
|
185 | 185 |
length = d; |
186 | 186 |
|
187 | 187 |
double w = Math.cos(Math.toRadians(angle)) * length; |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/PolygonCADTool.java | ||
---|---|---|
114 | 114 |
PolygonCADToolState actualState = (PolygonCADToolState) _fsm.getPreviousState(); |
115 | 115 |
String status = actualState.getName(); |
116 | 116 |
|
117 |
if (status.equals("ExecuteMap.Initial")) {
|
|
117 |
if (status.equals("Polygon.NumberOrCenterPoint")) {
|
|
118 | 118 |
center = new Point2D.Double(x, y); |
119 |
} else if (status.equals("ExecuteMap.First")) {
|
|
119 |
} else if (status.equals("Polygon.CenterPoint")) {
|
|
120 | 120 |
center = new Point2D.Double(x, y); |
121 |
} else if (status.equals("ExecuteMap.Second") ||
|
|
122 |
status.equals("ExecuteMap.Third")) {
|
|
121 |
} else if (status.equals("Polygon.OptionOrRadiusOrPoint") ||
|
|
122 |
status.equals("Polygon.RadiusOrPoint")) {
|
|
123 | 123 |
Point2D point = new Point2D.Double(x, y); |
124 | 124 |
//Pol?gono a partir de la circunferencia. |
125 | 125 |
if (isI) { |
... | ... | |
144 | 144 |
PolygonCADToolState actualState = _fsm.getState(); |
145 | 145 |
String status = actualState.getName(); |
146 | 146 |
|
147 |
if (status.equals("ExecuteMap.First") ||
|
|
148 |
status.equals("ExecuteMap.Second") ||
|
|
149 |
status.equals("ExecuteMap.Third")) {
|
|
147 |
if (status.equals("Polygon.CenterPoint") ||
|
|
148 |
status.equals("Polygon.OptionOrRadiusOrPoint") ||
|
|
149 |
status.equals("Polygon.RadiusOrPoint")) {
|
|
150 | 150 |
Point2D point = new Point2D.Double(x, y); |
151 | 151 |
drawLine((Graphics2D) g, center, point); |
152 | 152 |
|
... | ... | |
176 | 176 |
PolygonCADToolState actualState = (PolygonCADToolState) _fsm.getPreviousState(); |
177 | 177 |
String status = actualState.getName(); |
178 | 178 |
|
179 |
if (status.equals("ExecuteMap.Second")) {
|
|
179 |
if (status.equals("Polygon.OptionOrRadiusOrPoint")) {
|
|
180 | 180 |
if (s.equals("C") || s.equals("c") || s.equals("Circunscrito")) { |
181 | 181 |
isI = false; |
182 | 182 |
} else if (s.equals("I") || s.equals("i") || s.equals("Inscrito")) { |
... | ... | |
192 | 192 |
PolygonCADToolState actualState = (PolygonCADToolState) _fsm.getPreviousState(); |
193 | 193 |
String status = actualState.getName(); |
194 | 194 |
|
195 |
if (status.equals("ExecuteMap.Initial")) {
|
|
195 |
if (status.equals("Polygon.NumberOrCenterPoint")) {
|
|
196 | 196 |
numLines = (int) d; |
197 |
} else if (status.equals("ExecuteMap.Second") ||
|
|
198 |
status.equals("ExecuteMap.Third")) {
|
|
197 |
} else if (status.equals("Polygon.OptionOrRadiusOrPoint") ||
|
|
198 |
status.equals("Polygon.RadiusOrPoint")) {
|
|
199 | 199 |
double radio = d; |
200 | 200 |
|
201 | 201 |
//Pol?gono a partir de radio. |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/ScaleCADTool.java | ||
---|---|---|
138 | 138 |
FBitSet selection = vea.getSelection(); |
139 | 139 |
|
140 | 140 |
|
141 |
if (status.equals("ExecuteMap.Initial")) {
|
|
141 |
if (status.equals("Scale.PointMain")) {
|
|
142 | 142 |
firstPoint = new Point2D.Double(x, y); |
143 | 143 |
scalePoint = firstPoint; |
144 |
} else if (status.equals("ExecuteMap.First")) {
|
|
144 |
} else if (status.equals("Scale.ScaleFactorOrReference")) {
|
|
145 | 145 |
PluginServices.getMDIManager().setWaitCursor(); |
146 | 146 |
lastPoint = new Point2D.Double(x, y); |
147 | 147 |
|
... | ... | |
160 | 160 |
} |
161 | 161 |
|
162 | 162 |
PluginServices.getMDIManager().restoreCursor(); |
163 |
} else if (status.equals("ExecuteMap.Second")) {
|
|
163 |
} else if (status.equals("Scale.PointOriginOrScaleFactor")) {
|
|
164 | 164 |
orr = new Point2D.Double(x, y); |
165 |
} else if (status.equals("ExecuteMap.Third")) {
|
|
165 |
} else if (status.equals("Scale.EndPointReference")) {
|
|
166 | 166 |
frr = new Point2D.Double(x, y); |
167 |
} else if (status.equals("ExecuteMap.Fourth")) {
|
|
167 |
} else if (status.equals("Scale.OriginPointScale")) {
|
|
168 | 168 |
ore = new Point2D.Double(x, y); |
169 | 169 |
firstPoint = ore; |
170 |
} else if (status.equals("ExecuteMap.Fiveth")) {
|
|
170 |
} else if (status.equals("Scale.EndPointScale")) {
|
|
171 | 171 |
fre = new Point2D.Double(x, y); |
172 | 172 |
|
173 | 173 |
double distrr = orr.distance(frr); |
... | ... | |
184 | 184 |
|
185 | 185 |
} |
186 | 186 |
|
187 |
|
|
188 |
|
|
189 |
|
|
190 |
if (status.equals("ExecuteMap.Initial")) { |
|
191 |
firstPoint = new Point2D.Double(x, y); |
|
192 |
} else if (status.equals("ExecuteMap.First")) { |
|
193 |
PluginServices.getMDIManager().setWaitCursor(); |
|
194 |
lastPoint = new Point2D.Double(x,y); |
|
195 |
|
|
196 |
double w; |
|
197 |
double h; |
|
198 |
w = lastPoint.getX() - firstPoint.getX(); |
|
199 |
h = lastPoint.getY() - firstPoint.getY(); |
|
200 |
|
|
201 |
try { |
|
202 |
getCadToolAdapter().getVectorialAdapter().startComplexRow(); |
|
203 |
|
|
204 |
for (int i = selection.nextSetBit(0); i >= 0; |
|
205 |
i = selection.nextSetBit(i + 1)) { |
|
206 |
DefaultFeature fea = (DefaultFeature)getCadToolAdapter().getVectorialAdapter().getRow(i).cloneRow(); |
|
207 |
UtilFunctions.rotateGeom(fea.getGeometry(), -Math.atan2(w, h) + (Math.PI / 2), |
|
208 |
firstPoint.getX(), firstPoint.getY()); |
|
209 |
// fea.getGeometry().rotate(-Math.atan2(w, h) + (Math.PI / 2), |
|
210 |
// firstPoint.getX(), firstPoint.getY()); |
|
211 |
getCadToolAdapter().getVectorialAdapter().modifyRow(i, fea); |
|
212 |
} |
|
213 |
|
|
214 |
getCadToolAdapter().getVectorialAdapter().endComplexRow(); |
|
215 |
} catch (DriverIOException e) { |
|
216 |
e.printStackTrace(); |
|
217 |
} catch (IOException e1) { |
|
218 |
e1.printStackTrace(); |
|
219 |
} |
|
220 |
|
|
221 |
PluginServices.getMDIManager().restoreCursor(); |
|
222 |
} |
|
223 | 187 |
} |
224 | 188 |
|
225 | 189 |
/** |
... | ... | |
238 | 202 |
Point2D currentPoint = new Point2D.Double(x, y); |
239 | 203 |
|
240 | 204 |
|
241 |
if (status.equals("ExecuteMap.First")) {
|
|
205 |
if (status.equals("Scale.ScaleFactorOrReference")) {
|
|
242 | 206 |
try { |
243 | 207 |
for (int i = 0; i < vea.getRowCount(); i++) { |
244 | 208 |
if (selection.get(i)) { |
245 | 209 |
IGeometry geometry = vea.getShape(i); |
246 | 210 |
double size=getCadToolAdapter().getMapControl().getViewPort().toMapDistance(getCadToolAdapter().getMapControl().getWidth()); |
247 |
UtilFunctions.scaleGeom(geometry, firstPoint,
|
|
211 |
UtilFunctions.scaleGeom(geometry, firstPoint, |
|
248 | 212 |
firstPoint.distance(currentPoint)/(size/40), |
249 | 213 |
firstPoint.distance(currentPoint)/(size/40)); |
250 | 214 |
geometry.draw((Graphics2D) g, |
... | ... | |
259 | 223 |
} catch (IOException e) { |
260 | 224 |
e.printStackTrace(); |
261 | 225 |
} |
262 |
} else if (status.equals("ExecuteMap.Fiveth")) {
|
|
226 |
} else if (status.equals("Scale.EndPointScale")) {
|
|
263 | 227 |
try { |
264 | 228 |
for (int i = 0; i < vea.getRowCount(); i++) { |
265 | 229 |
if (selection.get(i)) { |
... | ... | |
295 | 259 |
public void addOption(String s) { |
296 | 260 |
ScaleCADToolState actualState = (ScaleCADToolState) _fsm.getPreviousState(); |
297 | 261 |
String status = actualState.getName(); |
298 |
if (status.equals("ExecuteMap.First")) {
|
|
262 |
if (status.equals("Scale.ScaleFactorOrReference")) {
|
|
299 | 263 |
try { |
300 | 264 |
scale(2); |
301 | 265 |
} catch (DriverIOException e) { |
... | ... | |
314 | 278 |
public void addValue(double d) { |
315 | 279 |
ScaleCADToolState actualState = (ScaleCADToolState) _fsm.getPreviousState(); |
316 | 280 |
String status = actualState.getName(); |
317 |
if (status.equals("ExecuteMap.First")) {
|
|
281 |
if (status.equals("Scale.ScaleFactorOrReference")) {
|
|
318 | 282 |
try { |
319 | 283 |
scale(d); |
320 | 284 |
} catch (DriverIOException e) { |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/PointCADTool.java | ||
---|---|---|
108 | 108 |
PointCADToolState actualState = (PointCADToolState) _fsm.getPreviousState(); |
109 | 109 |
String status = actualState.getName(); |
110 | 110 |
|
111 |
if (status.equals("ExecuteMap.Initial") || |
|
112 |
(status == "ExecuteMap.First")) { |
|
111 |
if (status.equals("Point.FirstPoint")) { |
|
113 | 112 |
addGeometry(ShapeFactory.createPoint2D(x, y)); |
114 | 113 |
} |
115 | 114 |
} |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/CopyCADTool.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.gui.cad.tools; |
42 | 42 |
|
43 |
import com.iver.andami.PluginServices; |
|
43 |
import java.awt.Graphics; |
|
44 |
import java.awt.Graphics2D; |
|
45 |
import java.awt.geom.Point2D; |
|
46 |
import java.io.IOException; |
|
44 | 47 |
|
48 |
import com.iver.andami.PluginServices; |
|
45 | 49 |
import com.iver.cit.gvsig.CADExtension; |
46 | 50 |
import com.iver.cit.gvsig.fmap.core.DefaultFeature; |
47 | 51 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
... | ... | |
54 | 58 |
import com.iver.cit.gvsig.gui.cad.tools.smc.CopyCADToolContext; |
55 | 59 |
import com.iver.cit.gvsig.gui.cad.tools.smc.CopyCADToolContext.CopyCADToolState; |
56 | 60 |
|
57 |
import java.awt.Graphics; |
|
58 |
import java.awt.Graphics2D; |
|
59 |
import java.awt.geom.AffineTransform; |
|
60 |
import java.awt.geom.Point2D; |
|
61 | 61 |
|
62 |
import java.io.IOException; |
|
63 |
|
|
64 |
|
|
65 | 62 |
/** |
66 | 63 |
* DOCUMENT ME! |
67 | 64 |
* |
... | ... | |
134 | 131 |
VectorialEditableAdapter vea = getCadToolAdapter().getVectorialAdapter(); |
135 | 132 |
FBitSet selection = vea.getSelection(); |
136 | 133 |
|
137 |
if (status.equals("ExecuteMap.Initial")) {
|
|
134 |
if (status.equals("Copy.FirstPointToMove")) {
|
|
138 | 135 |
firstPoint = new Point2D.Double(x, y); |
139 |
} else if (status.equals("ExecuteMap.First")) {
|
|
136 |
} else if (status.equals("Copy.SecondPointToMove")) {
|
|
140 | 137 |
PluginServices.getMDIManager().setWaitCursor(); |
141 | 138 |
lastPoint = new Point2D.Double(x, y); |
142 | 139 |
vea.startComplexRow(); |
... | ... | |
193 | 190 |
e.printStackTrace(); |
194 | 191 |
} |
195 | 192 |
|
196 |
if (status.equals("ExecuteMap.First")) {
|
|
193 |
if (status.equals("Copy.SecondPointToMove")) {
|
|
197 | 194 |
///int dx = getCadToolAdapter().getMapControl().getViewPort().fromMapDistance(x - firstPoint.getX()); |
198 | 195 |
///int dy = -getCadToolAdapter().getMapControl().getViewPort().fromMapDistance(y - firstPoint.getY()); |
199 | 196 |
///Image img = getCadToolAdapter().getVectorialAdapter().getImage(); |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/PolylineCADTool.java | ||
---|---|---|
139 | 139 |
PolylineCADToolState actualState = (PolylineCADToolState) _fsm.getPreviousState(); |
140 | 140 |
String status = actualState.getName(); |
141 | 141 |
|
142 |
if (status.equals("ExecuteMap.Initial")) {
|
|
142 |
if (status.equals("Polyline.FirstPoint")) {
|
|
143 | 143 |
antPoint = new Point2D.Double(x, y); |
144 | 144 |
|
145 | 145 |
if (firstPoint == null) { |
146 | 146 |
firstPoint = (Point2D) antPoint.clone(); |
147 | 147 |
} |
148 |
} else if (status.equals("ExecuteMap.First")) {
|
|
148 |
} else if (status.equals("Polyline.NextPointOrArcOrClose")) {
|
|
149 | 149 |
Point2D point = new Point2D.Double(x, y); |
150 | 150 |
|
151 | 151 |
if (antPoint != null) { |
... | ... | |
154 | 154 |
elShape.moveTo(antPoint.getX(), antPoint.getY()); |
155 | 155 |
elShape.lineTo(point.getX(), point.getY()); |
156 | 156 |
list.add(ShapeFactory.createPolyline2D(elShape)); |
157 |
|
|
157 |
|
|
158 | 158 |
} |
159 | 159 |
|
160 | 160 |
if (antPoint != null) { |
... | ... | |
162 | 162 |
} |
163 | 163 |
|
164 | 164 |
antPoint = point; |
165 |
} else if (status.equals("ExecuteMap.Second")) {
|
|
165 |
} else if (status.equals("Polyline.NextPointOrLineOrClose")) {
|
|
166 | 166 |
Point2D point = new Point2D.Double(x, y); |
167 | 167 |
Point2D lastp = antPoint; //(Point2D)points.get(i-1); |
168 | 168 |
|
... | ... | |
283 | 283 |
PolylineCADToolState actualState = ((PolylineCADToolContext)_fsm).getState(); |
284 | 284 |
String status = actualState.getName(); |
285 | 285 |
|
286 |
if (status.equals("ExecuteMap.First")) {
|
|
286 |
if (status.equals("Polyline.NextPointOrArcOrClose")) {
|
|
287 | 287 |
for (int i = 0; i < list.size(); i++) { |
288 | 288 |
((IGeometry) list.get(i)).cloneGeometry().draw((Graphics2D) g, |
289 | 289 |
getCadToolAdapter().getMapControl().getViewPort(), |
... | ... | |
291 | 291 |
} |
292 | 292 |
|
293 | 293 |
drawLine((Graphics2D) g, antPoint, new Point2D.Double(x, y)); |
294 |
} else if ((status.equals("ExecuteMap.Second"))) {
|
|
294 |
} else if ((status.equals("Polyline.NextPointOrLineOrClose"))) {
|
|
295 | 295 |
for (int i = 0; i < list.size(); i++) { |
296 | 296 |
((IGeometry) list.get(i)).cloneGeometry().draw((Graphics2D) g, |
297 | 297 |
getCadToolAdapter().getMapControl().getViewPort(), |
... | ... | |
404 | 404 |
PolylineCADToolState actualState = (PolylineCADToolState) _fsm.getPreviousState(); |
405 | 405 |
String status = actualState.getName(); |
406 | 406 |
|
407 |
if (status.equals("ExecuteMap.First")) {
|
|
407 |
if (status.equals("Polyline.NextPointOrArcOrClose")) {
|
|
408 | 408 |
if (s.equals("A") || s.equals("a")) { |
409 | 409 |
//Arco |
410 | 410 |
} else if (s.equals("C") || s.equals("c")) { |
... | ... | |
414 | 414 |
list.add(ShapeFactory.createPolyline2D(elShape)); |
415 | 415 |
//closeGeometry(); |
416 | 416 |
} |
417 |
} else if (status.equals("ExecuteMap.Second")) {
|
|
417 |
} else if (status.equals("Polyline.NextPointOrLineOrClose")) {
|
|
418 | 418 |
if (s.equals("N") || s.equals("n")) { |
419 | 419 |
//L?nea |
420 | 420 |
} else if (s.equals("C") || s.equals("c")) { |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/smc/PointCADToolContext.java | ||
---|---|---|
19 | 19 |
super(); |
20 | 20 |
|
21 | 21 |
_owner = owner; |
22 |
setState(ExecuteMap.Initial);
|
|
23 |
ExecuteMap.Initial.Entry(this);
|
|
22 |
setState(Point.FirstPoint);
|
|
23 |
Point.FirstPoint.Entry(this);
|
|
24 | 24 |
} |
25 | 25 |
|
26 | 26 |
public void addOption(String s) |
... | ... | |
106 | 106 |
// |
107 | 107 |
} |
108 | 108 |
|
109 |
/* package */ static abstract class ExecuteMap
|
|
109 |
/* package */ static abstract class Point
|
|
110 | 110 |
{ |
111 | 111 |
//----------------------------------------------------------- |
112 | 112 |
// Member methods. |
... | ... | |
119 | 119 |
//------------------------------------------------------- |
120 | 120 |
// Statics. |
121 | 121 |
// |
122 |
/* package */ static ExecuteMap_Default.ExecuteMap_Initial Initial; |
|
123 |
/* package */ static ExecuteMap_Default.ExecuteMap_First First; |
|
124 |
private static ExecuteMap_Default Default; |
|
122 |
/* package */ static Point_Default.Point_FirstPoint FirstPoint; |
|
123 |
private static Point_Default Default; |
|
125 | 124 |
|
126 | 125 |
static |
127 | 126 |
{ |
128 |
Initial = new ExecuteMap_Default.ExecuteMap_Initial("ExecuteMap.Initial", 0); |
|
129 |
First = new ExecuteMap_Default.ExecuteMap_First("ExecuteMap.First", 1); |
|
130 |
Default = new ExecuteMap_Default("ExecuteMap.Default", -1); |
|
127 |
FirstPoint = new Point_Default.Point_FirstPoint("Point.FirstPoint", 0); |
|
128 |
Default = new Point_Default("Point.Default", -1); |
|
131 | 129 |
} |
132 | 130 |
|
133 | 131 |
} |
134 | 132 |
|
135 |
protected static class ExecuteMap_Default
|
|
133 |
protected static class Point_Default
|
|
136 | 134 |
extends PointCADToolState |
137 | 135 |
{ |
138 | 136 |
//----------------------------------------------------------- |
139 | 137 |
// Member methods. |
140 | 138 |
// |
141 | 139 |
|
142 |
protected ExecuteMap_Default(String name, int id)
|
|
140 |
protected Point_Default(String name, int id)
|
|
143 | 141 |
{ |
144 | 142 |
super (name, id); |
145 | 143 |
} |
... | ... | |
152 | 150 |
{ |
153 | 151 |
boolean loopbackFlag = |
154 | 152 |
context.getState().getName().equals( |
155 |
ExecuteMap.Initial.getName());
|
|
153 |
Point.FirstPoint.getName());
|
|
156 | 154 |
|
157 | 155 |
if (loopbackFlag == false) |
158 | 156 |
{ |
... | ... | |
166 | 164 |
} |
167 | 165 |
finally |
168 | 166 |
{ |
169 |
context.setState(ExecuteMap.Initial);
|
|
167 |
context.setState(Point.FirstPoint);
|
|
170 | 168 |
|
171 | 169 |
if (loopbackFlag == false) |
172 | 170 |
{ |
... | ... | |
188 | 186 |
// |
Also available in: Unified diff