- java.lang.Object
-
- org.jfree.svg.util.GraphicsUtils
-
public final class GraphicsUtils extends java.lang.ObjectA collection of static utility methods for shapes and images.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateGraphicsUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.image.BufferedImageconvertRenderedImage(java.awt.image.RenderedImage img)Converts a rendered image to aBufferedImage.static java.awt.ShapecopyOf(java.awt.Shape shape)Returns a shape that is (more or less) equivalent to the supplied shape.static java.awt.geom.GeneralPathcreatePolygon(int[] xPoints, int[] yPoints, int nPoints, boolean close)Creates a polygon from the specifiedxandycoordinate arrays.
-
-
-
Method Detail
-
copyOf
public static java.awt.Shape copyOf(java.awt.Shape shape)
Returns a shape that is (more or less) equivalent to the supplied shape. For some known shape implementations (Line2D,Rectangle2D,RoundRectangle2D,Arc2D,Ellipse2D, andPolygon) the copy will be an instance of that class. For other shapes, aPath2Dcontaining the outline of the shape is returned.- Parameters:
shape- the shape (nullnot permitted).- Returns:
- A copy of the shape or shape outline (never
null).
-
createPolygon
public static java.awt.geom.GeneralPath createPolygon(int[] xPoints, int[] yPoints, int nPoints, boolean close)Creates a polygon from the specifiedxandycoordinate arrays.- Parameters:
xPoints- the x-points.yPoints- the y-points.nPoints- the number of points to use for the polyline.close- closed?- Returns:
- A polygon.
-
convertRenderedImage
public static java.awt.image.BufferedImage convertRenderedImage(java.awt.image.RenderedImage img)
Converts a rendered image to aBufferedImage. This utility method has come from a forum post by Jim Moore at:- Parameters:
img- the rendered image (nullnot permitted).- Returns:
- A buffered image.
-
-