Revision 43510 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.selectiontools.app/org.gvsig.selectiontools.app.mainplugin/src/main/java/org/gvsig/selectiontools/app/extension/tools/buffer/process/BufferSelectionProcess.java

View differences:

BufferSelectionProcess.java
23 23
 */
24 24
package org.gvsig.selectiontools.app.extension.tools.buffer.process;
25 25

  
26
/* gvSIG. Geographic Information System of the Valencian Government
27
 *
28
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
29
 * of the Valencian Government (CIT)
30
 * 
31
 * This program is free software; you can redistribute it and/or
32
 * modify it under the terms of the GNU General Public License
33
 * as published by the Free Software Foundation; either version 2
34
 * of the License, or (at your option) any later version.
35
 * 
36
 * This program is distributed in the hope that it will be useful,
37
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
38
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
39
 * GNU General Public License for more details.
40
 *  
41
 * You should have received a copy of the GNU General Public License
42
 * along with this program; if not, write to the Free Software
43
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
44
 * MA  02110-1301, USA.
45
 * 
46
 */
47

  
48 26
import java.awt.event.MouseAdapter;
49 27
import java.awt.event.MouseEvent;
50 28
import java.util.ArrayList;
......
58 36
import org.gvsig.andami.messages.NotificationManager;
59 37
import org.gvsig.andami.ui.mdiManager.IWindow;
60 38
import org.gvsig.app.project.documents.view.gui.IView;
61
import org.gvsig.fmap.dal.DataSet;
62 39
import org.gvsig.fmap.dal.feature.Feature;
63 40
import org.gvsig.fmap.dal.feature.FeatureSelection;
64 41
import org.gvsig.fmap.dal.feature.FeatureSet;
65 42
import org.gvsig.fmap.dal.feature.FeatureStore;
66 43
import org.gvsig.fmap.geom.Geometry;
67
import org.gvsig.fmap.geom.GeometryException;
68
import org.gvsig.fmap.geom.operation.GeometryOperationException;
44
import org.gvsig.fmap.geom.GeometryLocator;
45
import org.gvsig.fmap.geom.GeometryManager;
69 46
import org.gvsig.fmap.mapcontext.MapContext;
70 47
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
71 48
import org.gvsig.fmap.mapcontrol.MapControl;
......
75 52
import org.gvsig.selectiontools.app.extension.tools.buffer.gui.BufferConfigurationPanel;
76 53
import org.gvsig.tools.dispose.DisposableIterator;
77 54

  
78
/**
79
 * 
80
 * 
81
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
82
 */
83 55
public class BufferSelectionProcess extends IncrementableProcess {
84 56

  
85 57
    // private boolean layerWasBeingEdited = false;
......
313 285
                        + " \""
314 286
                        + layer.getName() + "\"");
315 287

  
316
                    switch (layer.getShapeType()) {
317
                    case Geometry.TYPES.POINT:
288
                    GeometryManager geomManager = GeometryLocator.getGeometryManager();
289
                    if( geomManager.isSubtype(Geometry.TYPES.POINT, layer.getShapeType()) ) {
318 290
                        side = point_side;
319
                        break;
320
                    case Geometry.TYPES.CURVE:
321
                    case Geometry.TYPES.MULTICURVE:
291
                        
292
                    } else if( geomManager.isSubtype(Geometry.TYPES.CURVE, layer.getShapeType()) ) {
322 293
                        side = line_side;
323
                        break;
324
                    case Geometry.TYPES.SURFACE:
325
                    case Geometry.TYPES.MULTISURFACE:
294
                        
295
                    } else if( geomManager.isSubtype(Geometry.TYPES.SURFACE, layer.getShapeType()) ) {
326 296
                        side = pol_side;
327
                        break;
328
                    case Geometry.TYPES.MULTIPOINT:
297

  
298
                    } else if( geomManager.isSubtype(Geometry.TYPES.MULTIPOINT, layer.getShapeType()) ) {
329 299
                        side = multi_point_side;
330
                        break;
331
                    default: // UNDEFINED
332
                        // UNSUPPORTED
300
                        
301
                    } else if( geomManager.isSubtype(Geometry.TYPES.MULTICURVE, layer.getShapeType()) ) {
302
                        side = line_side;
303
                        
304
                    } else if( geomManager.isSubtype(Geometry.TYPES.MULTISURFACE, layer.getShapeType()) ) {
305
                        side = pol_side;
306
                    } else {
333 307
                        log.addLine(PluginServices.getText(null,
334 308
                            "Layer_with_unsupported_geometries_type"));
335 309
                        percentage += inc;

Also available in: Unified diff