Revision 498 org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingProvider.java
SplitLineEditingProvider.java | ||
---|---|---|
228 | 228 |
GeometryType geoType = |
229 | 229 |
geometry.getGeometryType(); |
230 | 230 |
|
231 |
if (geoType.isTypeOf(Geometry.TYPES.CURVE) || geoType |
|
232 |
.isTypeOf(Geometry.TYPES.MULTICURVE)) { |
|
231 |
if (geoType.isTypeOf(Geometry.TYPES.CURVE)) { |
|
233 | 232 |
|
234 |
// if (!isClosed((Curve) geometry)) { |
|
233 |
if (isClosed((Curve) geometry)) { |
|
234 |
throw new InvalidEntryException(null); |
|
235 |
} else { |
|
235 | 236 |
values.put(selection, value); |
236 | 237 |
return; |
237 |
// }
|
|
238 |
} |
|
238 | 239 |
|
239 |
// } else if (geoType
|
|
240 |
// .isTypeOf(Geometry.TYPES.MULTICURVE)) {
|
|
241 |
// |
|
242 |
// MultiCurve multiCurve =
|
|
243 |
// (MultiCurve) geometry;
|
|
244 |
// |
|
245 |
// for (int i = 0; i < multiCurve
|
|
246 |
// .getPrimitivesNumber(); i++) {
|
|
247 |
// if (isClosed((Curve) multiCurve
|
|
248 |
// .getPrimitiveAt(i))) {
|
|
249 |
// throw new InvalidEntryException(
|
|
250 |
// null);
|
|
251 |
// }
|
|
252 |
// }
|
|
253 |
// values.put(selection, value);
|
|
254 |
// return;
|
|
240 |
} else if (geoType |
|
241 |
.isTypeOf(Geometry.TYPES.MULTICURVE)) { |
|
242 |
|
|
243 |
MultiCurve multiCurve = |
|
244 |
(MultiCurve) geometry; |
|
245 |
|
|
246 |
for (int i = 0; i < multiCurve |
|
247 |
.getPrimitivesNumber(); i++) { |
|
248 |
if (isClosed((Curve) multiCurve |
|
249 |
.getPrimitiveAt(i))) { |
|
250 |
throw new InvalidEntryException( |
|
251 |
null); |
|
252 |
} |
|
253 |
} |
|
254 |
values.put(selection, value); |
|
255 |
return; |
|
255 | 256 |
} |
256 | 257 |
} |
257 | 258 |
}); |
... | ... | |
272 | 273 |
Point firstPoint = curve.getVertex(0); |
273 | 274 |
Point lastPoint = curve.getVertex(curve.getNumVertices() - 1); |
274 | 275 |
|
275 |
if (firstPoint.getX() == lastPoint.getX() |
|
276 |
&& firstPoint.getY() == lastPoint.getY()) { |
|
276 |
if (firstPoint.equals(lastPoint)) { |
|
277 | 277 |
return true; |
278 | 278 |
} |
279 | 279 |
|
... | ... | |
409 | 409 |
} |
410 | 410 |
} |
411 | 411 |
|
412 |
result.add(multiCurve); |
|
412 |
if(multiCurve.getPrimitivesNumber() > 0){ |
|
413 |
result.add(multiCurve); |
|
414 |
} |
|
413 | 415 |
|
414 | 416 |
return result; |
415 | 417 |
} |
Also available in: Unified diff