Package org.jfree.chart.util
Class PaintUtils
- java.lang.Object
-
- org.jfree.chart.util.PaintUtils
-
public class PaintUtils extends java.lang.ObjectUtility code that relates toPaintobjects.
-
-
Constructor Summary
Constructors Modifier Constructor Description privatePaintUtils()Private constructor prevents object creation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcolorToString(java.awt.Color c)Converts a color into a string.static booleanequal(java.awt.Paint p1, java.awt.Paint p2)Returnstrueif the twoPaintobjects are equal OR bothnull.static java.awt.ColorstringToColor(java.lang.String value)Converts a given string into a color.
-
-
-
Method Detail
-
equal
public static boolean equal(java.awt.Paint p1, java.awt.Paint p2)Returnstrueif the twoPaintobjects are equal OR bothnull. This method handlesGradientPaint,LinearGradientPaintandRadialGradientPaintas a special cases, since those classes do not override theequals()method.- Parameters:
p1- paint 1 (nullpermitted).p2- paint 2 (nullpermitted).- Returns:
- A boolean.
-
colorToString
public static java.lang.String colorToString(java.awt.Color c)
Converts a color into a string. If the color is equal to one of the defined constant colors, that name is returned instead. Otherwise the color is returned as hex-string.- Parameters:
c- the color.- Returns:
- the string for this color.
-
stringToColor
public static java.awt.Color stringToColor(java.lang.String value)
Converts a given string into a color.- Parameters:
value- the string, either a name or a hex-string.- Returns:
- the color.
-
-