Constructor and Description |
---|
Style(Paint color)
Create a new Style
|
Style(Style style)
Create a new Style that's a clone of the specified style
|
Modifier and Type | Method and Description |
---|---|
protected Object |
clone() |
static Paint |
createLinearGradientPaint(double[] values,
Color[] colors)
Return a LinearGradientPaint
that can be used to paint objects in the PDF.
|
static Paint |
createPattern(String name,
Color foreground,
Color background)
Create a
TexturePaint object from one of several predefined patterns. |
void |
ensureSolidColor()
If this style has a color object that's a GradientPaint or LinearGradientPaint instance
then replace it with a solid color instance instead.
|
boolean |
equals(Object o) |
int |
hashCode() |
void |
setBorderColor(Color color)
Set the border color for this style
|
void |
setColor(Paint color)
Set the color of this style
|
void |
setLineDash(double[] dash)
Set the line dashing for this style.
|
void |
setLineThickness(double thick)
Set the line thickness for this style. 1 is the default, 0.5 is half
as thick, and so on.
|
void |
setOverflow(boolean overflow)
Set whether any lines or markers in this style should
overflow the graph - if this is set, the item it is
set on will not contribute to the calculated dimensions
of the graph.
|
String |
toString() |
public Style(Paint color)
color
- the color to usepublic Style(Style style)
public void setOverflow(boolean overflow)
public void ensureSolidColor()
public void setColor(Paint color)
color
- the color to usepublic void setBorderColor(Color color)
color
- the color to use to draw borders in this style, or null
not to draw any borderspublic void setLineThickness(double thick)
thick
- the line thickness of this style. Must be > 0public void setLineDash(double[] dash)
setLineDash(new double[] { 5, 5 })
would create a regular
dash pattern of 5 on, 5 off, and setLineDash(new double[] { 6, 2, 2, 2 })
would create a dash-dot type pattern. To turn dashing off completely, pass
in a zero length array or null
.dash
- an array of doubles which must be even in length and have every value >0IllegalArgumentException
- if the array is odd in length or if it contains any values <= 0public static Paint createPattern(String name, Color foreground, Color background)
TexturePaint
object from one of several predefined patterns.
These may be used for tiling paints - useful in environments where color
is limited to black and white. The available patterns are:
bricks circles crosshatch crosshatch30 crosshatch45 fishscales gray0 gray10 gray15 gray20 gray25 gray30 gray35 gray40 gray45 gray5 gray50 gray55 gray60 gray65 gray70 gray75 gray80 gray85 gray90 gray95 hexagons horizontal horizontalsaw hs_bdiagonal hs_cross hs_diagcross hs_fdiagonal hs_horizontal hs_vertical left30 left45 leftshingle octagons right30 right45 rightshingle scatter1 scatter2 smallfishscales vertical verticalbricks verticalleftshingle verticalrightshingle verticalsaw weave
name
- the name or URL of the pattern to use.foreground
- the foreground color. May be null
, in which case it defaults
to black.background
- the background color. May be null
, in which case it defaults
to white.public static Paint createLinearGradientPaint(double[] values, Color[] colors)
Paint paint = Style.createLinearGradientPaint(new double[] { 5, 5.001 }, new Color[] { Color.yellow, Color.red }); style.setColor(paint); series.setStyle(style);Note that the
java.awt.LinearGradientPaint
class is a Java 1.6 classCopyright © 2001-2016 Big Faceless Organization