All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class MSBChart.FillStyle

java.lang.Object
   |
   +----MSBChart.FillStyle

public class FillStyle
extends 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 and gradients).

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));

 

In the code a BarDataSerie is created with the FillStyle for the bar.

 

 


Variable Index

 o colorFrom
 o colorUntil
 o fillPatern
 o GRADIENT_HORIZONTAL
 o GRADIENT_VERTICAL
 o gradientCyclic
 o gradientType
 o NO_GRADIENT

Constructor Index

 o FillStyle(Color)

Method Index

 o draw(Graphics, int, int, int, int)
 o drawArc(Graphics, int, int, int, int, int, int)
 o drawPolygon(Graphics, int[], int[], int)
 o getColor()

Variables

 o NO_GRADIENT
 public static int NO_GRADIENT
 o GRADIENT_HORIZONTAL
 public static int GRADIENT_HORIZONTAL
 o GRADIENT_VERTICAL
 public static int GRADIENT_VERTICAL
 o fillPatern
 public 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));
 
 o colorFrom
 public Color colorFrom
Initial color used for the gradient.
 o colorUntil
 public 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;


 o gradientType
 public int gradientType
 o gradientCyclic
 public boolean gradientCyclic

Constructors

 o FillStyle
 public FillStyle(Color c)
Creates a fill style for the color c.

Methods

 o draw
 public void draw(Graphics g,
                  int x1,
                  int y1,
                  int x2,
                  int y2)
fills a rectangle.
 o drawArc
 public void drawArc(Graphics g,
                     int x,
                     int y,
                     int w,
                     int h,
                     int a1,
                     int a2)
fills an arc.
 
 o drawPolygon
 public void drawPolygon(Graphics g,
                         int x1[],
                         int y1[],
                         int num)
fills a polygon.
 
 o getColor
 public Color getColor()
 
returns the color.

All Packages  Class Hierarchy  This Package  Previous  Next  Index