Revision 9399
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/PolylineCADTool.java | ||
---|---|---|
96 | 96 |
} |
97 | 97 |
|
98 | 98 |
public void endGeometry() { |
99 |
IGeometry[] geoms = (IGeometry[]) list.toArray(new IGeometry[0]); |
|
99 |
try { |
|
100 |
if (getVLE().getVEA().getShapeType()==FShape.POLYGON && !close){ |
|
101 |
closeGeometry(); |
|
102 |
} |
|
103 |
} catch (DriverIOException e) { |
|
104 |
e.printStackTrace(); |
|
105 |
} |
|
106 |
IGeometry[] geoms = (IGeometry[]) list.toArray(new IGeometry[0]); |
|
100 | 107 |
FGeometryCollection fgc = new FGeometryCollection(geoms); |
101 |
try { |
|
102 |
if (getVLE().getVEA().getShapeType()==FShape.POLYGON && !close){ |
|
103 |
GeneralPathX gpx=new GeneralPathX(); |
|
104 |
gpx.moveTo(antPoint.getX(),antPoint.getY()); |
|
105 |
gpx.lineTo(firstPoint.getX(),firstPoint.getY()); |
|
106 |
IGeometry line=ShapeFactory.createPolyline2D(gpx); |
|
107 |
fgc.addGeometry(line); |
|
108 |
} |
|
109 |
} catch (DriverIOException e) { |
|
110 |
e.printStackTrace(); |
|
111 |
} |
|
112 | 108 |
|
109 |
|
|
113 | 110 |
// No queremos guardar FGeometryCollections: |
114 | 111 |
GeneralPathX gp = new GeneralPathX(); |
115 | 112 |
gp.append(fgc.getPathIterator(null,FConverter.FLATNESS), true); |
... | ... | |
137 | 134 |
addGeometry(newGeom); |
138 | 135 |
_fsm = new PolylineCADToolContext(this); |
139 | 136 |
list.clear(); |
137 |
close=false; |
|
140 | 138 |
antantPoint=antCenter=antInter=antPoint=firstPoint=null; |
141 | 139 |
} |
142 | 140 |
public void closeGeometry(){ |
Also available in: Unified diff