com.java4less.rchart
Class FillStyle

java.lang.Object
  |
  +--com.java4less.rchart.FillStyle

public class FillStyle
extends java.lang.Object

This class fills an area. It contains the description of how the filling should looks like. If you are using jdk 1.1 some features may not be available (patterns).

The following code creates the fillings for the columns:

BarDataSerie data1= new BarDataSerie(d1,new FillStyle(java.awt.Color.blue));

BarDataSerie data2= new BarDataSerie(d2,new FillStyle(java.awt.Color.red));


Field Summary
 java.awt.Color colorFrom
          Initial color used for the gradient.
 java.awt.Color colorUntil
          Final color used for the gradient. example: chart.back.colorUntil=java.awt.Color.red; chart.back.colorFrom=java.awt.Color.white; chart.back.gradientType=FillStyle.GRADIENT_HORIZONTAL;
 java.lang.Object fillPatern
          TexturePaint (jdk 1.2) object used as pattern for the filling.
static int GRADIENT_HORIZONTAL
           
static int GRADIENT_VERTICAL
           
 boolean gradientCyclic
           
 int gradientType
           
static int NO_GRADIENT
           
 
Constructor Summary
FillStyle(java.awt.Color c)
          Creates a fill style for the color c.
 
Method Summary
 void draw(java.awt.Graphics g, int x1, int y1, int x2, int y2)
          fills a rectangle.
 void drawArc(java.awt.Graphics g, int x, int y, int w, int h, int a1, int a2)
          fills an arc.
 void drawPolygon(java.awt.Graphics g, int[] x1, int[] y1, int num)
           
 java.awt.Color getColor()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_GRADIENT

public static int NO_GRADIENT

GRADIENT_HORIZONTAL

public static int GRADIENT_HORIZONTAL

GRADIENT_VERTICAL

public static int GRADIENT_VERTICAL

fillPatern

public java.lang.Object fillPatern
TexturePaint (jdk 1.2) object used as pattern for the filling. Example: java.awt.image.BufferedImage bi = new java.awt.image.BufferedImage(5, 5, java.awt.image.BufferedImage.TYPE_INT_RGB); java.awt.Graphics2D big = bi.createGraphics(); big.setColor(Color.orange); big.fillRect(0, 0, 5, 5); big.setColor(Color.red); big.fillOval(0, 0, 5, 5); java.awt.Rectangle r = new java.awt.Rectangle(0,0,5,5); data1.style.fillPatern=(new java.awt.TexturePaint(bi, r));

colorFrom

public java.awt.Color colorFrom
Initial color used for the gradient.

colorUntil

public java.awt.Color colorUntil
Final color used for the gradient. example: chart.back.colorUntil=java.awt.Color.red; chart.back.colorFrom=java.awt.Color.white; chart.back.gradientType=FillStyle.GRADIENT_HORIZONTAL;

gradientType

public int gradientType

gradientCyclic

public boolean gradientCyclic
Constructor Detail

FillStyle

public FillStyle(java.awt.Color c)
Creates a fill style for the color c.
Method Detail

getColor

public java.awt.Color getColor()

drawArc

public void drawArc(java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    int a1,
                    int a2)
fills an arc.

drawPolygon

public void drawPolygon(java.awt.Graphics g,
                        int[] x1,
                        int[] y1,
                        int num)

draw

public void draw(java.awt.Graphics g,
                 int x1,
                 int y1,
                 int x2,
                 int y2)
fills a rectangle.