|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.chart3d.JCStyle | +--com.klg.jclass.chart3d.JCFillStyle
Controls the appearance of a fill, including the fill pattern and the fill color.
Field Summary | |
protected Rectangle |
anchorRect
Anchor rectangle for fill patterns. |
protected Color |
backgroundColor
Sets the background color (for patterned fills). |
static int |
BOTTOM
|
static int |
BOTTOM_LEFT
|
static int |
BOTTOM_RIGHT
|
protected BufferedImage |
buffImage
Image used for filling with images. |
static int |
CENTER
|
protected Color |
color
Sets the fill color. |
protected int |
colorIndex
Sets the index of the fill color in the default color array. |
static int |
CROSS_HATCHED
|
static String[] |
CROSS_HATCHED_PIXELS
|
static int |
CUSTOM_FILL
|
static int |
CUSTOM_PAINT
|
static int |
CUSTOM_STACK
|
protected TexturePaint |
customPaint
Custom fill paint property that has been set by the user. |
static int |
DIAG_HATCHED
|
static String[] |
DIAG_HATCHED_PIXELS
|
protected Paint |
fillPaint
Fill paint object. |
protected Paint |
hiFillPaint
Highlights the fill paint object. |
static int |
HORIZ_STRIPE
|
static String[] |
HORIZ_STRIPE_PIXELS
|
protected Image |
image
Image used to paint the fill region. |
static int |
LEFT
|
static int |
NONE
|
protected int |
orientation
Orientation for fill patterns. |
protected int |
pattern
Sets the fill pattern. |
static int |
PER_25
|
static String[] |
PER_25_PIXELS
|
static int |
PER_50
|
static String[] |
PER_50_PIXELS
|
static int |
PER_75
|
static String[] |
PER_75_PIXELS
|
static int |
RIGHT
|
protected Paint |
shFillPaint
Shadow fill paint object. |
static int |
SOLID
|
static int |
STRIPE_135
|
static String[] |
STRIPE_135_PIXELS
|
static int |
STRIPE_45
|
static String[] |
STRIPE_45_PIXELS
|
static int |
TOP
|
static int |
TOP_LEFT
|
static int |
TOP_RIGHT
|
static int |
VERT_STRIPE
|
static String[] |
VERT_STRIPE_PIXELS
|
Fields inherited from class com.klg.jclass.chart3d.JCStyle |
defaultColors, FILL_STYLE, LINE_STYLE, parent, SYMBOL_STYLE |
Constructor Summary | |
JCFillStyle(Color color,
int pattern)
Constructor for fill style objects. |
Method Summary | |
void |
drawOutlineLine(Graphics gc,
Polygon poly,
int start,
int end,
Color localColor)
Draws a portion of the outline around the given polygon. |
void |
drawOutlinePolygon(Graphics gc,
Polygon poly,
Color localColor)
Draws an outline around the given polygon. |
void |
drawOutlineRect(Graphics gc,
int x,
int y,
int width,
int height,
Color localColor)
Draws an outline around the specified rectangle. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
void |
fillPolygon(Graphics gc,
Polygon poly)
Performs the requested fill given the values of the properties of the JCFillStyle instance. |
void |
fillPolygonHighlight(Graphics gc,
Polygon poly)
Performs the requested fill in a color brighter than that specified in the JCFillStyle instance. |
void |
fillPolygonShadow(Graphics gc,
Polygon poly)
Performs the requested fill in a color darker than that specified in the JCFillStyle instance. |
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. |
Color |
getBackground()
Gets the Background property of JCFillStyle , which
determines the background color used in painting patterned fills. |
Color |
getColor()
Gets the Color property of JCFillStyle , which determines the
color used to paint the fill region. |
int |
getColorIndex()
Returns the index used to generate the color. |
TexturePaint |
getCustomPaint()
Gets the custom fill paint property that has been set by the user. |
Image |
getImage()
Gets the Image property. |
int |
getPattern()
Gets the Pattern property of JCFillStyle , which
controls the pattern used to fill the specified region. |
protected boolean |
isCustomStackable()
Returns true if this fill style can be used for custom image stacking;
that is, if the pattern is CUSTOM_STACK and an image is
present. |
BufferedImage |
makeBufferedImage()
Makes the BufferedImage for future fill paint operations using
the color specified in the Color property. |
BufferedImage |
makeBufferedImage(Color useFgColor)
Makes the BufferedImage object for fill operations using
specified color. |
BufferedImage |
makeBufferedImage(Image im)
Makes the BufferedImage object for fill operations using
specified image. |
static com.klg.jclass.chart3d.JCFillStyle |
makeDefault(com.klg.jclass.chart3d.JCChart3d c)
Creates a default fill style. |
Paint |
makeFillPaint()
Makes the Paint object for fill operations using the previously
created buffered image, the default foreground color, and no anchor
rectangle. |
Paint |
makeFillPaint(BufferedImage useImage,
Color useFgColor,
Rectangle anchor,
int orientation)
Makes the Paint object for fill operations using specified
buffered image anchored in the center of the provided rectangle. |
void |
resetFillOrientation()
Resets the fill orientation properties before the next fill operation. |
void |
resetGraphics(Graphics gc)
Resets the graphics object to a default drawing style. |
void |
setBackground(Color color)
Sets the Background property of JCFillStyle , which
determines the background color used in painting patterned fills. |
void |
setColor(Color color)
Sets the Color property of JCFillStyle , which
determines the color used to paint the fill region. |
void |
setCustomPaint(TexturePaint customPaint)
Sets a custom fill paint property in JCFillStyle ,
which controls the pattern used to fill the specified region. |
void |
setImage(Image image)
Sets the Image property. |
void |
setImage(String file)
Sets the Image property of JCFillStyle , which
determines the image used to paint the fill region. |
void |
setPattern(int pattern)
Sets the Pattern property of JCFillStyle , which controls the
pattern used to fill the specified region. |
void |
updateFillOrientation(Rectangle rect,
int newOrient)
Updates the fill orientation properties for a pending fill operation. |
boolean |
updateGraphics(Graphics gc)
Updates the graphics object with the elements of this line style (paint fills and colors), with the patterned fills being centered around the anchor rectangle that may have been set. |
boolean |
updateGraphicsToHighlight(Graphics gc)
Updates the graphics object with the highlight elements of this line style (paint fills and colors), centered around the anchor rectangle that may have been set. |
boolean |
updateGraphicsToShadow(Graphics gc)
Updates the graphics object with the shadow elements of this line style (paint fills and colors), centered around the anchor rectangle that may have been set. |
Methods inherited from class com.klg.jclass.chart3d.JCStyle |
getDefaultColors, setDefaultColors |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Color color
protected Color backgroundColor
protected int pattern
protected int colorIndex
protected Image image
protected Rectangle anchorRect
protected int orientation
protected TexturePaint customPaint
protected Paint fillPaint
protected Paint hiFillPaint
protected Paint shFillPaint
protected BufferedImage buffImage
public static final int TOP
public static final int BOTTOM
public static final int LEFT
public static final int RIGHT
public static final int CENTER
public static final int BOTTOM_LEFT
public static final int TOP_LEFT
public static final int BOTTOM_RIGHT
public static final int TOP_RIGHT
public static final int NONE
public static final int SOLID
public static final int PER_25
public static final int PER_50
public static final int PER_75
public static final int HORIZ_STRIPE
public static final int VERT_STRIPE
public static final int STRIPE_45
public static final int STRIPE_135
public static final int DIAG_HATCHED
public static final int CROSS_HATCHED
public static final int CUSTOM_FILL
public static final int CUSTOM_STACK
public static final int CUSTOM_PAINT
public static final String[] PER_25_PIXELS
public static final String[] PER_50_PIXELS
public static final String[] PER_75_PIXELS
public static final String[] HORIZ_STRIPE_PIXELS
public static final String[] VERT_STRIPE_PIXELS
public static final String[] STRIPE_45_PIXELS
public static final String[] STRIPE_135_PIXELS
public static final String[] DIAG_HATCHED_PIXELS
public static final String[] CROSS_HATCHED_PIXELS
Constructor Detail |
public JCFillStyle(Color color, int pattern)
color
- fill colorpattern
- Fill pattern. One of NONE
, SOLID
,
PER_25
, PER_50
, PER_75
, HORIZ_STRIPE
,
VERT_STRIPE
, STRIPE_45
, STRIPE_135
, DIAG_HATCHED
,
or CROSS_HATCHED
.Method Detail |
public static com.klg.jclass.chart3d.JCFillStyle makeDefault(com.klg.jclass.chart3d.JCChart3d c)
c
- Chart3d
object to base default fill style on
JCFillStyle
object with default color and fill
pattern. The defaults are cycled, so consecutive calls will return
different fill styles.public boolean updateGraphics(Graphics gc)
gc
- Graphics
object to change
true
if you should now use this object to draw; false
if the style is such that no drawing should occurpublic boolean updateGraphicsToShadow(Graphics gc)
gc
- Graphics
object to change
true
if you should now use this object to draw; false
if the style is such that no drawing should occurpublic boolean updateGraphicsToHighlight(Graphics gc)
gc
- Graphics
object to change
true
if you should now use this object to draw; false
if the style is such that no drawing should occurpublic void resetGraphics(Graphics gc)
gc
- Graphics
object to resetpublic void updateFillOrientation(Rectangle rect, int newOrient)
rect
- the new anchor rectanglenewOrient
- the new orientatoinpublic void resetFillOrientation()
public void fillRect(Graphics gc, int x, int y, int width, int height)
JCFillStyle
instance.
gc
- graphics context to use for drawingx
- 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)public void fillImageRect(Graphics gc, int x, int y, int width, int height, boolean positive, boolean inverted)
JCFillStyle
instance.
gc
- graphics context to use for drawingx
- 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 axisinverted
- true
if the axes are invertedpublic void fillOutlineRect(Graphics gc, int x, int y, int width, int height)
JCFillStyle
instance.
gc
- graphics context to use for drawingx
- 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)public void fillOutlineRect(Graphics gc, int x, int y, int width, int height, Color localColor)
JCFillStyle
instance.
gc
- graphics context to use for drawingx
- 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 the outline. If null, color will be calculated from
the fill color.public void drawOutlineRect(Graphics gc, int x, int y, int width, int height, Color localColor)
gc
- graphics context to use for drawingx
- x origin of rectangle (in pixels)y
- y origin of outline (in pixels)width
- width of outline (in pixels)height
- height of outline (in pixels)localColor
- Color of the outline. If null, color will be calculated from
the fill color.public void fillPolygon(Graphics gc, Polygon poly)
JCFillStyle
instance.
gc
- graphics context to use for drawingpoly
- polygon to fillpublic void fillOutlinePolygon(Graphics gc, Polygon poly, Color localColor)
JCFillStyle
instance.
gc
- graphics context to use for drawingpoly
- polygon to filllocalColor
- Color of the outline. If null, color will be calculated from
the fill color.public void drawOutlinePolygon(Graphics gc, Polygon poly, Color localColor)
gc
- graphics context to use for drawingpoly
- polygon to outlinelocalColor
- Color of the outline. If null, color will be calculated from
the fill color.public void drawOutlineLine(Graphics gc, Polygon poly, int start, int end, Color localColor)
gc
- graphics context to use for drawingpoly
- polygon to outlinestart
- the index of the point within the polygon to start drawing atend
- the index of the point within the polygon to stop drawing atlocalColor
- Color of the outline. If null, color will be calculated from
the fill color.public void fillOutlinePartialPolygon(Graphics gc, Polygon poly, Color localColor)
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
.
gc
- graphics context to use for drawingpoly
- polygon to filllocalColor
- Color of the outline. If null, color will be calculated from
the fill color.public void fillPolygonShadow(Graphics gc, Polygon poly)
JCFillStyle
instance.
gc
- graphics context to use for drawingpoly
- polygon to fillpublic void fillPolygonHighlight(Graphics gc, Polygon poly)
JCFillStyle
instance.
gc
- graphics context to use for drawingpoly
- polygon to fillpublic void fillOutlinePolygonShadow(Graphics gc, Polygon poly)
JCFillStyle
instance, including a drawn outline.
gc
- graphics context to use for drawingpoly
- polygon to fillpublic void fillOutlinePolygonShadow(Graphics gc, Polygon poly, Color localColor)
JCFillStyle
instance, including a drawn outline.
gc
- graphics context to use for drawingpoly
- polygon to filllocalColor
- Color of the outline. If null, color will be calculated from
the fill color.public void fillOutlinePolygonHighlight(Graphics gc, Polygon poly)
JCFillStyle
instance, including a drawn outline.
gc
- graphics context to use for drawingpoly
- polygon to fillpublic void fillOutlinePolygonHighlight(Graphics gc, Polygon poly, Color localColor)
JCFillStyle
instance, including a drawn outline.
gc
- graphics context to use for drawingpoly
- polygon to filllocalColor
- Color of the outline. If null, color will be calculated from
the fill color.public void fillArc(Graphics gc, int x, int y, int width, int height, int startAngle, int arcAngle)
JCFillStyle
instance.
gc
- graphics context to use for drawingx
- 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)public void fillArcShadow(Graphics gc, int x, int y, int width, int height, int startAngle, int arcAngle)
JCFillStyle
instance.
gc
- graphics context to use for drawingx
- 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)public Color getColor()
Color
property of JCFillStyle
, which determines the
color used to paint the fill region.
Graphics
object is used to paint
the fill.public void setColor(Color color)
Color
property of JCFillStyle
, which
determines the color used to paint the fill region.
color
- 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.public Color getBackground()
Background
property of JCFillStyle
, which
determines the background color used in painting patterned fills. If null,
the plot cube's (or if null the chart area's) background color will be used.
public void setBackground(Color color)
Background
property of JCFillStyle
, which
determines the background color used in painting patterned fills. If null,
the plot cube's (or if null the chart area's) background color will be used.
color
- AWT Color class representing the color to be used for the
background when painting patterned fills.public int getPattern()
Pattern
property of JCFillStyle
, which
controls the pattern used to fill the specified region.
NONE
, SOLID
,
25_PERCENT
, 50_PERCENT
, 75_PERCENT
,
HORIZ_STRIPE
, VERT_STRIPE
, 45_STRIPE
,
135_STRIPE
, DIAG_HATCHED
, CROSS_HATCHED
,
CUSTOM_FILL
, or CUSTOM_STACK
public void setPattern(int pattern)
Pattern
property of JCFillStyle
, which controls the
pattern used to fill the specified region.
pattern
- fill pattern, which is one of NONE
, SOLID
,
25_PERCENT
, 50_PERCENT
, 75_PERCENT
,
HORIZ_STRIPE
, VERT_STRIPE
, 45_STRIPE
,
135_STRIPE
, DIAG_HATCHED
, CROSS_HATCHED
,
CUSTOM_FILL
, or CUSTOM_STACK
(CUSTOM_STACK
is only used by bar charts)public TexturePaint getCustomPaint()
public void setCustomPaint(TexturePaint customPaint)
custom fill paint
property in JCFillStyle
,
which controls the pattern used to fill the specified region. This property
is used when the pattern has been set to CUSTOM_PAINT
.
customPaint
- public Image getImage()
Image
property.
The Image
property determines the custom image used to paint
the fill region.
public void setImage(Image image)
Image
property.
The Image
property determines the custom image used to paint
the fill region.
image
- AWT Image class representing the image to be used to paint
image fills; if null, no image fill is donepublic void setImage(String file)
Image
property of JCFillStyle
, which
determines the image used to paint the fill region. Only bar charts use
this property.
file
- the file from which to get the imagepublic int getColorIndex()
public BufferedImage makeBufferedImage()
BufferedImage
for future fill paint operations using
the color specified in the Color
property.
public BufferedImage makeBufferedImage(Color useFgColor)
BufferedImage
object for fill operations using
specified color.
useFgColor
- the foreground color to use
public BufferedImage makeBufferedImage(Image im)
BufferedImage
object for fill operations using
specified image.
im
- image to base buffered image on
public Paint makeFillPaint()
Paint
object for fill operations using the previously
created buffered image, the default foreground color, and no anchor
rectangle.
public Paint makeFillPaint(BufferedImage useImage, Color useFgColor, Rectangle anchor, int orientation)
Paint
object for fill operations using specified
buffered image anchored in the center of the provided rectangle.
useImage
- BufferedImage
object to use for
Paint
object creation. If null, returns default color as
Paint
.useFgColor
- anchor
- Anchor rectangle to center Paint
pattern within.
If null, no rectangle is used and default Paint
behavior is
used.orientation
-
protected boolean isCustomStackable()
true
if this fill style can be used for custom image stacking;
that is, if the pattern is CUSTOM_STACK
and an image is
present. Returns false
otherwise.
true
if this fill style can be used for custom image stacking;
that is, if the pattern is CUSTOM_STACK
and an image is
present. Returns false
otherwise.
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |