All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.chart.JCFillStyle

java.lang.Object
   |
   +----jclass.chart.JCStyle
           |
           +----jclass.chart.JCFillStyle

public class JCFillStyle
extends JCStyle
implements HTMLHandler
Controls the appearance of a fill, including the fill pattern and the fill color. Note: Fill patterns are not currently supported in Java.

Properties

Name Description
Color The Color property determines the color used to fill regions in chart. The default value is generated.
Image The Image property determines the image used to paint the fill region. Only bar charts use this property. The default value is null.
Pattern The Pattern property determines the fill pattern used to fill regions in chart. Note: Since Java does not support patterned fills, this property is not supported. The default value is JCFillStyle.SOLID.


Variable Index

 o CROSS_HATCHED
 o DIAG_HATCHED
 o fillPattern_strings
 o fillPattern_values
 o HORIZ_STRIPE
 o NONE
 o PER_25
 o PER_50
 o PER_75
 o SOLID
 o STRIPE_135
 o STRIPE_45
 o VERT_STRIPE

Constructor Index

 o JCFillStyle(Color, int)
Constructor for fill style objects

Method Index

 o drawRect(Graphics, int, int, int, int)
Performs the requested draw rect given the values of the properties of the JCFillStyle instance.
 o fillArc(Graphics, int, int, int, int, int, int)
Performs the requested fill given the values of the properties of the JCFillStyle instance.
 o fillArcShadow(Graphics, int, int, int, int, int, int)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance.
 o fillImageRect(Graphics, int, int, int, int, boolean, boolean)
Performs the requested fill with an image given the values of the properties of the JCFillStyle instance.
 o fillOutlinePartialPolygon(Graphics, Polygon, Color)
Performs the requested fill for a partial polygon with a drawn outline given the values of the * properties of the JCFillStyle instance.
 o fillOutlinePolygon(Graphics, Polygon, Color)
Performs the requested fill with a drawn outline given the values of the properties of the JCFillStyle instance.
 o fillOutlinePolygonHighlight(Graphics, Polygon)
Performs the requested fill in a color brighter than that specified in the JCFillStyle instance, including a drawn outline.
 o fillOutlinePolygonHighlight(Graphics, Polygon, Color)
Performs the requested fill in a color brighter than that specified in the JCFillStyle instance, including a drawn outline.
 o fillOutlinePolygonHighlight(Graphics, Polygon, Color, int)
Performs the requested fill in a color brighter than that specified in the JCFillStyle instance, including a drawn outline for the specified sides.
 o fillOutlinePolygonShadow(Graphics, Polygon)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance, including a drawn outline.
 o fillOutlinePolygonShadow(Graphics, Polygon, Color)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance, including a drawn outline.
 o fillOutlinePolygonShadow(Graphics, Polygon, Color, int)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance, including a drawn outline for the specified sides.
 o fillOutlineRect(Graphics, int, int, int, int)
Performs the requested fill with a drawn outline given the values of the properties of the JCFillStyle instance.
 o fillOutlineRect(Graphics, int, int, int, int, Color)
Performs the requested fill with a drawn outline given the values of the properties of the JCFillStyle instance.
 o fillPolygon(Graphics, Polygon)
Performs the requested fill given the values of the properties of the JCFillStyle instance.
 o fillPolygonHighlight(Graphics, Polygon)
Performs the requested fill in a color brighter than that specified in the JCFillStyle instance.
 o fillPolygonShadow(Graphics, Polygon)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance.
 o fillRect(Graphics, int, int, int, int)
Performs the requested fill given the values of the properties of the JCFillStyle instance.
 o getColor()
Gets the Color property of JCFillStyle, which determines the color used to paint the fill region.
 o getImage()
Gets the Image property.
 o getPattern()
Gets the Pattern property of JCFillStyle, which controls the pattern used to fill the specified region.
 o loadParams(String, JCChart)
Load JCChart parameters from HTML file
 o makeDefault(JCChart)
Creates a default fill style
 o makeDefault(JCChart, boolean)
Creates a default fill style
 o saveParams(String, JCChart)
Save JCChart parameters as HTML tags
 o setColor(Color)
Sets the Color property of JCFillStyle, which determines the color used to paint the fill region.
 o setImage(Component, String)
Sets the Image property of JCFillStyle, which determines the image used to paint the fill region.
 o setImage(Image)
Sets the Image property.
 o setPattern(int)
Sets the Pattern property of JCFillStyle, which controls the pattern used to fill the specified region.

Variables

 o NONE
 public static final int NONE
 o SOLID
 public static final int SOLID
 o PER_25
 public static final int PER_25
 o PER_50
 public static final int PER_50
 o PER_75
 public static final int PER_75
 o HORIZ_STRIPE
 public static final int HORIZ_STRIPE
 o VERT_STRIPE
 public static final int VERT_STRIPE
 o STRIPE_45
 public static final int STRIPE_45
 o STRIPE_135
 public static final int STRIPE_135
 o DIAG_HATCHED
 public static final int DIAG_HATCHED
 o CROSS_HATCHED
 public static final int CROSS_HATCHED
 o fillPattern_strings
 public static final String fillPattern_strings[]
 o fillPattern_values
 public static final int fillPattern_values[]

Constructors

 o JCFillStyle
 public JCFillStyle(Color c,
                    int p)
Constructor for fill style objects

Parameters:
c - fill color
p - fill pattern. One of NONE, SOLID, PER_25, PER_50, PER_75, HORIZ_STRIPE, VERT_STRIPE, STRIPE_45, STRIPE_135, DIAG_HATCHED, CROSS_HATCHED.

Methods

 o makeDefault
 public static JCFillStyle makeDefault(JCChart c)
Creates a default fill style

Returns:
JCFillStyle object with default color and fill pattern. The defaults are cycled, so consecutive calls will return different fill styles.
 o makeDefault
 public static JCFillStyle makeDefault(JCChart c,
                                       boolean other)
Creates a default fill style

Parameters:
c - JCChart instance
other - true if calculating the other style for pie charts. False otherwise.
Returns:
JCFillStyle object with default color and fill pattern. The defaults are cycled, so consecutive calls will return different fill styles.
 o drawRect
 public void drawRect(Graphics gc,
                      int x,
                      int y,
                      int width,
                      int height)
Performs the requested draw rect given the values of the properties of the JCFillStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x origin of fill region (in pixels)
y - y origin of fill region (in pixels)
width - width of fill region (in pixels)
height - height of fill region (in pixels)
 o fillRect
 public void fillRect(Graphics gc,
                      int x,
                      int y,
                      int width,
                      int height)
Performs the requested fill given the values of the properties of the JCFillStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x origin of fill region (in pixels)
y - y origin of fill region (in pixels)
width - width of fill region (in pixels)
height - height of fill region (in pixels)
 o fillImageRect
 public void fillImageRect(Graphics gc,
                           int x,
                           int y,
                           int width,
                           int height,
                           boolean positive,
                           boolean inverted)
Performs the requested fill with an image given the values of the properties of the JCFillStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x origin of fill region (in pixels)
y - y origin of fill region (in pixels)
width - width of fill region (in pixels)
height - height of fill region (in pixels)
positive - true if the fill is occurring above the axis.
inverted - true if the axes are inverted.
 o fillOutlineRect
 public void fillOutlineRect(Graphics gc,
                             int x,
                             int y,
                             int width,
                             int height)
Performs the requested fill with a drawn outline given the values of the properties of the JCFillStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x origin of fill region (in pixels)
y - y origin of fill region (in pixels)
width - width of fill region (in pixels)
height - height of fill region (in pixels)
 o fillOutlineRect
 public void fillOutlineRect(Graphics gc,
                             int x,
                             int y,
                             int width,
                             int height,
                             Color localColor)
Performs the requested fill with a drawn outline given the values of the properties of the JCFillStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x origin of fill region (in pixels)
y - y origin of fill region (in pixels)
width - width of fill region (in pixels)
height - height of fill region (in pixels)
localColor - color of outline. If null, color will be calculated from fill color.
 o fillPolygon
 public void fillPolygon(Graphics gc,
                         Polygon poly)
Performs the requested fill given the values of the properties of the JCFillStyle instance.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
 o fillOutlinePolygon
 public void fillOutlinePolygon(Graphics gc,
                                Polygon poly,
                                Color localColor)
Performs the requested fill with a drawn outline given the values of the properties of the JCFillStyle instance.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
localColor - color of outline. If null, color will be calculated from fill color.
 o fillOutlinePartialPolygon
 public void fillOutlinePartialPolygon(Graphics gc,
                                       Polygon poly,
                                       Color localColor)
Performs the requested fill for a partial polygon with a drawn outline given the values of the * properties of the JCFillStyle instance. A partial polygon is a polygon that is not closed. A line between the first and last points will be drawn in the fill color. The line outlining the rest of the polygon will be drawn in the color specified by localColor.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
localColor - color of outline. If null, color will be calculated from fill color.
 o fillPolygonShadow
 public void fillPolygonShadow(Graphics gc,
                               Polygon poly)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
 o fillPolygonHighlight
 public void fillPolygonHighlight(Graphics gc,
                                  Polygon poly)
Performs the requested fill in a color brighter than that specified in the JCFillStyle instance.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
 o fillOutlinePolygonShadow
 public void fillOutlinePolygonShadow(Graphics gc,
                                      Polygon poly)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance, including a drawn outline.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
 o fillOutlinePolygonShadow
 public void fillOutlinePolygonShadow(Graphics gc,
                                      Polygon poly,
                                      Color localColor)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance, including a drawn outline.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
localColor - color of outline. If null, color will be calculated from fill color.
 o fillOutlinePolygonShadow
 public void fillOutlinePolygonShadow(Graphics gc,
                                      Polygon poly,
                                      Color localColor,
                                      int sides)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance, including a drawn outline for the specified sides.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
localColor - color of outline. If null, color will be calculated from fill color.
sides - a value consisting of or-ed values of (2 ^ n) where n is the side number to be draw. (For example, to draw sides 0 and 2, the values would be (2^0 | 2^2) = 5).
 o fillOutlinePolygonHighlight
 public void fillOutlinePolygonHighlight(Graphics gc,
                                         Polygon poly)
Performs the requested fill in a color brighter than that specified in the JCFillStyle instance, including a drawn outline.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
 o fillOutlinePolygonHighlight
 public void fillOutlinePolygonHighlight(Graphics gc,
                                         Polygon poly,
                                         Color localColor)
Performs the requested fill in a color brighter than that specified in the JCFillStyle instance, including a drawn outline.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
localColor - color of outline. If null, color will be calculated from fill color.
 o fillOutlinePolygonHighlight
 public void fillOutlinePolygonHighlight(Graphics gc,
                                         Polygon poly,
                                         Color localColor,
                                         int sides)
Performs the requested fill in a color brighter than that specified in the JCFillStyle instance, including a drawn outline for the specified sides.

Parameters:
gc - graphics context to use for drawing
poly - polygon to fill
localColor - color of outline. If null, color will be calculated from fill color.
sides - a value consisting of or-ed values of (2 ^ n) where n is the side number to be draw. (For example, to draw sides 0 and 2, the values would be (2^0 | 2^2) = 5).
 o fillArc
 public void fillArc(Graphics gc,
                     int x,
                     int y,
                     int width,
                     int height,
                     int startAngle,
                     int arcAngle)
Performs the requested fill given the values of the properties of the JCFillStyle instance.

Parameters:
gr - graphics context to use for drawing
x - x origin of fill region (in pixels)
y - y origin of fill region (in pixels)
width - width of fill region (in pixels)
height - height of fill region (in pixels)
startAngle - start angle of the arc (in degrees)
arcAngle - size of arc to fill (in degrees)
 o fillArcShadow
 public void fillArcShadow(Graphics gc,
                           int x,
                           int y,
                           int width,
                           int height,
                           int startAngle,
                           int arcAngle)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance.

Parameters:
gr - graphics context to use for drawing
x - x origin of fill region (in pixels)
y - y origin of fill region (in pixels)
width - width of fill region (in pixels)
height - height of fill region (in pixels)
startAngle - start angle of the arc (in degrees)
arcAngle - size of arc to fill (in degrees)
 o getColor
 public Color getColor()
Gets the Color property of JCFillStyle, which determines the color used to paint the fill region.

Returns:
AWT Color class representing the color to be used to paint the fills. If null, the current color of the Graphics object is used to paint the fill.
 o setColor
 public void setColor(Color clr)
Sets the Color property of JCFillStyle, which determines the color used to paint the fill region.

Parameters:
clr - AWT Color class representing the color to be used to paint the fills. If null, the current color of the Graphics object is used to paint the fill.
 o getPattern
 public int getPattern()
Gets the Pattern property of JCFillStyle, which controls the pattern used to fill the specified region.

Returns:
fill pattern, which is one of NONE, SOLID, 25_PERCENT, 50_PERCENT, 75_PERCENT, HORIZ_STRIPE, VERT_STRIPE, 45_STRIPE, 135_STRIPE, DIAG_HATCHED or CROSS_HATCHED
 o setPattern
 public void setPattern(int pat)
Sets the Pattern property of JCFillStyle, which controls the pattern used to fill the specified region.

Parameters:
pat - fill pattern, which is one of NONE, SOLID, 25_PERCENT, 50_PERCENT, 75_PERCENT, HORIZ_STRIPE, VERT_STRIPE, 45_STRIPE, 135_STRIPE, DIAG_HATCHED or CROSS_HATCHED
Throws: IllegalArgumentException
If Patter is not one of the valid enum values.
 o getImage
 public Image getImage()
Gets the Image property. The Image property determines the image used to paint the fill region. Only bar charts use this property.

Returns:
AWT Image class representing the image to be used to paint image fills. If null, no image fill is done.
 o setImage
 public void setImage(Image img)
Sets the Image property. The Image property determines the image used to paint the fill region. Only bar charts use this property.

Parameters:
img - AWT Image class representing the image to be used to paint image fills. If null, no image fill is done.
 o setImage
 public void setImage(Component comp,
                      String file)
Sets the Image property of JCFillStyle, which determines the image used to paint the fill region. Only bar charts use this property.

Parameters:
img - AWT Image class representing the image to be used to paint image fills. If null, no image fill is done.
 o saveParams
 public void saveParams(String name,
                        JCChart comp)
Save JCChart parameters as HTML tags

Parameters:
name - the PARAM NAME
chart - the JCChart component
 o loadParams
 public void loadParams(String name,
                        JCChart comp)
Load JCChart parameters from HTML file

Parameters:
name - the PARAM NAME
chart - the JCChart component

All Packages  Class Hierarchy  This Package  Previous  Next  Index