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.
|
-
CROSS_HATCHED
-
-
DIAG_HATCHED
-
-
fillPattern_strings
-
-
fillPattern_values
-
-
HORIZ_STRIPE
-
-
NONE
-
-
PER_25
-
-
PER_50
-
-
PER_75
-
-
SOLID
-
-
STRIPE_135
-
-
STRIPE_45
-
-
VERT_STRIPE
-
-
JCFillStyle(Color, int)
- Constructor for fill style objects
-
drawRect(Graphics, int, int, int, int)
- Performs the requested draw rect given the values of the properties
of the JCFillStyle instance.
-
fillArc(Graphics, int, int, int, int, int, int)
- Performs the requested fill given the values of the properties
of the JCFillStyle instance.
-
fillArcShadow(Graphics, int, int, int, int, int, int)
- Performs the requested fill in a color darker than that specified in the
JCFillStyle instance.
-
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.
-
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.
-
fillOutlinePolygon(Graphics, Polygon, Color)
- Performs the requested fill with a drawn outline given the values of the
properties of the JCFillStyle instance.
-
fillOutlinePolygonHighlight(Graphics, Polygon)
- Performs the requested fill in a color brighter than that specified in the
JCFillStyle instance, including a drawn outline.
-
fillOutlinePolygonHighlight(Graphics, Polygon, Color)
- Performs the requested fill in a color brighter than that specified in the
JCFillStyle instance, including a drawn outline.
-
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.
-
fillOutlinePolygonShadow(Graphics, Polygon)
- Performs the requested fill in a color darker than that specified in the
JCFillStyle instance, including a drawn outline.
-
fillOutlinePolygonShadow(Graphics, Polygon, Color)
- Performs the requested fill in a color darker than that specified in the
JCFillStyle instance, including a drawn outline.
-
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.
-
fillOutlineRect(Graphics, int, int, int, int)
- Performs the requested fill with a drawn outline given the values of
the properties of the JCFillStyle instance.
-
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.
-
fillPolygon(Graphics, Polygon)
- Performs the requested fill given the values of the properties
of the JCFillStyle instance.
-
fillPolygonHighlight(Graphics, Polygon)
- Performs the requested fill in a color brighter than that specified in the
JCFillStyle instance.
-
fillPolygonShadow(Graphics, Polygon)
- Performs the requested fill in a color darker than that specified in the
JCFillStyle instance.
-
fillRect(Graphics, int, int, int, int)
- Performs the requested fill given the values of the properties
of the JCFillStyle instance.
-
getColor()
- Gets the Color property of JCFillStyle, which determines the
color used to paint the fill region.
-
getImage()
- Gets the Image property.
-
getPattern()
- Gets the Pattern property of JCFillStyle, which controls the
pattern used to fill the specified region.
-
loadParams(String, JCChart)
- Load JCChart parameters from HTML file
-
makeDefault(JCChart)
- Creates a default fill style
-
makeDefault(JCChart, boolean)
- Creates a default fill style
-
saveParams(String, JCChart)
- Save JCChart parameters as HTML tags
-
setColor(Color)
- Sets the Color property of JCFillStyle, which determines the
color used to paint the fill region.
-
setImage(Component, String)
- Sets the Image property of JCFillStyle, which determines the
image used to paint the fill region.
-
setImage(Image)
- Sets the Image property.
-
setPattern(int)
- Sets the Pattern property of JCFillStyle, which controls the
pattern used to fill the specified region.
NONE
public static final int NONE
SOLID
public static final int SOLID
PER_25
public static final int PER_25
PER_50
public static final int PER_50
PER_75
public static final int PER_75
HORIZ_STRIPE
public static final int HORIZ_STRIPE
VERT_STRIPE
public static final int VERT_STRIPE
STRIPE_45
public static final int STRIPE_45
STRIPE_135
public static final int STRIPE_135
DIAG_HATCHED
public static final int DIAG_HATCHED
CROSS_HATCHED
public static final int CROSS_HATCHED
fillPattern_strings
public static final String fillPattern_strings[]
fillPattern_values
public static final int fillPattern_values[]
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.
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.
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.
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)
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)
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.
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)
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.
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
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.
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.
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
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
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
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.
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).
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
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.
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).
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)
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)
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.
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.
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
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.
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.
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.
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.
saveParams
public void saveParams(String name,
JCChart comp)
- Save JCChart parameters as HTML tags
- Parameters:
- name - the PARAM NAME
- chart - the JCChart component
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