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, wait
height, width, x, y
contains, contains, intersects, pathIterator
public 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()
IRectangularShape
min
in interface IRectangularShape
public float minX()
IRectangularShape
minX
in interface IRectangularShape
public float minY()
IRectangularShape
minY
in interface IRectangularShape
public Point max()
IRectangularShape
max
in interface IRectangularShape
public float maxX()
IRectangularShape
maxX
in interface IRectangularShape
public float maxY()
IRectangularShape
maxY
in interface IRectangularShape
public Point center()
IRectangularShape
center
in interface IRectangularShape
public float centerX()
IRectangularShape
centerX
in interface IRectangularShape
public float centerY()
IRectangularShape
centerY
in interface IRectangularShape
public Rectangle frame()
IRectangularShape
frame
in interface IRectangularShape
public Rectangle frame(Rectangle target)
IRectangularShape
frame
in interface IRectangularShape
public boolean isEmpty()
IShape
public boolean contains(XY point)
IShape
public boolean contains(IRectangle rect)
IShape
public boolean intersects(IRectangle rect)
IShape
intersects
in interface IShape
public Rectangle bounds()
IShape
public Rectangle bounds(Rectangle target)
IShape
public PathIterator pathIterator(Transform t, float flatness)
IShape
pathIterator
in interface IShape
t
- 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.