Revision 43938 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/PolyLineSelectionListener.java

View differences:

PolyLineSelectionListener.java
65 65
import org.gvsig.fmap.geom.exception.CreateGeometryException;
66 66
import org.gvsig.fmap.geom.primitive.GeneralPathX;
67 67
import org.gvsig.fmap.geom.primitive.Surface;
68
import org.gvsig.fmap.geom.primitive.Line;
68 69
import org.gvsig.fmap.mapcontext.layers.FLayer;
69 70
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
70 71
import org.gvsig.fmap.mapcontrol.MapControl;
......
172 173
            GeneralPathX gp = event.getGP();
173 174
            GeometryManager manager = GeometryLocator.getGeometryManager();
174 175
            Geometry geom = null;
175
            Surface surface = null;
176
            Line line = null;
176 177
            try {
177
                surface =
178
                    (Surface) manager.create(TYPES.SURFACE, SUBTYPES.GEOM2D);
179
                surface.setGeneralPath(gp);
180
                geom = surface;
178
                line = (Line) manager.create(TYPES.LINE, SUBTYPES.GEOM2D);
179
                line.setGeneralPath(gp);
180
                geom = line;
181 181
            } catch (CreateGeometryException e1) {
182 182
                NotificationManager.showMessageError(PluginServices.getText(null,
183 183
                    "Failed_creating_geometry"),

Also available in: Unified diff