private void checkGeometry(TriangleGeometry geometry) { if (geometry == null) throw new NullPointerException("Geometry can not be null!"); if (!isTriangle && geometry.getDevelopmentPeriods() > 1) { String msg = "Can not set geometry with more than 1 development periods (%d) to a vector!"; throw new IllegalArgumentException(String.format(msg, geometry.getDevelopmentPeriods())); } }
public void setGeometry(TriangleGeometry geometry) { checkGeometry(geometry); this.geometry = geometry.copy(); fireGeometryChanged(); }
public TriangleGeometry getGeometry() { return geometry == null ? null : geometry.copy(); }