Interface Shape

All Known Implementing Classes:
Ellipse, Line, Picture, Rectangle, Text

public interface Shape

A shape that can be drawn on a canvas.


Method Summary
 int getHeight()
          Gets the height of the shape.
 int getWidth()
          Gets the width of the shape.
 int getX()
          Gets the leftmost x-position of the shape.
 int getY()
          Gets the topmost y-position of the shape.
 void paintShape(Graphics2D g2)
          Paints the shape
 

Method Detail

getHeight

int getHeight()
Gets the height of the shape.

Returns:
the height

getWidth

int getWidth()
Gets the width of the shape.

Returns:
the width

getX

int getX()
Gets the leftmost x-position of the shape.

Returns:
the leftmost x-position

getY

int getY()
Gets the topmost y-position of the shape.

Returns:
the topmost y-position

paintShape

void paintShape(Graphics2D g2)
Paints the shape

Parameters:
g2 - the graphics object