|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GraphicsI
A common interface for the basic graphic operations that need to be implemented for DefaultChart to work properly. Basically this interface was introduced to let the entire library work on frameworks different from Swing/AWT.
Method Summary | |
---|---|
void |
drawCircle(int x,
int y,
int radius)
Draws a circle with the specified center and radius. |
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draws a line from (x1,y1) to (x2,y2) (coordinate in pixels). |
void |
drawString(java.lang.String s,
int x,
int y)
Draws a string starting at the given point. |
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int n)
Draws a filled polygon. |
java.lang.Object |
getBlackColor()
Returns the black color (an object representing the black color compatible with the underlying implementation). |
java.lang.Object |
getRandomColor()
Returns a random color from the underlying implementation. |
int |
getStringHeight()
Returns the maximum height of a drawn string (in pixels). |
int |
getStringWidth(java.lang.String s)
Returns the width in pixels of a drawn string. |
void |
setColor(java.lang.Object c)
Changes the color used to draw the foreground objects in this DefaultChart. |
Method Detail |
---|
void setColor(java.lang.Object c)
c
- the new colorvoid drawLine(int x1, int y1, int x2, int y2)
x1
- the first point's abscissay1
- the first point's ordinatex2
- the second point's abscissay2
- the second point's ordinatevoid drawString(java.lang.String s, int x, int y)
s
- the String to be drawnx
- top-left corner's abscissay
- top-left corner's ordinatevoid fillPolygon(int[] xPoints, int[] yPoints, int n)
xPoints
- array of the vertices' abscissaeyPoints
- array of the vertices' ordinatesn
- number of verticesvoid drawCircle(int x, int y, int radius)
x
- the center's abscissay
- the center's ordinateradius
- the radiusint getStringWidth(java.lang.String s)
s
- the string
int getStringHeight()
java.lang.Object getBlackColor()
java.lang.Object getRandomColor()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |