edu.byu.phun2d
Class Oval

java.lang.Object
  extended by edu.byu.phun2d.DrawObj
      extended by edu.byu.phun2d.Oval

public class Oval
extends DrawObj

This class draws an oval based on a center point and a width and height. This will only create ovals that are aligned with the X and Y axes. Other kinds of ovals can be created by adding it to a Group and then performing scales and rotations through the Group.


Constructor Summary
Oval(double centerX, double centerY, double width, double height)
          This creates a new oval object with the specified location and size.
 
Method Summary
 double getCenterX()
          The X coordinate of the center of the oval.
 double getCenterY()
          The Y coordinate of the center of the oval.
 double getHeight()
          The height of the oval.
 double getWidth()
          The width of the oval.
 void setCenter(double centerX, double centerY)
          Changes the center coordinates of the oval.
 void setHeight(double newHeight)
          Changes the height of the oval.
 void setWidth(double newWidth)
          Changes the width of the oval.
 
Methods inherited from class edu.byu.phun2d.DrawObj
getFillColor, getLineColor, getLineWidth, getRotate, getScaleX, getScaleY, getTranslate, insideToOutside, outsideToInside, setFillColor, setLineColor, setLineWidth, setRotate, setScale, setTranslate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Oval

public Oval(double centerX,
            double centerY,
            double width,
            double height)
This creates a new oval object with the specified location and size.

Parameters:
centerX - this is the X coordinate of the center of the Oval
centerY - this is the Y coordinate of the center of the Oval
width - this is the width of the new Oval
height - this is the height of the Oval
Method Detail

setCenter

public void setCenter(double centerX,
                      double centerY)
Changes the center coordinates of the oval.

Parameters:
centerX - the new X coordinate.
centerY - the new Y coordinate.

setWidth

public void setWidth(double newWidth)
Changes the width of the oval.

Parameters:
newWidth - the new width.

setHeight

public void setHeight(double newHeight)
Changes the height of the oval.

Parameters:
newHeight - the new height.

getWidth

public double getWidth()
The width of the oval.

Returns:

getHeight

public double getHeight()
The height of the oval.

Returns:

getCenterX

public double getCenterX()
The X coordinate of the center of the oval.

Returns:

getCenterY

public double getCenterY()
The Y coordinate of the center of the oval.

Returns: