de.unifreiburg.twodeedoo.world
Interface ICanvas

All Known Implementing Classes:
AwtCanvas

public interface ICanvas

Simple drawing surface, wraps an AWT Graphics.


Method Summary
 void drawFilledCircle(int centerX, int centerY, 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.
 

Method Detail

drawFilledCircle

void drawFilledCircle(int centerX,
                      int centerY,
                      int radius,
                      java.awt.Color color)
Draw a filled circle.

Parameters:
centerX - X of center (in pixels)
centerY - Y of center (in pixels)
radius - radius in pixels
color - color for the circle.

drawText

void drawText(int x,
              int y,
              java.lang.String msg,
              java.awt.Color color)
Draw text in the standard font. The (x,y) point specifies where the baseline of the first character is drawn.

Parameters:
x - x coordinate of baseline of first character
y - y coordinate of baseline of first character
msg - a text
color - text color

drawFilledRect

void drawFilledRect(int upperLeftX,
                    int upperLeftY,
                    int width,
                    int height,
                    java.awt.Color color)
Draw a filled rectangle.

Parameters:
upperLeftX - X of upper left corner
upperLeftY - Y of upper left corner
width - width of rectangle
height - height of rectangle
color - fill color

drawLine

void drawLine(int x0,
              int y0,
              int x1,
              int y1,
              java.awt.Color color)
Draw a line.

Parameters:
x0 - first point
y0 - first point
x1 - second point
y1 - second point
color - color

getAwtGraphics

java.awt.Graphics getAwtGraphics()
Return the inner Graphics; you can use it to draw complicated shapes beyond what this interface offers.

Returns:
the inner Graphics