org.jdrawing.graphics
Class AbstractFillRect
java.lang.Object
org.jdrawing.graphics.GraphicsElement
org.jdrawing.graphics.GraphicsOperation
org.jdrawing.graphics.RectangleOperation
org.jdrawing.graphics.AbstractFillRect
- All Implemented Interfaces:
- DrawingElement
- Direct Known Subclasses:
- Fill3DRect, FillOval, FillRect
- public abstract class AbstractFillRect
- extends RectangleOperation
Base class for drawing operations, which fills the rectangle.
Constructor Summary |
AbstractFillRect(int x,
int y,
int width,
int height)
Returns AbstractFillRect with given 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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractFillRect
public AbstractFillRect(int x,
int y,
int width,
int height)
- Returns AbstractFillRect with given rectangle.
- Parameters:
x
- left edge of the rectangley
- top edge of the rectangewidth
- width of the rectangleheight
- height of the rectange
getBounds
public java.awt.Rectangle getBounds()
- Returns bounding box of the element. If the element is unbounded
then this method returns null.
- 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.
- 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.
- 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.
- Parameters:
point
- to be checked
- Returns:
- true if the element contains given point;
false otherwise