Revision 3847 trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/smc/SelectionCADToolContext.java

View differences:

SelectionCADToolContext.java
111 111
        /* package */ static ExecuteMap_Default.ExecuteMap_First First;
112 112
        /* package */ static ExecuteMap_Default.ExecuteMap_Second Second;
113 113
        /* package */ static ExecuteMap_Default.ExecuteMap_Third Third;
114
        /* package */ static ExecuteMap_Default.ExecuteMap_Fourth Fourth;
115 114
        private static ExecuteMap_Default Default;
116 115

  
117 116
        static
......
120 119
            First = new ExecuteMap_Default.ExecuteMap_First("ExecuteMap.First", 1);
121 120
            Second = new ExecuteMap_Default.ExecuteMap_Second("ExecuteMap.Second", 2);
122 121
            Third = new ExecuteMap_Default.ExecuteMap_Third("ExecuteMap.Third", 3);
123
            Fourth = new ExecuteMap_Default.ExecuteMap_Fourth("ExecuteMap.Fourth", 4);
124 122
            Default = new ExecuteMap_Default("ExecuteMap.Default", -1);
125 123
        }
126 124

  
......
160 158
                SelectionCADTool ctxt = context.getOwner();
161 159

  
162 160
                ctxt.init();
163
                ctxt.setQuestion("Precise punto del rect?ngulo de selecci?n");
161
                ctxt.setQuestion("SELECCION" + "\n" +
162
		"Precise punto del rect?ngulo de selecci?n");
164 163
                return;
165 164
            }
166 165

  
......
168 167
            {
169 168
                SelectionCADTool ctxt = context.getOwner();
170 169

  
171

  
172
                (context.getState()).Exit(context);
173
                context.clearState();
174
                try
170
                if (!ctxt.isSelected(pointX,pointY))
175 171
                {
176
                    ctxt.setQuestion("Precise segundo punto del rect?ngulo de seleccion");
177
                    ctxt.addPoint(pointX, pointY);
172

  
173
                    (context.getState()).Exit(context);
174
                    context.clearState();
175
                    try
176
                    {
177
                        ctxt.setQuestion("Precise segundo punto del rect?ngulo de seleccion");
178
                        ctxt.addPoint(pointX, pointY);
179
                    }
180
                    finally
181
                    {
182
                        context.setState(ExecuteMap.First);
183
                        (context.getState()).Entry(context);
184
                    }
178 185
                }
179
                finally
186
                else if (ctxt.isSelected(pointX,pointY))
180 187
                {
181
                    context.setState(ExecuteMap.First);
182
                    (context.getState()).Entry(context);
188

  
189
                    (context.getState()).Exit(context);
190
                    context.clearState();
191
                    try
192
                    {
193
                        ctxt.setQuestion("Precise punto destino");
194
                        ctxt.addPoint(pointX, pointY);
195
                    }
196
                    finally
197
                    {
198
                        context.setState(ExecuteMap.Second);
199
                        (context.getState()).Entry(context);
200
                    }
201
                }                else
202
                {
203
                    super.addPoint(context, pointX, pointY);
183 204
                }
205

  
184 206
                return;
185 207
            }
186 208

  
......
215 237
                }
216 238
                finally
217 239
                {
218
                    context.setState(ExecuteMap.Second);
240
                    context.setState(ExecuteMap.Initial);
219 241
                    (context.getState()).Entry(context);
220 242
                }
221 243
                return;
......
247 269
                context.clearState();
248 270
                try
249 271
                {
250
                    ctxt.setQuestion("Precise punto de estiramiento");
272
                    ctxt.setQuestion("Precise punto destino");
251 273
                    ctxt.addPoint(pointX, pointY);
274
                    ctxt.end();
275
                    ctxt.refresh();
252 276
                }
253 277
                finally
254 278
                {
......
275 299
                super (name, id);
276 300
            }
277 301

  
278
            protected void addPoint(SelectionCADToolContext context, double pointX, double pointY)
279
            {
280
                SelectionCADTool ctxt = context.getOwner();
281

  
282

  
283
                (context.getState()).Exit(context);
284
                context.clearState();
285
                try
286
                {
287
                    ctxt.setQuestion("Precise punto de estiramiento");
288
                    ctxt.addPoint(pointX, pointY);
289
                    ctxt.end();
290
                    ctxt.refresh();
291
                }
292
                finally
293
                {
294
                    context.setState(ExecuteMap.Fourth);
295
                    (context.getState()).Entry(context);
296
                }
297
                return;
298
            }
299

  
300 302
        //-------------------------------------------------------
301 303
        // Member data.
302 304
        //
303 305
        }
304 306

  
305
        private static final class ExecuteMap_Fourth
306
            extends ExecuteMap_Default
307
        {
308
        //-------------------------------------------------------
309
        // Member methods.
310
        //
311

  
312
            private ExecuteMap_Fourth(String name, int id)
313
            {
314
                super (name, id);
315
            }
316

  
317
        //-------------------------------------------------------
318
        // Member data.
319
        //
320
        }
321

  
322 307
    //-----------------------------------------------------------
323 308
    // Member data.
324 309
    //

Also available in: Unified diff