/** * Creates a circular or elliptical {@link Polygon}. * * @return a circle or ellipse */ public Polygon createCircle() { return createEllipse(); }
/** * Creates a circular or elliptical {@link Polygon}. * * @return a circle or ellipse */ public Polygon createCircle() { return createEllipse(); }
/** * Make an ellipse centered at the given point with the given width and * height. * * @param p Point * @param width Width * @param height Height * @return An ellipse centered at the given point with the given width and height * @throws SQLException if the width or height is non-positive */ public static Polygon makeEllipse(Point p, double width, double height) throws SQLException { if(p == null){ return null; } if (height < 0 || width < 0) { throw new SQLException("Both width and height must be positive."); } else { GSF.setCentre(new Coordinate(p.getX(), p.getY())); GSF.setWidth(width); GSF.setHeight(height); return GSF.createEllipse(); } } }
/** * Make an ellipse centered at the given point with the given width and * height. * * @param p Point * @param width Width * @param height Height * @return An ellipse centered at the given point with the given width and height * @throws SQLException if the width or height is non-positive */ public static Polygon makeEllipse(Point p, double width, double height) throws SQLException { if(p == null){ return null; } if (height < 0 || width < 0) { throw new SQLException("Both width and height must be positive."); } else { GSF.setCentre(new Coordinate(p.getX(), p.getY())); GSF.setWidth(width); GSF.setHeight(height); return GSF.createEllipse(); } } }