|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.graph2.Style
public final class Style
This class represents a style used to draw a graphic object, such as a bar, a line or
the graph key. To control the font and layout of text, see the TextStyle
class
Constructor Summary | |
---|---|
Style(Paint color)
Create a new Style |
|
Style(Style style)
Create a new Style that's a clone of the specified style |
Method Summary | |
---|---|
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Style(Paint color)
color
- the color to usepublic Style(Style style)
Method Detail |
---|
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 >0
IllegalArgumentException
- if the array is odd in length or if it contains any values <= 0public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public 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 class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |