// set the segment
this.curveSegments = (List<CurveSegment>) segments;
// set the curve envelope
Iterator<? extends CurveSegment> it = segments.iterator();
CurveSegmentImpl cs0 = (CurveSegmentImpl) it.next();
cs0.setCurve(this);
this.envelope = new EnvelopeImpl(cs0.getEnvelope());
Position p0 = cs0.getStartPosition();
// Änderung durch Sanjay, da in bisheriger Version nicht der Fall
// berücksichtigt wurde, dass nur 1 CurveSegment existiert
CurveSegmentImpl cs1 = null;
while (it.hasNext()) {
cs1 = (CurveSegmentImpl) it.next();
// set the segment / curve association
cs1.setCurve(this);
// expand the curve envelope
this.envelope.expand(cs1.getEnvelope());
if (!cs0.getEndPoint().equals(cs1.getStartPoint())) {
throw new IllegalArgumentException(
"Curvesegments are not continuous. Following curve segments are disjoint:" //$NON-NLS-1$
+ cs0 + " and " + cs1); //$NON-NLS-1$
}
cs0 = cs1;