|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.java4less.rchart.gc.ChartGraphics
Wrapper for the AWT or SWT Graphic context class. Use GraphicsProvider.getGraphics() to create an instance of this class. This class allows rchart to work independtly from AWT and SWT.
Field Summary | |
static int |
ROTATE_CENTER
rotation center for rotating images |
static int |
ROTATE_LEFTTOP
|
static int |
STROKE_DASHED
style of line |
static int |
STROKE_DOTTED
style of line |
static int |
STROKE_NORMAL
style of line |
Constructor Summary | |
ChartGraphics()
|
Method Summary | |
void |
createFadeArea(ChartColor colorFrom,
ChartColor colorUntil,
int x,
int y,
int w,
int h,
boolean vertical,
boolean cyclic)
creates a gradient filling |
void |
dispose()
dispose graphic context. |
void |
drawArc(int x,
int y,
int w,
int h,
int a1,
int a2)
paints an arc |
void |
drawImage(ChartImage image,
int x,
int y)
paint image at given position |
void |
drawImage(ChartImage image,
int x1Dest,
int y1Dest,
int x2Dest,
int y2Dest,
int x1Source,
int y1Source,
int x2Source,
int y2Source)
paint image from source position to destination position |
void |
drawLine(int x1,
int y1,
int x2,
int y2)
paint a line |
void |
drawLineWithStyle(int x1,
int y1,
int x2,
int y2)
|
void |
drawPolygon(int[] x1,
int[] y1,
int count)
draw polygon |
void |
drawRect(int x1,
int y1,
int w,
int h)
draw rectangle |
boolean |
drawRotatedText(ChartFont descFont,
ChartColor descColor,
java.lang.String txt,
int angle,
int x,
int y,
boolean b)
paint rotated text |
void |
drawRoundedRect(int x1,
int y1,
int w,
int h)
draw rounded rectangle |
void |
drawString(java.lang.String s,
int x,
int y)
draw string at position x,y |
void |
fillArc(int x,
int y,
int w,
int h,
int a1,
int a2)
Fills an arc |
void |
fillPolygon(int[] x1,
int[] y1,
int count)
fill polygon |
void |
fillRect(int x1,
int y1,
int w,
int h)
fill rectangle |
void |
fillRoundRect(int x1,
int y1,
int w,
int h)
fill rectangle with rounded corners |
java.lang.Object |
getAlphaComposite()
get transparency value |
ChartColor |
getColor()
get current color in context |
ChartFont |
getFont()
get current font in context |
int |
getFontHeight()
get the height of the current font |
int |
getFontHeight(ChartFont font)
get the height of the current font |
int |
getFontWidth(ChartFont font,
java.lang.String s)
get the width of a string using the provided font |
int |
getFontWidth(java.lang.String s)
get the width of a string using the current font |
void |
paintRotatedImage(ChartImage srcImage,
int angle,
int x,
int y,
int alginment)
rotate image and paint it |
void |
setAlpha(float a)
set transparency value |
void |
setAlphaComposite(java.lang.Object a)
set transparency value |
void |
setColor(ChartColor color)
set current color in context |
void |
setFont(ChartFont font)
set current font in context |
void |
setLineStyle(int style)
sets style of line |
void |
setLineWidth(int w)
sets style of line |
void |
setTexture(ChartImage image)
image for texture painting. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int STROKE_NORMAL
public static int STROKE_DOTTED
public static int STROKE_DASHED
public static int ROTATE_CENTER
public static int ROTATE_LEFTTOP
Constructor Detail |
public ChartGraphics()
Method Detail |
public void setColor(ChartColor color)
color
- public void setFont(ChartFont font)
public ChartColor getColor()
public ChartFont getFont()
public void setTexture(ChartImage image)
public void drawArc(int x, int y, int w, int h, int a1, int a2)
x
- top left corner of the rectangley
- top left corner of the rectanglew
- width of the rectngleh
- height of the rectanglea1
- start arca2
- end arcpublic void drawLine(int x1, int y1, int x2, int y2)
x1
- start positiony1
- start positionx2
- end positiony2
- end positionpublic int getFontHeight()
public int getFontHeight(ChartFont font)
public int getFontWidth(ChartFont font, java.lang.String s)
public int getFontWidth(java.lang.String s)
public boolean drawRotatedText(ChartFont descFont, ChartColor descColor, java.lang.String txt, int angle, int x, int y, boolean b)
txt
- angle
- x
- y
- b
- public void drawString(java.lang.String s, int x, int y)
s
- value to paintx
- positiony
- positionpublic void drawImage(ChartImage image, int x, int y)
image
- image to paintx
- positiony
- positionpublic void drawImage(ChartImage image, int x1Dest, int y1Dest, int x2Dest, int y2Dest, int x1Source, int y1Source, int x2Source, int y2Source)
image
- x1Dest
- y1Dest
- x2Dest
- y2Dest
- x1Source
- y1Source
- x2Source
- y2Source
- public void fillPolygon(int[] x1, int[] y1, int count)
x1
- array of X valuesy1
- array of Y valuescount
- number of pointspublic void fillRect(int x1, int y1, int w, int h)
x1
- top left corner positiony1
- top left corner positionw
- with of rectangleh
- height of rectanglepublic void fillRoundRect(int x1, int y1, int w, int h)
x1
- top left corner positiony1
- top left corner positionw
- with of rectangleh
- height of rectanglepublic void drawPolygon(int[] x1, int[] y1, int count)
x1
- array of X valuesy1
- array of Y valuescount
- number of pointspublic void drawRect(int x1, int y1, int w, int h)
x1
- top left corner positiony1
- top left corner positionw
- with of rectangleh
- height of rectanglepublic void drawRoundedRect(int x1, int y1, int w, int h)
x1
- top left corner positiony1
- top left corner positionw
- with of rectangleh
- height of rectanglepublic void createFadeArea(ChartColor colorFrom, ChartColor colorUntil, int x, int y, int w, int h, boolean vertical, boolean cyclic)
colorFrom
- colorUntil
- x
- top left corner positiony
- top left corner positionw
- with of rectangleh
- height of rectanglevertical
- vertical gradient?public void fillArc(int x, int y, int w, int h, int a1, int a2)
x
- top left corner of the rectangley
- top left corner of the rectanglew
- width of the rectngleh
- height of the rectanglea1
- start arca2
- end arcpublic void setAlpha(float a)
public void setAlphaComposite(java.lang.Object a)
public java.lang.Object getAlphaComposite()
public void setLineStyle(int style)
style
- public void setLineWidth(int w)
public void dispose()
public void paintRotatedImage(ChartImage srcImage, int angle, int x, int y, int alginment)
srcImage
- source image (must be a square, width=height)angle
- anglex
- position where image must be paintedy
- position where image must be paintedpublic void drawLineWithStyle(int x1, int y1, int x2, int y2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |