Revision 38269

View differences:

tags/v2_0_0_Build_2047/extensions/extEditing/distribution/distribution.xml
1
<assembly>
2
	<id>distribution</id>
3
	<formats>
4
		<format>dir</format>
5
	</formats>
6
	<fileSets>
7
	<!-- Extructure for the extension -->
8
		<fileSet>
9
			<directory>config</directory>
10
			<outputDirectory>${extension.install.dir.name}
11
			</outputDirectory>
12
		</fileSet>
13
		<fileSet>
14
			<directory>images</directory>
15
			<outputDirectory>/${extension.install.dir.name}/images
16
			</outputDirectory>
17
		</fileSet>
18
	</fileSets>
19
    <files>
20
        <file>
21
            <source>package.info</source>
22
            <outputDirectory>${extension.install.dir.name}
23
            </outputDirectory>
24
        </file>
25
    </files>
26
	<!--
27
		***********************************************************************
28
	-->
29
  <!-- *													   *-->
30
	<!--
31
		***********************************************************************
32
	-->
33
	<dependencySets>
34
		<dependencySet>
35
			<outputDirectory>${extension.install.dir.name}/${library-dir}
36
			</outputDirectory>
37
			<includes>
38
				<include>org.gvsig:org.gvsig.editing</include>
39
			</includes>
40
		</dependencySet>
41
		<dependencySet>
42
			<outputDirectory>${extension.install.dir.name}/${library-dir}</outputDirectory>
43
			<includes>
44
				<include>net.sf.smc:smc</include>
45
			</includes>
46
		</dependencySet>
47
	</dependencySets>
48
</assembly>
tags/v2_0_0_Build_2047/extensions/extEditing/sm/CopyCADTool.sm
1
// -*- tab-width: 4; -*-
2

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

  
8
%start Copy::FirstPointToMove
9
%class CopyCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.CopyCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

  
15
%map Copy
16
%%
17
// A task begins life in suspended animation.
18

  
19
FirstPointToMove
20
	Entry {
21
		selection();
22
		setQuestion(
23
		PluginServices.getText(this,"insert_point_move"));
24
		setDescription(new String[]{"cancel"});
25

  
26
		}
27
	Exit{
28
		}
29

  
30
	{
31
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			SecondPointToMove {
33
				setQuestion(PluginServices.getText(this,"insert_second_point_move"));
34
				setDescription(new String[]{"cancel"});
35
				addPoint( pointX,pointY,event);
36
				}
37
	}
38
SecondPointToMove{
39
	addPoint( pointX:double,pointY:double,event:InputEvent)
40
		FirstPointToMove {
41
			setDescription(new String[]{"cancel"});
42
			addPoint( pointX,pointY,event);
43
			end();
44
			refresh();
45
			}
46
}
47

  
48
Default
49
{
50
	addOption(s:String)
51
		[s.equals(PluginServices.getText(this,"cancel"))]
52
		FirstPointToMove{
53
			end();
54
			}
55
	addOption(s:String)
56
		FirstPointToMove{
57
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
58
			}
59
	addValue(d:double)
60
		FirstPointToMove{
61
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
62
			}
63
	addPoint(pointX:double,pointY:double,event:InputEvent)
64
		FirstPointToMove{
65
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
66
			}
67
}
68
%%
0 69

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/StretchCADTool.sm
1
// -*- tab-width: 4; -*-
2

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

  
8
%start Stretch::SelFirstPoint
9
%class StretchCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.StretchCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

  
15
%map Stretch
16
%%
17
// A task begins life in suspended animation.
18

  
19
SelFirstPoint
20
	Entry {
21
		selection();
22
		setQuestion(
23
		PluginServices.getText(this,"insert_selection_point"));
24
		setDescription(new String[]{"cancel"});
25

  
26
		}
27
	Exit{
28
		}
29

  
30
	{
31
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			SelLastPoint {
33
				setQuestion(PluginServices.getText(this,"insert_selection_last_point"));
34
				setDescription(new String[]{"cancel"});
35
				addPoint( pointX,pointY,event);
36
				}
37
	}
38
SelLastPoint{
39
	addPoint( pointX:double,pointY:double,event:InputEvent)
40
		MoveFirstPoint {
41
			setQuestion(PluginServices.getText(this,"insert_move_first_point"));
42
			setDescription(new String[]{"cancel"});
43
			addPoint( pointX,pointY,event);
44
			}
45
}
46
MoveFirstPoint{
47
	addPoint( pointX:double,pointY:double,event:InputEvent)
48
		MoveLastPoint {
49
			setQuestion(PluginServices.getText(this,"insert_move_last_point"));
50
			setDescription(new String[]{"cancel"});
51
			addPoint( pointX,pointY,event);
52
			}
53
}
54
MoveLastPoint{
55
	addPoint( pointX:double,pointY:double,event:InputEvent)
56
		SelFirstPoint {
57
			setQuestion(PluginServices.getText(this,"insert_selection_point"));
58
			setDescription(new String[]{"cancel"});
59
			addPoint( pointX,pointY,event);
60
			end();
61
			refresh();
62
			}
63
}
64
Default
65
{
66
	addOption(s:String)
67
		[s.equals(PluginServices.getText(this,"cancel"))]
68
		SelFirstPoint{
69
			end();
70
			}
71
	addOption(s:String)
72
		SelFirstPoint{
73
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
74
			}
75
	addValue(d:double)
76
		SelFirstPoint{
77
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
78
			}
79
	addPoint(pointX:double,pointY:double,event:InputEvent)
80
		SelFirstPoint{
81
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
82
			}
83
}
84
%%
0 85

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/buildSMC.xml
1
<project default="generate">
2
	<property name="smfiles" location="../lib/Smc.jar" />
3
	<property name="javafiles" location="../src/com/iver/cit/gvsig/gui/cad/tools/smc" />
4

  
5
	<target name="generate">
6
		<apply executable="java">
7
			<arg value="-jar" />
8
			<arg value="../lib/Smc.jar"/>
9
			<arg value="-java"/>
10
			<arg value="-d" />
11
			<arg value="../src/com/iver/cit/gvsig/gui/cad/tools/smc" />
12
			<fileset dir="." includes="*.sm"/>
13
		</apply>
14
	</target>
15
	<target name="html">
16
		<apply executable="java">
17
			<arg value="-jar" />
18
			<arg value="../lib/Smc.jar"/>
19
			<arg value="-table"/>
20
			<fileset dir="." includes="*.sm"/>
21
		</apply>
22
	</target>
23
	<target name="dot">
24
		<apply executable="java">
25
			<arg value="-jar" />
26
			<arg value="../lib/Smc.jar"/>
27
			<arg value="-graph"/>
28
			<fileset dir="." includes="*.sm"/>
29
		</apply>
30
	</target>
31
</project>
0 32

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/ComplexSelectionCADTool.sm
1
// -*- tab-width: 4; -*-
2

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

  
8
%start Selection::FirstPoint
9
%class ComplexSelectionCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.ComplexSelectionCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

  
15

  
16
%map Selection
17
%%
18
// A task begins life in suspended animation.
19

  
20
FirstPoint
21

  
22
  Entry {
23
    setQuestion(
24
	    PluginServices.getText(this,"insert_point")+" "+
25
	    PluginServices.getText(this,"cad.or")+" "+
26
	    PluginServices.getText(this,"circle")+
27
	    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
28
	    PluginServices.getText(this,"out_rectangle")+
29
	    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
30
	    PluginServices.getText(this,"polygon")+
31
	    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
32
	    PluginServices.getText(this,"cross_polygon")+
33
	   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
34
	    "#"+PluginServices.getText(this,"out_polygon")+
35
	   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
36
	    PluginServices.getText(this,"cross_circle")+
37
	   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
38
		PluginServices.getText(this,"out_circle")+
39
	   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
40
    setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
41
    }
42
  Exit{
43
    }
44

  
45
  {
46
    addOption(s:String)
47
      FirstPoint{
48
        setQuestion(
49
			PluginServices.getText(this,"insert_point")+" "+
50
		    PluginServices.getText(this,"cad.or")+" "+
51
		    PluginServices.getText(this,"circle")+
52
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
53
		    PluginServices.getText(this,"out_rectangle")+
54
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"], "+
55
		    PluginServices.getText(this,"polygon")+
56
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
57
		    PluginServices.getText(this,"cross_polygon")+
58
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
59
		    "#"+PluginServices.getText(this,"out_polygon")+
60
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
61
		    PluginServices.getText(this,"cross_circle")+
62
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
63
			PluginServices.getText(this,"out_circle")+
64
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
65
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
66
        addOption(s);
67
        }
68
    addPoint( pointX:double,pointY:double,event:InputEvent)
69
      [ctxt.getType().equals(PluginServices.getText(this,"out_rectangle"))]
70
      SecondPointOutRectangle{
71
        setQuestion(PluginServices.getText(this,"insert_second_point_selection"));
72
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
73
        addPoint( pointX,pointY,event);
74
        }
75
    addPoint( pointX:double,pointY:double,event:InputEvent)
76
      [ctxt.getType().equals(PluginServices.getText(this,"inside_circle")) || ctxt.getType().equals(PluginServices.getText(this,"cross_circle")) || ctxt.getType().equals(PluginServices.getText(this,"out_circle"))]
77
      SecondPointCircle{
78
        setQuestion(PluginServices.getText(this,"insert_second_point_selection"));
79
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
80
        addPoint( pointX,pointY,event);
81
        }
82
    addPoint( pointX:double,pointY:double,event:InputEvent)
83
      [ctxt.getType().equals(PluginServices.getText(this,"inside_polygon")) || ctxt.getType().equals(PluginServices.getText(this,"cross_polygon")) || ctxt.getType().equals(PluginServices.getText(this,"out_polygon"))]
84
      NextPointPolygon{
85
        setQuestion(
86
        	PluginServices.getText(this,"insert_next_point_selection_or_end_polygon")+
87
        	"["+PluginServices.getText(this,"ComplexSelectionCADTool.end")+"]");
88
        setDescription(new String[]{"end_polygon","out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
89
        addPoint( pointX,pointY,event);
90
        }
91

  
92
    addPoint( pointX:double,pointY:double,event:InputEvent)
93
      [ctxt.getType().equals(PluginServices.getText(this,"simple")) && ctxt.selectFeatures(pointX,pointY, event) && ctxt.getNextState().equals("Selection.SecondPoint")]
94
      SecondPoint{
95
        setQuestion(PluginServices.getText(this,"insert_second_point_selection"));
96
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
97
        addPoint( pointX,pointY,event);
98
        }
99
//    addPoint( pointX:double,pointY:double,event:InputEvent)
100
//      [ctxt.getType().equals(PluginServices.getText(this,"simple")) && ctxt.getNextState().equals("Selection.WithSelectedFeatures")]
101
//      WithSelectedFeatures {
102
//        setQuestion(PluginServices.getText(this,"select_handlers"));
103
//        setDescription(new String[]{"simple","out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
104
//        addPoint( pointX,pointY,event);
105
//        end();
106
//        }
107
}
108

  
109
SecondPoint{
110
  // Si hemos conseguido seleccionar algo
111
  addPoint( pointX:double,pointY:double,event:InputEvent)
112
      [ctxt.selectWithSecondPoint(pointX,pointY, event) > 0]
113
      WithSelectedFeatures {
114
        setQuestion(PluginServices.getText(this,"select_handlers"));
115
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
116
        addPoint( pointX,pointY,event);
117
        end();
118
        }
119
  // Si no lo hemos conseguido
120
  addPoint( pointX:double,pointY:double,event:InputEvent)
121
      FirstPoint {
122
        setQuestion(
123
			PluginServices.getText(this,"insert_point")+" "+
124
		    PluginServices.getText(this,"cad.or")+" "+
125
		    PluginServices.getText(this,"circle")+
126
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
127
		    PluginServices.getText(this,"out_rectangle")+
128
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
129
		    PluginServices.getText(this,"polygon")+
130
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
131
		    PluginServices.getText(this,"cross_polygon")+
132
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
133
		    "#"+PluginServices.getText(this,"out_polygon")+
134
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
135
		    PluginServices.getText(this,"cross_circle")+
136
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
137
			PluginServices.getText(this,"out_circle")+
138
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
139
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
140
        addPoint(pointX,pointY,event);
141
        }
142
  addOption(s:String)
143
      FirstPoint{
144
        setQuestion(
145
			PluginServices.getText(this,"insert_point")+" "+
146
		    PluginServices.getText(this,"cad.or")+" "+
147
		    PluginServices.getText(this,"circle")+
148
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
149
		    PluginServices.getText(this,"out_rectangle")+
150
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
151
		    PluginServices.getText(this,"polygon")+
152
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
153
		    PluginServices.getText(this,"cross_polygon")+
154
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
155
		    "#"+PluginServices.getText(this,"out_polygon")+
156
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
157
		    PluginServices.getText(this,"cross_circle")+
158
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
159
			PluginServices.getText(this,"out_circle")+
160
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
161
        setDescription(new String[]{"end_polygon","out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
162
        setType(s);
163
        }
164

  
165
}
166
WithSelectedFeatures{
167

  
168
  // Si hemos pinchado encima de un handler
169
  addPoint( pointX:double,pointY:double,event:InputEvent)
170
  [ctxt.selectHandlers(pointX, pointY, event)>0]
171
      WithHandlers {
172
        setQuestion(PluginServices.getText(this,"insert_destination_point"));
173
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
174
        addPoint( pointX,pointY,event);
175
        // refresh();
176
        }
177

  
178
  // Si no hemos cogido un handler, probamos a seleccionar
179
  // otra entidad
180
  addPoint( pointX:double,pointY:double,event:InputEvent)
181
    [ctxt.selectFeatures(pointX,pointY, event) && ctxt.getNextState().equals("Selection.WithSelectedFeatures")]
182
      WithSelectedFeatures {
183
        setQuestion(PluginServices.getText(this,"select_handlers"));
184
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
185
        addPoint( pointX,pointY,event);
186
        }
187

  
188

  
189
  // Cualquier otro caso (hemos pinchado en algo vacio), volvemos al estado inicial
190
  addPoint( pointX:double,pointY:double,event:InputEvent)
191
      FirstPoint {
192
        setQuestion(
193
			PluginServices.getText(this,"insert_point")+" "+
194
		    PluginServices.getText(this,"cad.or")+" "+
195
		    PluginServices.getText(this,"circle")+
196
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
197
		    PluginServices.getText(this,"out_rectangle")+
198
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
199
		    PluginServices.getText(this,"polygon")+
200
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
201
		    PluginServices.getText(this,"cross_polygon")+
202
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
203
		    "#"+PluginServices.getText(this,"out_polygon")+
204
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
205
		    PluginServices.getText(this,"cross_circle")+
206
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
207
			PluginServices.getText(this,"out_circle")+
208
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
209
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
210
        addPoint( pointX,pointY,event);
211
        // refresh();
212
        }
213
	 addOption(s:String)
214
      FirstPoint{
215
        setQuestion(
216
			PluginServices.getText(this,"insert_point")+" "+
217
		    PluginServices.getText(this,"cad.or")+" "+
218
		    PluginServices.getText(this,"circle")+
219
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
220
		    PluginServices.getText(this,"out_rectangle")+
221
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
222
		    PluginServices.getText(this,"polygon")+
223
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
224
		    PluginServices.getText(this,"cross_polygon")+
225
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
226
		    "#"+PluginServices.getText(this,"out_polygon")+
227
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
228
		    PluginServices.getText(this,"cross_circle")+
229
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
230
			PluginServices.getText(this,"out_circle")+
231
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
232
        setDescription(new String[]{"end_polygon","out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
233
        setType(s);
234
        }
235
}
236

  
237
WithHandlers{
238
  addPoint( pointX:double,pointY:double,event:InputEvent)
239
      WithSelectedFeatures {
240
        setQuestion(PluginServices.getText(this,"select_handlers"));
241
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
242
        addPoint( pointX,pointY,event);
243
        refresh();
244
        }
245
}
246

  
247
SecondPointOutRectangle{
248
  // Si hemos conseguido seleccionar algo
249
  addPoint( pointX:double,pointY:double,event:InputEvent)
250
      [ctxt.selectWithSecondPointOutRectangle(pointX,pointY, event) > 0]
251
      WithSelectedFeatures {
252
        setQuestion(PluginServices.getText(this,"select_handlers"));
253
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
254
        addPoint( pointX,pointY,event);
255
        end();
256
        }
257
  // Si no lo hemos conseguido
258
  addPoint( pointX:double,pointY:double,event:InputEvent)
259
      FirstPoint {
260
        setQuestion(
261
			PluginServices.getText(this,"insert_point")+" "+
262
		    PluginServices.getText(this,"cad.or")+" "+
263
		    PluginServices.getText(this,"circle")+
264
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
265
		    PluginServices.getText(this,"out_rectangle")+
266
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
267
		    PluginServices.getText(this,"polygon")+
268
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
269
		    PluginServices.getText(this,"cross_polygon")+
270
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
271
		    "#"+PluginServices.getText(this,"out_polygon")+
272
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
273
		    PluginServices.getText(this,"cross_circle")+
274
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
275
			PluginServices.getText(this,"out_circle")+
276
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
277
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
278
        addPoint(pointX,pointY,event);
279
        }
280
  addOption(s:String)
281
      FirstPoint{
282
        setQuestion(
283
			PluginServices.getText(this,"insert_point")+" "+
284
		    PluginServices.getText(this,"cad.or")+" "+
285
		    PluginServices.getText(this,"circle")+
286
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
287
		    PluginServices.getText(this,"out_rectangle")+
288
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
289
		    PluginServices.getText(this,"polygon")+
290
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
291
		    PluginServices.getText(this,"cross_polygon")+
292
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
293
		    "#"+PluginServices.getText(this,"out_polygon")+
294
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
295
		    PluginServices.getText(this,"cross_circle")+
296
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
297
			PluginServices.getText(this,"out_circle")+
298
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
299
        setDescription(new String[]{"end_polygon","out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
300
        setType(s);
301
        }
302

  
303
}
304
SecondPointCircle{
305
  // Si hemos conseguido seleccionar algo
306
  addPoint( pointX:double,pointY:double,event:InputEvent)
307
      [ctxt.selectWithCircle(pointX,pointY, event) > 0]
308
      WithSelectedFeatures {
309
        setQuestion(PluginServices.getText(this,"select_handlers"));
310
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
311
        addPoint( pointX,pointY,event);
312
        end();
313
        }
314
  // Si no lo hemos conseguido
315
  addPoint( pointX:double,pointY:double,event:InputEvent)
316
      FirstPoint {
317
        setQuestion(
318
			PluginServices.getText(this,"insert_point")+" "+
319
		    PluginServices.getText(this,"cad.or")+" "+
320
		    PluginServices.getText(this,"circle")+
321
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
322
		    PluginServices.getText(this,"out_rectangle")+
323
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
324
		    PluginServices.getText(this,"polygon")+
325
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
326
		    PluginServices.getText(this,"cross_polygon")+
327
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
328
		    "#"+PluginServices.getText(this,"out_polygon")+
329
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
330
		    PluginServices.getText(this,"cross_circle")+
331
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
332
			PluginServices.getText(this,"out_circle")+
333
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
334
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
335
        addPoint(pointX,pointY,event);
336
        }
337
  addOption(s:String)
338
      FirstPoint{
339
        setQuestion(
340
			PluginServices.getText(this,"insert_point")+" "+
341
		    PluginServices.getText(this,"cad.or")+" "+
342
		    PluginServices.getText(this,"circle")+
343
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
344
		    PluginServices.getText(this,"out_rectangle")+
345
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
346
		    PluginServices.getText(this,"polygon")+
347
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
348
		    PluginServices.getText(this,"cross_polygon")+
349
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
350
		    "#"+PluginServices.getText(this,"out_polygon")+
351
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
352
		    PluginServices.getText(this,"cross_circle")+
353
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
354
			PluginServices.getText(this,"out_circle")+
355
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
356
        setDescription(new String[]{"out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
357
        setType(s);
358
        }
359
}
360

  
361
NextPointPolygon{
362
  addPoint( pointX:double,pointY:double,event:InputEvent)
363
      NextPointPolygon {
364
        setQuestion(PluginServices.getText(this,"insert_next_point_selection_or_end_polygon")+
365
        	"["+PluginServices.getText(this,"ComplexSelectionCADTool.end")+"]");
366
        setDescription(new String[]{"end_polygon","out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
367
        addPoint(pointX,pointY,event);
368
        }
369
  addOption(s:String)
370
      FirstPoint{
371
        setQuestion(
372
			PluginServices.getText(this,"insert_point")+" "+
373
		    PluginServices.getText(this,"cad.or")+" "+
374
		    PluginServices.getText(this,"circle")+
375
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.introcircle")+"], "+
376
		    PluginServices.getText(this,"out_rectangle")+
377
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.outrectangle")+"], "+
378
		    PluginServices.getText(this,"polygon")+
379
		    "["+PluginServices.getText(this,"ComplexSelectionCADTool.intropolygon")+"], "+
380
		    PluginServices.getText(this,"cross_polygon")+
381
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosspolygon")+"], "+"\n"+
382
		    "#"+PluginServices.getText(this,"out_polygon")+
383
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outpolygon")+"], "+
384
		    PluginServices.getText(this,"cross_circle")+
385
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.crosscircle")+"], "+
386
			PluginServices.getText(this,"out_circle")+
387
		   	"["+PluginServices.getText(this,"ComplexSelectionCADTool.outcircle")+"]");
388
        setDescription(new String[]{"end_polygon","out_rectangle","inside_polygon","cross_polygon","out_polygon","inside_circle","cross_circle","out_circle","select_all","cancel"});
389
        addOption(s);
390
        }
391
}
392

  
393
Default
394
{
395
  addOption(s:String)
396
    [s.equals(PluginServices.getText(this,"cancel"))]
397
    FirstPoint{
398
      end();
399
      }
400
     addOption(s:String)
401
		FirstPoint{
402
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
403
			}
404
	addValue(d:double)
405
		FirstPoint{
406
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
407
			}
408
	addPoint(pointX:double,pointY:double,event:InputEvent)
409
		FirstPoint{
410
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
411
			}
412
}
413
%%
0 414

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/EquidistanceCADTool.sm
1
// -*- tab-width: 4; -*-
2

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

  
8
%start Equidistance::Distance
9
%class EquidistanceCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.EquidistanceCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

  
15
%map Equidistance
16
%%
17
// A task begins life in suspended animation.
18

  
19
Distance
20
	Entry {
21
		selection();
22
		setQuestion(
23
		PluginServices.getText(this,"insert_first_point_or_distance"));
24
		setDescription(new String[]{"cancel"});
25

  
26
		}
27
	Exit{
28
		}
29

  
30
	{
31

  
32
		addPoint( pointX:double,pointY:double,event:InputEvent)
33
			SecondPointDistance {
34
				setQuestion(PluginServices.getText(this,"insert_second_point"));
35
				setDescription(new String[]{"cancel"});
36
				addPoint( pointX,pointY,event);
37
				}
38
		addValue(d:double)
39
			Position{
40
				setQuestion(PluginServices.getText(this,"position"));
41
				setDescription(new String[]{"cancel"});
42
				addValue(d);
43
				}
44
	}
45
SecondPointDistance{
46
	addPoint( pointX:double,pointY:double,event:InputEvent)
47
		Position {
48
			setQuestion(PluginServices.getText(this,"position"));
49
			setDescription(new String[]{"cancel"});
50
			addPoint( pointX,pointY,event);
51
			}
52
}
53
Position{
54
	addPoint( pointX:double,pointY:double,event:InputEvent)
55
		Distance{
56
			setDescription(new String[]{"cancel"});
57
			addPoint( pointX,pointY,event);
58
			end();
59
			}
60
}
61

  
62
Default
63
{
64
	addOption(s:String)
65
		[s.equals(PluginServices.getText(this,"cancel"))]
66
		Distance{
67
			end();
68
			}
69
	addOption(s:String)
70
		Distance{
71
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
72
			}
73
	addValue(d:double)
74
		Distance{
75
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
76
			}
77
	addPoint(pointX:double,pointY:double,event:InputEvent)
78
		Distance{
79
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
80
			}
81
}
82
%%
0 83

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/EditVertexCADTool.sm
1
// -*- tab-width: 4; -*-
2

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

  
8
%start EditVertex::SelectVertexOrDelete
9
%class EditVertexCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.EditVertexCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

  
15
%map EditVertex
16
%%
17
// A task begins life in suspended animation.
18

  
19
SelectVertexOrDelete
20
	Entry {
21
		selection();
22
		setQuestion(
23
			PluginServices.getText(this,"point")+", "+
24
		    PluginServices.getText(this,"next")+
25
		    "["+PluginServices.getText(this,"EditVertexCADTool.nextvertex")+"], "+
26
		     PluginServices.getText(this,"previous")+
27
		    "["+PluginServices.getText(this,"EditVertexCADTool.previousvertex")+"], "+
28
		     PluginServices.getText(this,"add")+
29
		    "["+PluginServices.getText(this,"EditVertexCADTool.addvertex")+"] "+
30
		    PluginServices.getText(this,"cad.or")+" "+
31
		     PluginServices.getText(this,"del")+
32
		    "["+PluginServices.getText(this,"EditVertexCADTool.delvertex")+"]");
33
		setDescription(new String[]{"next","previous","add","del","cancel"});
34

  
35
		}
36
	Exit{
37
		}
38

  
39
	{
40
		addPoint( pointX:double,pointY:double,event:InputEvent)
41
			SelectVertexOrDelete {
42
				setQuestion(PluginServices.getText(this,"select_from_point"));
43
				setDescription(new String[]{"next","previous","add","del","cancel"});
44
				addPoint( pointX,pointY,event);
45
				}
46
		addOption(s:String)
47
		[s.equals("i") || s.equals("I") || s.equals(PluginServices.getText(this,"add"))]
48
			AddVertex {
49
				setQuestion(PluginServices.getText(this,"add_vertex"));
50
				setDescription(new String[]{"cancel"});
51
				addOption(s);
52
				}
53
		addOption(s:String)
54
		[!s.equals("i") && !s.equals("I") && !s.equals(PluginServices.getText(this,"add"))]
55

  
56
			SelectVertexOrDelete {
57
				setQuestion(
58
					PluginServices.getText(this,"point")+", "+
59
				    PluginServices.getText(this,"next")+
60
				    "["+PluginServices.getText(this,"EditVertexCADTool.nextvertex")+"], "+
61
				     PluginServices.getText(this,"previous")+
62
				    "["+PluginServices.getText(this,"EditVertexCADTool.previousvertex")+"], "+
63
				     PluginServices.getText(this,"add")+
64
				    "["+PluginServices.getText(this,"EditVertexCADTool.addvertex")+"] "+
65
				    PluginServices.getText(this,"cad.or")+" "+
66
				     PluginServices.getText(this,"del")+
67
				    "["+PluginServices.getText(this,"EditVertexCADTool.delvertex")+"]");
68
				setDescription(new String[]{"next","previous","add","del","cancel"});
69
				addOption(s);
70
				}
71
	}
72

  
73
AddVertex{
74
	addPoint( pointX:double,pointY:double,event:InputEvent)
75
			SelectVertexOrDelete {
76
				setQuestion(PluginServices.getText(this,"select_from_point"));
77
				setDescription(new String[]{"next","previous","add","del","cancel"});
78
				addPoint( pointX,pointY,event);
79
			}
80
}
81

  
82
Default
83
{
84
	addOption(s:String)
85
		[s.equals(PluginServices.getText(this,"cancel"))]
86
		SelectVertexOrDelete{
87
			end();
88
			}
89
	addOption(s:String)
90
		SelectVertexOrDelete{
91
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
92
			}
93
	addValue(d:double)
94
		SelectVertexOrDelete{
95
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
96
			}
97
	addPoint(pointX:double,pointY:double,event:InputEvent)
98
		SelectVertexOrDelete{
99
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
100
			}
101
}
102
%%
0 103

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/InternalPolygonCADTool.sm
1
// -*- tab-width: 4; -*-
2

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

  
8
%start InternalPolygon::AddNextPoint
9
%class InternalPolygonCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.InternalPolygonCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

  
15
%map InternalPolygon
16
%%
17
// A task begins life in suspended animation.
18

  
19
AddNextPoint
20
	Entry {
21
		selection();
22
		setQuestion(
23
			PluginServices.getText(this,"next_point")+" "+
24
		    PluginServices.getText(this,"cad.or")+" "+
25
		    PluginServices.getText(this,"end")+
26
		    "["+PluginServices.getText(this,"InternalPolygonCADTool.end")+"]");
27
		setDescription(new String[]{"end","cancel"});
28

  
29
		}
30
	Exit{
31
		}
32

  
33
	{
34
		addPoint( pointX:double,pointY:double,event:InputEvent)
35
			AddNextPoint {
36
				setQuestion(
37
					PluginServices.getText(this,"next_point")+" "+
38
		    		PluginServices.getText(this,"cad.or")+" "+
39
		    		PluginServices.getText(this,"end")+
40
		    		"["+PluginServices.getText(this,"InternalPolygonCADTool.end")+"]");
41
				setDescription(new String[]{"end","cancel"});
42
				addPoint( pointX,pointY,event);
43
				}
44
		addOption(s:String)
45
			AddNextPoint {
46
				setQuestion(
47
					PluginServices.getText(this,"next_point")+" "+
48
		    		PluginServices.getText(this,"cad.or")+" "+
49
		    		"["+PluginServices.getText(this,"InternalPolygonCADTool.end")+"]");
50
				setDescription(new String[]{"end","cancel"});
51
				addOption(s);
52
				}
53
	}
54

  
55

  
56
Default
57
{
58
	addOption(s:String)
59
		[s.equals(PluginServices.getText(this,"cancel"))]
60
		AddNextPoint{
61
			end();
62
			}
63
	addOption(s:String)
64
		AddNextPoint{
65
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
66
			}
67
	addValue(d:double)
68
		AddNextPoint{
69
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
70
			}
71
	addPoint(pointX:double,pointY:double,event:InputEvent)
72
		AddNextPoint{
73
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
74
			}
75
}
76
%%
0 77

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/ExploitCADTool.sm
1
// -*- tab-width: 4; -*-
2

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

  
8
%start Exploit::Execute
9
%class ExploitCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.ExploitCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

  
15
%map Exploit
16
%%
17
// A task begins life in suspended animation.
18

  
19
Execute
20
	Entry {
21
		exploit();
22
		end();
23
		}
24
	Exit{
25
		}
26

  
27
	{
28
	}
29

  
30
Default
31
{
32
	addOption(s:String)
33
		[s.equals(PluginServices.getText(this,"cancel"))]
34
		Execute{
35
			end();
36
			}
37
	addOption(s:String)
38
		Execute{
39
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
40
			}
41
	addValue(d:double)
42
		Execute{
43
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
44
			}
45
	addPoint(pointX:double,pointY:double,event:InputEvent)
46
		Execute{
47
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
48
			}
49
}
50
%%
0 51

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/BreakCADTool.sm
1
// -*- tab-width: 4; -*-
2

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

  
8
%start Break::FirstPoint
9
%class BreakCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.BreakCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

  
15
%map Break
16
%%
17
// A task begins life in suspended animation.
18

  
19
FirstPoint
20
	Entry {
21
		selection();
22
		setQuestion(
23
		PluginServices.getText(this,"insert_first_point"));
24
		setDescription(new String[]{"cancel"});
25

  
26
		}
27
	Exit{
28
		}
29

  
30
	{
31
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			[ctxt.intersects(pointX,pointY)]
33
			SecondPoint {
34
				setQuestion(PluginServices.getText(this,"insert_second_point"));
35
				setDescription(new String[]{"cancel"});
36
				addPoint( pointX,pointY,event);
37
				}
38
		addPoint( pointX:double,pointY:double,event:InputEvent)
39
			[!ctxt.intersects(pointX,pointY)]
40
			FirstPoint {
41
				setQuestion(PluginServices.getText(this,"insert_first_point"));
42
				setDescription(new String[]{"cancel"});
43
				}
44
		addOption(s:String)
45
			FirstPoint {
46
				setQuestion(PluginServices.getText(this,"insert_first_point"));
47
				setDescription(new String[]{"cancel"});
48
				addOption(s);
49
				}
50
	}
51

  
52

  
53
SecondPoint
54
{
55
	addPoint( pointX:double,pointY:double,event:InputEvent)
56
			[ctxt.intersects(pointX,pointY)]
57
			FirstPoint {
58
				setQuestion(PluginServices.getText(this,"insert_first_point"));
59
				setDescription(new String[]{"cancel"});
60
				addPoint( pointX,pointY,event);
61
				end();
62
				}
63
	addPoint( pointX:double,pointY:double,event:InputEvent)
64
			[!ctxt.intersects(pointX,pointY)]
65
			SecondPoint {
66
				setQuestion(PluginServices.getText(this,"insert_second_point"));
67
				setDescription(new String[]{"cancel"});
68
			}
69
		addOption(s:String)
70
			FirstPoint {
71
				setQuestion(PluginServices.getText(this,"insert_first_point"));
72
				setDescription(new String[]{"cancel"});
73
				addOption(s);
74
				}
75
}
76
Default
77
{
78
	addOption(s:String)
79
		[s.equals(PluginServices.getText(this,"cancel"))]
80
		FirstPoint{
81
			end();
82
			}
83
	addOption(s:String)
84
		FirstPoint{
85
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
86
			}
87
	addValue(d:double)
88
		FirstPoint{
89
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
90
			}
91
	addPoint(pointX:double,pointY:double,event:InputEvent)
92
		FirstPoint{
93
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
94
			}
95
}
96
%%
0 97

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/SelectionCADTool.sm
1
// -*- tab-width: 4; -*-
2

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

  
8
%start Selection::FirstPoint
9
%class SelectionCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.SelectionCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

  
15

  
16
%map Selection
17
%%
18
// A task begins life in suspended animation.
19

  
20
FirstPoint
21

  
22
  Entry {
23
    setQuestion(
24
    PluginServices.getText(this,"insert_point_selection"));
25
    setDescription(new String[]{"cancel"});
26
    }
27
  Exit{
28
    }
29

  
30
  {
31

  
32
    addPoint( pointX:double,pointY:double,event:InputEvent)
33
      [ctxt.getType().equals(PluginServices.getText(this,"simple")) && ctxt.selectFeatures(pointX,pointY, event) && ctxt.getNextState().equals("Selection.SecondPoint")]
34
      SecondPoint{
35
        setQuestion(PluginServices.getText(this,"insert_second_point"));
36
        setDescription(new String[]{"cancel"});
37
        addPoint( pointX,pointY,event);
38
        }
39
    addPoint( pointX:double,pointY:double,event:InputEvent)
40
      [ctxt.getType().equals(PluginServices.getText(this,"simple")) && ctxt.getNextState().equals("Selection.WithSelectedFeatures")]
41
      WithSelectedFeatures {
42
        setQuestion(PluginServices.getText(this,"select_handlers"));
43
        setDescription(new String[]{"cancel"});
44
        addPoint( pointX,pointY,event);
45
        end();
46
        }
47
}
48

  
49
SecondPoint{
50
  // Si hemos conseguido seleccionar algo
51
  addPoint( pointX:double,pointY:double,event:InputEvent)
52
      [ctxt.selectWithSecondPoint(pointX,pointY, event) > 0]
53
      WithSelectedFeatures {
54
        setQuestion(PluginServices.getText(this,"select_handlers"));
55
        setDescription(new String[]{"cancel"});
56
        addPoint( pointX,pointY,event);
57
        end();
58
        }
59
  // Si no lo hemos conseguido
60
  addPoint( pointX:double,pointY:double,event:InputEvent)
61
      FirstPoint {
62
        setQuestion(PluginServices.getText(this,"insert_point_selection"));
63
        setDescription(new String[]{"cancel"});
64
        addPoint(pointX,pointY,event);
65
        }
66
  addOption(s:String)
67
      FirstPoint{
68
        setQuestion(PluginServices.getText(this,"insert_point_selection"));
69
        setDescription(new String[]{"cancel"});
70
        setType(s);
71
        }
72

  
73
}
74
WithSelectedFeatures{
75

  
76
  // Si hemos pinchado encima de un handler
77
  addPoint( pointX:double,pointY:double,event:InputEvent)
78
  [ctxt.selectHandlers(pointX, pointY, event)>0]
79
      WithHandlers {
80
        setQuestion(PluginServices.getText(this,"insert_destination_point"));
81
        setDescription(new String[]{"cancel"});
82
        addPoint( pointX,pointY,event);
83
        // refresh();
84
        }
85

  
86
  // Si no hemos cogido un handler, probamos a seleccionar
87
  // otra entidad
88
  addPoint( pointX:double,pointY:double,event:InputEvent)
89
    [ctxt.selectFeatures(pointX,pointY, event) && ctxt.getNextState().equals("Selection.WithSelectedFeatures")]
90
      WithSelectedFeatures {
91
        setQuestion(PluginServices.getText(this,"select_handlers"));
92
        setDescription(new String[]{"cancel"});
93
        addPoint( pointX,pointY,event);
94
        }
95

  
96

  
97
  // Cualquier otro caso (hemos pinchado en algo vacio), volvemos al estado inicial
98
  addPoint( pointX:double,pointY:double,event:InputEvent)
99
      FirstPoint {
100
        setQuestion(PluginServices.getText(this,"insert_point_selection"));
101
        setDescription(new String[]{"cancel"});
102
        addPoint( pointX,pointY,event);
103
        // refresh();
104
        }
105
	 addOption(s:String)
106
      FirstPoint{
107
        setQuestion(PluginServices.getText(this,"insert_point_selection"));
108
        setDescription(new String[]{"cancel"});
109
        setType(s);
110
        }
111
}
112

  
113
WithHandlers{
114
  addPoint( pointX:double,pointY:double,event:InputEvent)
115
      WithSelectedFeatures {
116
        setQuestion(PluginServices.getText(this,"select_handlers"));
117
        setDescription(new String[]{"cancel"});
118
        addPoint( pointX,pointY,event);
119
        refresh();
120
        }
121
}
122

  
123
Default
124
{
125
	addOption(s:String)
126
      [s.equals("")]
127
      FirstPoint{
128
        restorePreviousTool();
129
        setQuestion(PluginServices.getText(this,"insert_point_selection"));
130
        setDescription(new String[]{"cancel"});
131
        end();
132
        }
133
  addOption(s:String)
134
    [s.equals(PluginServices.getText(this,"cancel"))]
135
    FirstPoint{
136
      end();
137
      }
138
    addOption(s:String)
139
		FirstPoint{
140
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
141
			}
142
	addValue(d:double)
143
		FirstPoint{
144
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
145
			}
146
	addPoint(pointX:double,pointY:double,event:InputEvent)
147
		FirstPoint{
148
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
149
			}
150
}
151
%%
0 152

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/LineCADTool.sm
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
%import com.iver.andami.PluginServices
14

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

  
19
FirstPoint
20

  
21
	Entry {
22
		setQuestion(
23
		PluginServices.getText(this,"insert_first_point"));
24
		setDescription(new String[]{"cancel"});
25
		}
26
	Exit{
27
		}
28

  
29
	{
30

  
31
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			SecondPointOrAngle {
33
				setQuestion(PluginServices.getText(this,"insert_second_point_angle"));
34
				setDescription(new String[]{"cancel"});
35
				addPoint( pointX,pointY,event);
36
				}
37

  
38
	}
39
SecondPointOrAngle{
40
	addPoint( pointX:double,pointY:double,event:InputEvent)
41
		SecondPointOrAngle {
42
			setQuestion(PluginServices.getText(this,"insert_second_point_angle"));
43
			setDescription(new String[]{"cancel"});
44
			addPoint( pointX,pointY,event);
45
			}
46
	addValue( d:double)
47
		LenghtOrPoint {
48
			setQuestion(PluginServices.getText(this,"insert_length_or_point"));
49
			setDescription(new String[]{"cancel"});
50
			addValue( d);
51
			}
52

  
53
}
54
LenghtOrPoint{
55
	addPoint( pointX:double,pointY:double,event:InputEvent)
56
		SecondPointOrAngle {
57
			setQuestion(PluginServices.getText(this,"insert_second_point_angle"));
58
			setDescription(new String[]{"cancel"});
59
			addPoint( pointX,pointY,event);
60
			}
61
	addValue( d:double)
62
		SecondPointOrAngle {
63
			setQuestion(PluginServices.getText(this,"insert_second_point_angle"));
64
			setDescription(new String[]{"cancel"});
65
			addValue( d);
66
			}
67
	}
68
Default
69
{
70
	addOption(s:String)
71
		[s.equals(PluginServices.getText(this,"cancel"))]
72
		FirstPoint{
73
			end();
74
			}
75
	addOption(s:String)
76
		[s.equals("")]
77
		FirstPoint{
78
			end();
79
			}
80
	addOption(s:String)
81
		FirstPoint{
82
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
83
			}
84
	addValue(d:double)
85
		FirstPoint{
86
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
87
			}
88
	addPoint(pointX:double,pointY:double,event:InputEvent)
89
		FirstPoint{
90
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
91
			}
92

  
93
}
94
%%
0 95

  
tags/v2_0_0_Build_2047/extensions/extEditing/sm/PolygonCADTool.sm
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
%import com.iver.andami.PluginServices
14

  
15
%map Polygon
16
%%
17
// A task begins life in suspended animation.
18

  
19
NumberOrCenterPoint
20

  
21
	Entry {
22
		setQuestion(
23
		PluginServices.getText(this,"insert_number_sides"));
24
		setDescription(new String[]{"cancel"});
25
		}
26
	Exit{
27
		}
28

  
29
	{
30
		addValue(d:double)
31
			[d<3]
32
			NumberOrCenterPoint{
33
				throwValueException(PluginServices.getText(this,"num_lados_insuficiente"),d);
34
			}
35
		addValue(d:double)
36
			[d>2]
37
			CenterPoint {
38
				setQuestion(PluginServices.getText(this,"insert_central_point_polygon"));
39
				setDescription(new String[]{"cancel"});
40
				addValue(d);
41
				}
42
		addPoint( pointX:double,pointY:double,event:InputEvent)
43
			OptionOrRadiusOrPoint {
44
				setQuestion(
45
					PluginServices.getText(this,"into_circle")+" "+
46
					"["+PluginServices.getText(this,"PolygonCADTool.into_circle")+"]"+
47
	    			PluginServices.getText(this,"cad.or")+" "+
48
	    			PluginServices.getText(this,"circumscribed")+
49
	   				"["+PluginServices.getText(this,"PolygonCADTool.circumscribed")+"]");
50
				setDescription(new String[]{"into_circle","circumscribed","cancel"});
51
				addPoint( pointX,pointY,event);
52
				}
53

  
54
	}
55
CenterPoint{
56
	addPoint( pointX:double,pointY:double,event:InputEvent)
57
		OptionOrRadiusOrPoint {
58
			setQuestion(
59
				PluginServices.getText(this,"into_circle")+" "+
60
				"["+PluginServices.getText(this,"PolygonCADTool.into_circle")+"]"+
61
	    		PluginServices.getText(this,"cad.or")+" "+
62
	    		PluginServices.getText(this,"circumscribed")+
63
	   			"["+PluginServices.getText(this,"PolygonCADTool.circumscribed")+"]");
64
			setDescription(new String[]{"into_circle","circumscribed","cancel"});
65
			addPoint( pointX,pointY,event);
66
			}
67
}
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff