Package org.jfree.chart.util
Class PaintUtils
java.lang.Object
org.jfree.chart.util.PaintUtils
Utility code that relates to
Paint
objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Converts a color into a string.static boolean
Returnstrue
if the twoPaint
objects are equal OR bothnull
.static Color
stringToColor
(String value) Converts a given string into a color.
-
Method Details
-
equal
Returnstrue
if the twoPaint
objects are equal OR bothnull
. This method handlesGradientPaint
,LinearGradientPaint
andRadialGradientPaint
as a special cases, since those classes do not override theequals()
method.- Parameters:
p1
- paint 1 (null
permitted).p2
- paint 2 (null
permitted).- Returns:
- A boolean.
-
colorToString
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
Converts a given string into a color.- Parameters:
value
- the string, either a name or a hex-string.- Returns:
- the color.
-