public abstract class RectangularShape extends Object implements IRectangularShape
IShape objects whose geometry is defined by a rectangular
frame.| Constructor and Description |
|---|
RectangularShape() |
| Modifier and Type | Method and Description |
|---|---|
Rectangle |
bounds()
Returns a copy of the bounding rectangle for this shape.
|
Rectangle |
bounds(Rectangle target)
Initializes the supplied rectangle with this shape's bounding rectangle.
|
Point |
center()
Returns the center of the framing rectangle.
|
float |
centerX()
Returns the x-coordinate of the center of the framing rectangle.
|
float |
centerY()
Returns the y-coordinate of the center of the framing rectangle.
|
boolean |
contains(IRectangle rect)
Returns true if this shape completely contains the supplied rectangle.
|
boolean |
contains(XY point)
Returns true if this shape contains the supplied point.
|
Rectangle |
frame()
Returns a copy of this shape's framing rectangle.
|
Rectangle |
frame(Rectangle target)
Initializes the supplied rectangle with this shape's framing rectangle.
|
boolean |
intersects(IRectangle rect)
Returns true if this shape intersects the supplied rectangle.
|
boolean |
isEmpty()
Returns true if this shape encloses no area.
|
Point |
max()
Returns the maximum x,y-coordinate of the framing rectangle.
|
float |
maxX()
Returns the maximum x-coordinate of the framing rectangle.
|
float |
maxY()
Returns the maximum y-coordinate of the framing rectangle.
|
Point |
min()
Returns the minimum x,y-coordinate of the framing rectangle.
|
float |
minX()
Returns the minimum x-coordinate of the framing rectangle.
|
float |
minY()
Returns the minimum y-coordinate of the framing rectangle.
|
PathIterator |
pathIterator(Transform t,
float flatness)
Returns an iterator over the path described by this shape.
|
abstract void |
setFrame(float x,
float y,
float width,
float height)
Sets the location and size of the framing rectangle of this shape to the specified values.
|
void |
setFrame(IRectangle r)
Sets the location and size of the framing rectangle of this shape to be equal to the
supplied rectangle.
|
void |
setFrame(XY loc,
IDimension size)
Sets the location and size of the framing rectangle of this shape to the supplied values.
|
void |
setFrameFromCenter(float centerX,
float centerY,
float cornerX,
float cornerY)
Sets the location and size of the framing rectangle of this shape based on the specified
center and corner points.
|
void |
setFrameFromCenter(XY center,
XY corner)
Sets the location and size of the framing rectangle of this shape based on the supplied
center and corner points.
|
void |
setFrameFromDiagonal(float x1,
float y1,
float x2,
float y2)
Sets the location and size of the framing rectangle of this shape based on the specified
diagonal line.
|
void |
setFrameFromDiagonal(XY p1,
XY p2)
Sets the location and size of the framing rectangle of this shape based on the supplied
diagonal line.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitheight, width, x, ycontains, contains, intersects, pathIteratorpublic abstract void setFrame(float x,
float y,
float width,
float height)
public void setFrame(XY loc, IDimension size)
public void setFrame(IRectangle r)
public void setFrameFromDiagonal(float x1,
float y1,
float x2,
float y2)
public void setFrameFromDiagonal(XY p1, XY p2)
public void setFrameFromCenter(float centerX,
float centerY,
float cornerX,
float cornerY)
public void setFrameFromCenter(XY center, XY corner)
public Point min()
IRectangularShapemin in interface IRectangularShapepublic float minX()
IRectangularShapeminX in interface IRectangularShapepublic float minY()
IRectangularShapeminY in interface IRectangularShapepublic Point max()
IRectangularShapemax in interface IRectangularShapepublic float maxX()
IRectangularShapemaxX in interface IRectangularShapepublic float maxY()
IRectangularShapemaxY in interface IRectangularShapepublic Point center()
IRectangularShapecenter in interface IRectangularShapepublic float centerX()
IRectangularShapecenterX in interface IRectangularShapepublic float centerY()
IRectangularShapecenterY in interface IRectangularShapepublic Rectangle frame()
IRectangularShapeframe in interface IRectangularShapepublic Rectangle frame(Rectangle target)
IRectangularShapeframe in interface IRectangularShapepublic boolean isEmpty()
IShapepublic boolean contains(XY point)
IShapepublic boolean contains(IRectangle rect)
IShapepublic boolean intersects(IRectangle rect)
IShapeintersects in interface IShapepublic Rectangle bounds()
IShapepublic Rectangle bounds(Rectangle target)
IShapepublic PathIterator pathIterator(Transform t, float flatness)
IShapepathIterator in interface IShapet - if supplied, the points in the path are transformed using this.flatness - when approximating curved segments with lines, this controls the maximum
distance the lines are allowed to deviate from the approximated curve, thus a higher
flatness value generally allows for a path with fewer segments.Copyright © 2017. All rights reserved.