jdraw.graphicobjects
Class SizedGraphicObject

java.lang.Object
  |
  +--jdraw.graphicobjects.GraphicObject
        |
        +--jdraw.graphicobjects.SizedGraphicObject
Direct Known Subclasses:
Ellipse, Rectangle, Segment

public abstract class SizedGraphicObject
extends GraphicObject

A graphic object with width and height.


Field Summary
private  int height
          The height of this object.
private  int width
          The width of this object.
 
Fields inherited from class jdraw.graphicobjects.GraphicObject
 
Constructor Summary
SizedGraphicObject(int x, int y, Color color, int width, int height)
          Creates a new SizedGraphicObject with specified position, color, width and height.
 
Method Summary
 Rectangle getBoundingBox()
          Returns the bounding box of this graphic object.
 int getHeight()
          Returns the height of this object.
 int getWidth()
          Returns the width of this object.
 
Methods inherited from class jdraw.graphicobjects.GraphicObject
getColor, getCursor, getDistance, getDistanceSq, getDistanceSq, getDistanceSq, getFriendlyName, getX, getY, paint, updateCachedData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

private int width
The width of this object.


height

private int height
The height of this object.

Constructor Detail

SizedGraphicObject

public SizedGraphicObject(int x,
                          int y,
                          Color color,
                          int width,
                          int height)
Creates a new SizedGraphicObject with specified position, color, width and height.

Method Detail

getBoundingBox

public Rectangle getBoundingBox()
Returns the bounding box of this graphic object.

Specified by:
getBoundingBox in class GraphicObject

getWidth

public int getWidth()
Returns the width of this object.


getHeight

public int getHeight()
Returns the height of this object.