objectdraw
Class Oval
java.lang.Object
objectdraw.Drawable
objectdraw.Drawable2D
objectdraw.Resizable2D
objectdraw.Rectangular
objectdraw.Oval
- All Implemented Interfaces:
- Serializable, Drawable2DInterface, DrawableInterface, Resizable2DInterface
- Direct Known Subclasses:
- FilledOval, FramedOval
abstract class Oval
- extends Rectangular
Oval is an abstract base class representing drawable oval objects.
- Version:
- 1.1.1 released February 2005
Constructor Summary |
Oval(double x,
double y,
double width,
double height,
DrawingCanvas canvas)
Constructs a new oval bounded by a rectangle with upper left
corner at (x,y) and dimensions given by width and height. |
Oval(Location origin,
double width,
double height,
DrawingCanvas canvas)
Constructs a new oval bounded by a rectangle with upper left
corner at origin and dimensions given by width and height. |
Oval(Location p0,
Location p1,
DrawingCanvas canvas)
Constructs a new oval bounded by a rectangle with diagonal given by
a line from p0 to p1. |
Method Summary |
boolean |
contains(Location point)
Determines if a particular position on the DrawingCanvas is contained within the object. |
String |
toString()
Generates a string representation of the oval. |
Methods inherited from class objectdraw.Drawable |
addToCanvas, clearCanvasContent, getCanvas, getColor, hide, isHidden, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setCanvasContent, setColor, setStateChanged, show |
Methods inherited from interface objectdraw.DrawableInterface |
addToCanvas, getCanvas, getColor, hide, isHidden, move, moveTo, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show |
Oval
public Oval(double x,
double y,
double width,
double height,
DrawingCanvas canvas)
- Constructs a new oval bounded by a rectangle with upper left
corner at (x,y) and dimensions given by width and height.
- 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 rectanglecanvas
- the canvas in which the oval is created
Oval
public Oval(Location origin,
double width,
double height,
DrawingCanvas canvas)
- Constructs a new oval bounded by a rectangle with upper left
corner at origin and dimensions given by width and height.
- Parameters:
origin
- the upper left corner of the bounding rectanglewidth
- the width of the bounding rectangleheight
- the height of the bounding rectanglecanvas
- the canvas in which the oval is created
Oval
public Oval(Location p0,
Location p1,
DrawingCanvas canvas)
- Constructs a new oval bounded by a rectangle with diagonal given by
a line from p0 to p1.
- Parameters:
p0
- endpoint of a diagonal of the bounding rectanglep1
- other diagonal endpointcanvas
- the canvas in which the object is created
contains
public boolean contains(Location point)
- Description copied from interface:
DrawableInterface
- Determines if a particular position on the DrawingCanvas is contained within the object.
- Specified by:
contains
in interface DrawableInterface
- Overrides:
contains
in class Drawable2D
- Parameters:
point
- the position on the canvas.
- Returns:
- true if point is contained in the object, false otherwise.
toString
public String toString()
- Generates a string representation of the oval.
- Overrides:
toString
in class Object
- Returns:
- a string representation of the oval