public final class Utils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static double |
Epsilon |
static Brush |
TransparentFill
Identifies a transparent solid brush.
|
static Pen |
TransparentStroke
Identifies a transparent solid pen.
|
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areEqual(java.awt.geom.Dimension2D a,
java.awt.geom.Dimension2D b) |
static boolean |
areEqual(java.awt.geom.Point2D a,
java.awt.geom.Point2D b) |
static void |
blend(GradientBrush brush,
float[] positions,
java.awt.Color[] colors)
Creates a normalized [0..1] color blend out of the specified colors and positions.
|
static java.awt.geom.Point2D |
center(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Returns the center of the line segment defined by the specified points.
|
static java.awt.geom.Point2D |
center(java.awt.geom.Rectangle2D r)
Returns the center point of the specified rectangle.
|
static java.awt.Color |
gray(long intensity)
Returns a gray color with the specified intensity.
|
static boolean |
isEmpty(java.awt.Color color) |
static boolean |
isNullOrEmpty(java.lang.String value) |
static GradientBrush |
linearGradient(double angle,
float[] positions,
java.awt.Color[] colors)
Creates a linear gradient brush with the specified blend and orientation angle.
|
static GradientBrush |
linearGradient(float[] positions,
java.awt.Color[] colors)
Creates a linear gradient brush with the specified blend.
|
static RadialGradientBrush |
radialGradient(float[] positions,
java.awt.Color[] colors)
Creates a path gradient brush with the specified blend and bounds.
|
static RadialGradientBrush |
radialGradient(java.awt.geom.Point2D centerPoint,
float[] positions,
java.awt.Color[] colors)
Creates a path gradient brush with the specified blend and bounds.
|
static RadialGradientBrush |
radialGradient(java.awt.geom.Rectangle2D bounds,
float[] positions,
java.awt.Color[] colors)
Creates a path gradient brush with the specified blend and bounds.
|
static RadialGradientBrush |
radialGradient(java.awt.geom.Rectangle2D bounds,
java.awt.geom.Point2D centerPoint,
float[] positions,
java.awt.Color[] colors)
Creates a path gradient brush with the specified blend and bounds.
|
static Margins |
toAbsolute(Margins margins,
double width,
double height) |
static java.awt.geom.Point2D |
toPointF(java.awt.geom.Dimension2D s)
Returns the point at the specified distance from the center.
|
static java.awt.geom.Rectangle2D |
toRectangleF(java.awt.geom.Dimension2D s)
Returns a Rectangle2D with the specified size and location at (0, 0).
|
static java.awt.geom.Rectangle2D |
toRectangleF(double width,
double height)
Returns a Rectangle2D with the specified size and location at (0, 0).
|
static java.awt.geom.Point2D |
transform(java.awt.geom.AffineTransform matrix,
java.awt.geom.Point2D point)
Transforms the specified point using the specified matrix.
|
public static final Brush TransparentFill
public static final Pen TransparentStroke
public static final double Epsilon
public static GradientBrush linearGradient(float[] positions, java.awt.Color[] colors)
public static GradientBrush linearGradient(double angle, float[] positions, java.awt.Color[] colors)
public static RadialGradientBrush radialGradient(float[] positions, java.awt.Color[] colors)
public static RadialGradientBrush radialGradient(java.awt.geom.Point2D centerPoint, float[] positions, java.awt.Color[] colors)
public static RadialGradientBrush radialGradient(java.awt.geom.Rectangle2D bounds, float[] positions, java.awt.Color[] colors)
public static RadialGradientBrush radialGradient(java.awt.geom.Rectangle2D bounds, java.awt.geom.Point2D centerPoint, float[] positions, java.awt.Color[] colors)
public static void blend(GradientBrush brush, float[] positions, java.awt.Color[] colors)
public static java.awt.geom.Point2D transform(java.awt.geom.AffineTransform matrix,
java.awt.geom.Point2D point)
matrix - The matrix to use for the transformation.point - The point to transform.public static java.awt.geom.Point2D center(java.awt.geom.Rectangle2D r)
r - The rectangle of interest.public static java.awt.geom.Point2D center(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
p1 - The first point of the line segment.p2 - The second point of the line segment.public static java.awt.geom.Rectangle2D toRectangleF(java.awt.geom.Dimension2D s)
s - The size of the new rectangle.public static java.awt.geom.Rectangle2D toRectangleF(double width,
double height)
public static java.awt.geom.Point2D toPointF(java.awt.geom.Dimension2D s)
s - The distance of the point.public static java.awt.Color gray(long intensity)
intensity - The intensity of the new color, varying from 0 to 255.public static boolean isEmpty(java.awt.Color color)
public static boolean isNullOrEmpty(java.lang.String value)
public static boolean areEqual(java.awt.geom.Dimension2D a,
java.awt.geom.Dimension2D b)
public static boolean areEqual(java.awt.geom.Point2D a,
java.awt.geom.Point2D b)