Revision 6601 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/EventsHandler.java

View differences:

EventsHandler.java
180 180
    	if ((E.getClickCount() == 2) &&
181 181
                ((layout.getTool() == Layout.POLYLINE) ||
182 182
                (layout.getTool() == Layout.POLYGON))) {
183
    		delLastPoint();
184
            endGraphic();
183
    		layout.delLastPoint();
184
            layout.endGraphic();
185 185
        } else {
186 186
            if (E.getButton() == MouseEvent.BUTTON1) {
187 187
                if (layout.getTool() == Layout.SELECT) {
......
304 304
            } else if ((layout.getTool() == Layout.POINT) ) {
305 305
            	layout.getGeometryAdapter().addPoint(FLayoutUtilities.toSheetPoint(
306 306
                        E.getPoint(), layout.getAT()));
307
            	endGraphic();
307
            	layout.endGraphic();
308 308
                //layout.setStatus(Layout.GRAPHICS);
309 309
            } else if ((layout.getTool() == Layout.POLYLINE) ||
310 310
                    (layout.getTool() == Layout.POLYGON)) {
......
316 316
                    (layout.getTool() == Layout.RECTANGLESIMPLE)) {
317 317
                if (layout.getGeometryAdapter().addPoint(FLayoutUtilities.toSheetPoint(
318 318
                                E.getPoint(), layout.getAT())) == 2) {
319
                    endGraphic();
319
                    layout.endGraphic();
320 320
                    layout.setStatus(Layout.DESACTUALIZADO);
321 321
                } else {
322 322
                    layout.setStatus(Layout.GRAPHICS);
......
462 462

  
463 463

  
464 464
    }
465
    private void delLastPoint(){
466
    	layout.getGeometryAdapter().delLastPoint();
467
    }
468
    /**
469
     * DOCUMENT ME!
470
     */
471
    private void endGraphic() {
472
        if ((layout.getTool() == Layout.LINE) ||
473
                (layout.getTool() == Layout.POLYLINE) ||
474
                (layout.getTool() == Layout.POLYGON) ||
475
                (layout.getTool() == Layout.CIRCLE) ||
476
                (layout.getTool() == Layout.RECTANGLESIMPLE) ||
477
                (layout.getTool() == Layout.POINT)) {
478
            layout.getGeometryAdapter().end();
479
            PluginServices.getMainFrame().enableControls();
480
            events.addFFrame();
481
            layout.initGeometryAdapter();
482
            layout.refresh();
483
        }
484
    }
485 465
}

Also available in: Unified diff