com.rolemodelsoft.drawlet.basics
Class AbstractPaintable

java.lang.Object
  |
  +--com.rolemodelsoft.drawlet.basics.AbstractPaintable
Direct Known Subclasses:
AbstractFigure, SimpleDrawing, SimpleDrawingCanvas

public class AbstractPaintable
extends java.lang.Object
implements Paintable

Provides a default implementation of Paintable.


Constructor Summary
AbstractPaintable()
          Creates a new AbstractPaintable.
 
Method Summary
 int getBottom()
          Returns the bottommost coordinate of the receiver.
 java.awt.Rectangle getBounds()
          Answers the rectangular space covered by the receiver.
 int getHeight()
          Returns the height of the receiver.
 int getLeft()
          Returns the leftmost coordinate of the receiver.
 int getRight()
          Returns the rightmost coordinate of the receiver.
 java.awt.Dimension getSize()
          Returns the current size of the receiver.
 int getTop()
          Returns the topmost coordinate of the receiver.
 int getWidth()
          Returns the width of the receiver.
 void paint(java.awt.Graphics g)
          Tells the receiver to paint itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPaintable

public AbstractPaintable()
Creates a new AbstractPaintable.
Method Detail

getBottom

public int getBottom()
Returns the bottommost coordinate of the receiver.
Specified by:
getBottom in interface Paintable
Returns:
an integer representing the bottommost coordinate of the receiver

getBounds

public java.awt.Rectangle getBounds()
Answers the rectangular space covered by the receiver.
Specified by:
getBounds in interface Paintable
Returns:
a Rectangle representing the bounds.

getHeight

public int getHeight()
Returns the height of the receiver.
Specified by:
getHeight in interface Paintable
Returns:
an integer representing the height of the receiver.

getLeft

public int getLeft()
Returns the leftmost coordinate of the receiver.
Specified by:
getLeft in interface Paintable
Returns:
an integer representing the leftmost coordinate of the receiver

getRight

public int getRight()
Returns the rightmost coordinate of the receiver.
Specified by:
getRight in interface Paintable
Returns:
an integer representing the rightmost coordinate of the receiver

getSize

public java.awt.Dimension getSize()
Returns the current size of the receiver.
Specified by:
getSize in interface Paintable
Returns:
a Dimension corresponding to the current size of the receiver.
See Also:
getBounds()

getTop

public int getTop()
Returns the topmost coordinate of the receiver.
Specified by:
getTop in interface Paintable
Returns:
an integer representing the topmost coordinate of the receiver.

getWidth

public int getWidth()
Returns the width of the receiver.
Specified by:
getWidth in interface Paintable
Returns:
an integer representing the width of the receiver.

paint

public void paint(java.awt.Graphics g)
Tells the receiver to paint itself.
Specified by:
paint in interface Paintable
Parameters:
g - the Graphics object in which to paint.