objectdraw
Class FilledOval
java.lang.Object
|
+--objectdraw.Drawable
|
+--objectdraw.Drawable2D
|
+--objectdraw.Resizable2D
|
+--objectdraw.Rect
|
+--objectdraw.FilledOval
- All Implemented Interfaces:
- Drawable2DInterface, DrawableInterface, Resizable2DInterface, java.io.Serializable
- public class FilledOval
- extends Rect
FilledOval is an implementation of a drawable filled oval object.
- See Also:
- Serialized Form
Method Summary |
boolean |
contains(Location point)
Determines if the oval contains the given point. |
void |
draw(java.awt.Graphics g)
Draws the object. |
java.lang.String |
toString()
Generates a string representation of the object. |
Methods inherited from class objectdraw.Drawable |
addToCanvas, getColor, hide, isHidden, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, setStateChanged, show |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface objectdraw.DrawableInterface |
addToCanvas, getColor, hide, isHidden, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show |
FilledOval
public FilledOval(Location origin,
double width,
double height,
DrawingCanvas c)
- Constructs a new oval bounded by the given rectangle.
- Parameters:
origin
- the upper left corner of the bounding rectanglewidth
- the width of the bounding rectangleheight
- the height of the bounding rectanglec
- the canvas in which the oval is created
FilledOval
public FilledOval(double x,
double y,
double width,
double height,
DrawingCanvas c)
- Constructs a new oval bounded by the given rectangle.
- Parameters:
x
- coordinate of the upper left corner of the bounding rectangley
- coordinate of the upper left corner of the bounding rectanglewidth
- the width of the bounding rectangleheight
- the height of the bounding rectanglec
- the canvas in which the oval is created
FilledOval
public FilledOval(Location p0,
Location p1,
DrawingCanvas c)
- Creates a new oval bounded by the given rectangle.
- Parameters:
p0
- endpoint of a diagonal of the bounding rectanglep1
- other diagonal endpointc
- the canvas in which the object is created
contains
public boolean contains(Location point)
- Determines if the oval contains the given point.
- Overrides:
contains
in class Drawable2D
- Parameters:
point
- the point- Returns:
true
if point is contained in oval.
false
otherwise.
draw
public void draw(java.awt.Graphics g)
- Draws the object.
- Overrides:
draw
in class Drawable2D
- Parameters:
g
- the graphics context into which the object is drawn
toString
public java.lang.String toString()
- Generates a string representation of the object.
- Overrides:
toString
in class java.lang.Object
- Returns:
- a string representation of the object