Package org.jdesktop.swingx.util
Class ShapeUtils
- java.lang.Object
-
- org.jdesktop.swingx.util.ShapeUtils
-
public final class ShapeUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateShapeUtils()Creates a new instance of ShapeUtils
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.ShapegeneratePolygon(int sides, int outsideRadius, boolean normalize)static java.awt.ShapegeneratePolygon(int sides, int outsideRadius, int insideRadius)static java.awt.ShapegeneratePolygon(int sides, int outsideRadius, int insideRadius, boolean normalize)static java.awt.ShapegenerateShapeFromText(java.awt.Font font, char ch)static java.awt.ShapegenerateShapeFromText(java.awt.Font font, java.lang.String string)static java.awt.ShapemergeClip(java.awt.Graphics g, java.awt.Shape clip)Sets the clip on a graphics object by merging a supplied clip with the existing one.
-
-
-
Method Detail
-
generatePolygon
public static java.awt.Shape generatePolygon(int sides, int outsideRadius, boolean normalize)
-
generatePolygon
public static java.awt.Shape generatePolygon(int sides, int outsideRadius, int insideRadius, boolean normalize)
-
generatePolygon
public static java.awt.Shape generatePolygon(int sides, int outsideRadius, int insideRadius)
-
generateShapeFromText
public static java.awt.Shape generateShapeFromText(java.awt.Font font, char ch)
-
generateShapeFromText
public static java.awt.Shape generateShapeFromText(java.awt.Font font, java.lang.String string)
-
mergeClip
public static java.awt.Shape mergeClip(java.awt.Graphics g, java.awt.Shape clip)Sets the clip on a graphics object by merging a supplied clip with the existing one. The new clip will be an intersection of the old clip and the supplied clip. The old clip shape will be returned. This is useful for resetting the old clip after an operation is performed.- Parameters:
g- the graphics object to updateclip- a new clipping region to add to the graphics clip.- Returns:
- the current clipping region of the supplied graphics object. This may return
nullif the current clip isnull. - Throws:
java.lang.NullPointerException- if any parameter isnull
-
-