org.jdrawing.graphics
Class DrawOval

java.lang.Object
  extended byorg.jdrawing.graphics.GraphicsElement
      extended byorg.jdrawing.graphics.GraphicsOperation
          extended byorg.jdrawing.graphics.RectangleOperation
              extended byorg.jdrawing.graphics.AbstractDrawRect
                  extended byorg.jdrawing.graphics.DrawOval
All Implemented Interfaces:
DrawingElement

public class DrawOval
extends AbstractDrawRect

Graphics element which corresponds to Graphics.drawOval(int, int, int, int)


Field Summary
 
Fields inherited from class org.jdrawing.graphics.GraphicsElement
BACKGROUND, COLOR, COMPOSITE, FONT, PAINT, parent, position, STROKE, TRANSFORM
 
Constructor Summary
DrawOval(int x, int y, int width, int height)
          Returns DrawOval which fits into specified rectangle.
 
Method Summary
 boolean contains(java.awt.geom.Point2D point)
          Tests if the element containes given point.
 java.awt.Rectangle getBounds()
          Returns bounding box of the element.
 java.awt.geom.Rectangle2D getBounds2D()
          Returns high precision bounding box of the element.
 boolean intersects(java.awt.geom.Rectangle2D rectangle)
          Tests if the element intersects with the given rectangle.
 void paintOperation(java.awt.Graphics2D graphics)
          Performs grawing operation.
 
Methods inherited from class org.jdrawing.graphics.RectangleOperation
getHeight, getWidth, getX, getY, setHeight, setRectangle, setWidth, setX, setY
 
Methods inherited from class org.jdrawing.graphics.GraphicsOperation
paint, update
 
Methods inherited from class org.jdrawing.graphics.GraphicsElement
addStyle, getParent, getStyle, getStyles, getTransform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawOval

public DrawOval(int x,
                int y,
                int width,
                int height)
Returns DrawOval which fits into specified rectangle.

Parameters:
x - left edge of the rectangle
y - top edge of the rectange
width - width of the rectangle
height - height of the rectange
Method Detail

paintOperation

public void paintOperation(java.awt.Graphics2D graphics)
Performs grawing operation. This implementation invokes graphics.drawOval ().

Specified by:
paintOperation in class GraphicsOperation
Parameters:
graphics - graphics context to use for painting

getBounds

public java.awt.Rectangle getBounds()
Returns bounding box of the element. If the element is unbounded then this method returns null.

Specified by:
getBounds in interface DrawingElement
Overrides:
getBounds in class AbstractDrawRect
Returns:
bounding box of the element or null is the element is unbounded

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Returns high precision bounding box of the element. If the element is unbounded then this method returns null.

Specified by:
getBounds2D in interface DrawingElement
Overrides:
getBounds2D in class AbstractDrawRect
Returns:
high precision bounding box of the element or null of the element is unbounded

intersects

public boolean intersects(java.awt.geom.Rectangle2D rectangle)
Tests if the element intersects with the given rectangle.

Specified by:
intersects in interface DrawingElement
Overrides:
intersects in class AbstractDrawRect
Parameters:
rectangle - rectangle to be cheched for intersection
Returns:
true if the element intersects with the given rectangle; false otherwase

contains

public boolean contains(java.awt.geom.Point2D point)
Tests if the element containes given point.

Specified by:
contains in interface DrawingElement
Overrides:
contains in class AbstractDrawRect
Parameters:
point - to be checked
Returns:
true if the element contains given point; false otherwise