|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unifreiburg.twodeedoo.world.AwtCanvas
public class AwtCanvas
Implementation of ICanvas using AWT Graphics.
Constructor Summary | |
---|---|
AwtCanvas(java.awt.Graphics g)
|
Method Summary | |
---|---|
void |
drawFilledCircle(int x,
int y,
int radius,
java.awt.Color color)
Draw a filled circle. |
void |
drawFilledRect(int upperLeftX,
int upperLeftY,
int width,
int height,
java.awt.Color color)
Draw a filled rectangle. |
void |
drawLine(int x0,
int y0,
int x1,
int y1,
java.awt.Color color)
Draw a line. |
void |
drawText(int x,
int y,
java.lang.String msg,
java.awt.Color color)
Draw text in the standard font. |
java.awt.Graphics |
getAwtGraphics()
Return the inner Graphics ; you can use it to draw complicated
shapes beyond what this interface offers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AwtCanvas(java.awt.Graphics g)
Method Detail |
---|
public void drawFilledCircle(int x, int y, int radius, java.awt.Color color)
ICanvas
drawFilledCircle
in interface ICanvas
x
- X of center (in pixels)y
- Y of center (in pixels)radius
- radius in pixelscolor
- color for the circle.public void drawText(int x, int y, java.lang.String msg, java.awt.Color color)
ICanvas
drawText
in interface ICanvas
x
- x coordinate of baseline of first charactery
- y coordinate of baseline of first charactermsg
- a textcolor
- text colorpublic void drawFilledRect(int upperLeftX, int upperLeftY, int width, int height, java.awt.Color color)
ICanvas
drawFilledRect
in interface ICanvas
upperLeftX
- X of upper left cornerupperLeftY
- Y of upper left cornerwidth
- width of rectangleheight
- height of rectanglecolor
- fill colorpublic void drawLine(int x0, int y0, int x1, int y1, java.awt.Color color)
ICanvas
drawLine
in interface ICanvas
x0
- first pointy0
- first pointx1
- second pointy1
- second pointcolor
- colorpublic java.awt.Graphics getAwtGraphics()
ICanvas
Graphics
; you can use it to draw complicated
shapes beyond what this interface offers.
getAwtGraphics
in interface ICanvas
Graphics
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |