Interface Canvas

All Known Implementing Classes:
CanvasAWT, CanvasSWT

public interface Canvas
Canvas interface.

This interface defines the set of methods that any concrete canvas should define. Concrete canvases should be defined in order to provide a way to draw a wafer representation on various window toolkig (AWT, SWT, etc).

Author:
Martin Pernollet
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drawBackground(Color color, int width, int height)
    Draws the picture background in the given color.
    void
    drawDot(Color color, int x, int y)
    Draws a dot, represented by a small rectangle.
    void
    drawOval(Color color, int x, int y, int width, int height)
    Draws an oval.
    void
    drawRect(Color color, int x, int y, int width, int heigth)
    Draws a rectangle.
    void
    drawRect(Color color, int x, int y, int width, int heigth, boolean border)
    Draws a rectangle.
    void
    drawString(int x, int y, String text)
    Draws a text.
  • Method Details

    • drawRect

      void drawRect(Color color, int x, int y, int width, int heigth, boolean border)
      Draws a rectangle.
      Parameters:
      x - x value of the square.
      y - y value of the square.
      width - width of the square.
      heigth - heigth of the square.
      Color - color of the square
    • drawRect

      void drawRect(Color color, int x, int y, int width, int heigth)
      Draws a rectangle.
    • drawDot

      void drawDot(Color color, int x, int y)
      Draws a dot, represented by a small rectangle.
      Parameters:
      color - the pixel.
      x - x value of the dot.
      y - y value of the dot.
    • drawOval

      void drawOval(Color color, int x, int y, int width, int height)
      Draws an oval.
      Parameters:
      x - x value of the oval center.
      y - y value of the oval center.
      width - width of the wafer circle.
      height - height of the wafer circle.
      Color - color of the oval
    • drawString

      void drawString(int x, int y, String text)
      Draws a text.
      Parameters:
      x - x value of the text.
      y - y value of the text.
      text - text to be displayed.
    • drawBackground

      void drawBackground(Color color, int width, int height)
      Draws the picture background in the given color.
      Parameters:
      color - the background color.
      width - width of the picture.
      height - height of the picture.