RectangularShape
is the base class for a number of
Shape
objects whose geometry is defined by a rectangular frame.
This class does not directly specify any specific geometry by
itself, but merely provides manipulation methods inherited by
a whole category of Shape
objects.
The manipulation methods provided by this class can be used to
query and modify the rectangular frame, which provides a reference
for the subclasses to define their geometry.
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public boolean | contains(Point2D
the specified p)Point2D to be testedOverrides com. Tests if a specified |
public RectBounds | getBounds()
Implements abstract com. Note that there is no guarantee that the returned
|
public float | Returns: the X coordinate of the center of the framing rectangle of theShape .Returns the X coordinate of the center of the framing
rectangle of the |
public float | Returns: the Y coordinate of the center of the framing rectangle of theShape .Returns the Y coordinate of the center of the framing
rectangle of the |
public abstract float | Returns: the height of the framing rectangle.Returns the height of the framing rectangle
in |
public float | Returns: the largest X coordinate of the framing rectangle of theShape .Returns the largest X coordinate of the framing
rectangle of the |
public float | Returns: the largest Y coordinate of the framing rectangle of theShape .Returns the largest Y coordinate of the framing
rectangle of the |
public float | Returns: the smallest X coordinate of the framing rectangle of theShape .Returns the smallest X coordinate of the framing
rectangle of the |
public float | Returns: the smallest Y coordinate of the framing rectangle of theShape .Returns the smallest Y coordinate of the framing
rectangle of the |
public PathIterator | Returns: aPathIterator object that provides access to
the Shape object's flattened geometry.an optional tx, float BaseTransform to be applied to the
coordinates as they are returned in the iteration,
or null if untransformed coordinates are desired.the maximum distance that the line segments used to
approximate the curved segments are allowed to deviate
from any point on the original curve flatness)Implements abstract com. Returns an iterator object that iterates along the
|
public abstract float | Returns: the width of the framing rectangle.Returns the width of the framing rectangle in
|
public abstract float | Returns: the X coordinate of the upper-left corner of the framing rectangle.Returns the X coordinate of the upper-left corner of
the framing rectangle in |
public abstract float | Returns: the Y coordinate of the upper-left corner of the framing rectangle.Returns the Y coordinate of the upper-left corner of
the framing rectangle in |
public abstract boolean | Returns: true if the RectangularShape is empty;
false otherwise.Determines whether the |
public abstract void | setFrame(float
the X coordinate of the upper-left corner of the
specified rectangular shape x, float the Y coordinate of the upper-left corner of the
specified rectangular shape y, float the width of the specified rectangular shape w, float the height of the specified rectangular shape h)Sets the location and size of the framing rectangle of this
|
public void | setFrame(Point2D
the specified loc, Dimension2D Point2D the specified size)Dimension2D Sets the location and size of the framing rectangle of this
|
public void | setFrameFromCenter(float
the X coordinate of the specified center point centerX, float the Y coordinate of the specified center point centerY, float the X coordinate of the specified corner point cornerX, float the Y coordinate of the specified corner point cornerY)Sets the framing rectangle of this |
public void | setFrameFromCenter(Point2D
the specified center center, Point2D Point2D the specified corner corner)Point2D Sets the framing rectangle of this |
public void | setFrameFromDiagonal(float
the X coordinate of the start point of the specified diagonal x1, float the Y coordinate of the start point of the specified diagonal y1, float the X coordinate of the end point of the specified diagonal x2, float the Y coordinate of the end point of the specified diagonal y2)Sets the diagonal of the framing rectangle of this |
public void | setFrameFromDiagonal(Point2D
the start p1, Point2D Point2D of the specified diagonalthe end p2)Point2D of the specified diagonalSets the diagonal of the framing rectangle of this |
public String |
RectangularShape | back to summary |
---|---|
protected RectangularShape() This is an abstract class that cannot be instantiated directly.
|
contains | back to summary |
---|---|
public boolean contains(Point2D p) Overrides com. Doc from com. Tests if a specified |
getBounds | back to summary |
---|---|
public RectBounds getBounds() Implements abstract com. Doc from com. Note that there is no guarantee that the returned
|
getCenterX | back to summary |
---|---|
public float getCenterX() Returns the X coordinate of the center of the framing
rectangle of the
|
getCenterY | back to summary |
---|---|
public float getCenterY() Returns the Y coordinate of the center of the framing
rectangle of the
|
getHeight | back to summary |
---|---|
public abstract float getHeight() Returns the height of the framing rectangle
in
|
getMaxX | back to summary |
---|---|
public float getMaxX() Returns the largest X coordinate of the framing
rectangle of the
|
getMaxY | back to summary |
---|---|
public float getMaxY() Returns the largest Y coordinate of the framing
rectangle of the
|
getMinX | back to summary |
---|---|
public float getMinX() Returns the smallest X coordinate of the framing
rectangle of the
|
getMinY | back to summary |
---|---|
public float getMinY() Returns the smallest Y coordinate of the framing
rectangle of the
|
getPathIterator | back to summary |
---|---|
public PathIterator getPathIterator(BaseTransform tx, float flatness) Implements abstract com. Returns an iterator object that iterates along the
Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types will be returned by the iterator.
The amount of subdivision of the curved segments is controlled
by the
|
getWidth | back to summary |
---|---|
public abstract float getWidth() Returns the width of the framing rectangle in
|
getX | back to summary |
---|---|
public abstract float getX() Returns the X coordinate of the upper-left corner of
the framing rectangle in
|
getY | back to summary |
---|---|
public abstract float getY() Returns the Y coordinate of the upper-left corner of
the framing rectangle in
|
isEmpty | back to summary |
---|---|
public abstract boolean isEmpty() Determines whether the
|
setFrame | back to summary |
---|---|
public abstract void setFrame(float x, float y, float w, float h) Sets the location and size of the framing rectangle of this
|
setFrame | back to summary |
---|---|
public void setFrame(Point2D loc, Dimension2D size) Sets the location and size of the framing rectangle of this
|
setFrameFromCenter | back to summary |
---|---|
public void setFrameFromCenter(float centerX, float centerY, float cornerX, float cornerY) Sets the framing rectangle of this
|
setFrameFromCenter | back to summary |
---|---|
public void setFrameFromCenter(Point2D center, Point2D corner) Sets the framing rectangle of this |
setFrameFromDiagonal | back to summary |
---|---|
public void setFrameFromDiagonal(float x1, float y1, float x2, float y2) Sets the diagonal of the framing rectangle of this
|
setFrameFromDiagonal | back to summary |
---|---|
public void setFrameFromDiagonal(Point2D p1, Point2D p2) Sets the diagonal of the framing rectangle of this |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- |