public abstract class AbstractRectangle extends RectangularShape implements IRectangle
IRectangle, obtaining only the location and
dimensions from the derived class.OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP| Constructor and Description |
|---|
AbstractRectangle() |
| Modifier and Type | Method and Description |
|---|---|
Rectangle |
clone()
Returns a mutable copy of this rectangle.
|
boolean |
contains(float px,
float py)
Returns true if this shape contains the specified point.
|
boolean |
contains(float rx,
float ry,
float rw,
float rh)
Returns true if this shape completely contains the specified rectangle.
|
boolean |
equals(Object obj) |
int |
hashCode() |
Rectangle |
intersection(float rx,
float ry,
float rw,
float rh)
Returns the intersection of the specified rectangle and this rectangle (i.e.
|
Rectangle |
intersection(IRectangle r)
Returns the intersection of the supplied rectangle and this rectangle (i.e.
|
boolean |
intersects(float rx,
float ry,
float rw,
float rh)
Returns true if this shape intersects the specified rectangle.
|
boolean |
intersectsLine(float x1,
float y1,
float x2,
float y2)
Returns true if the specified line segment intersects this rectangle.
|
boolean |
intersectsLine(ILine l)
Returns true if the supplied line segment intersects this rectangle.
|
Point |
location()
Returns a copy of this rectangle's upper-left corner.
|
Point |
location(Point target)
Initializes the supplied point with this rectangle's upper-left corner.
|
int |
outcode(float px,
float py)
Returns a set of flags indicating where the specified point lies in relation to the bounds
of this rectangle.
|
int |
outcode(XY p)
Returns a set of flags indicating where the supplied point lies in relation to the bounds of
this rectangle.
|
PathIterator |
pathIterator(Transform t)
Returns an iterator over the path described by this shape.
|
PathIterator |
pathIterator(Transform t,
float flatness)
Returns an iterator over the path described by this shape.
|
Dimension |
size()
Returns a copy of this rectangle's size.
|
Dimension |
size(Dimension target)
Initializes the supplied dimension with this rectangle's size.
|
String |
toString() |
Rectangle |
union(IRectangle r)
Returns the union of the supplied rectangle and this rectangle (i.e.
|
bounds, bounds, center, centerX, centerY, contains, contains, frame, frame, intersects, isEmpty, max, maxX, maxY, min, minX, minY, setFrame, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalpublic Point location()
IRectanglelocation in interface IRectanglepublic Point location(Point target)
IRectanglelocation in interface IRectanglepublic Dimension size()
IRectanglesize in interface IRectanglepublic Dimension size(Dimension target)
IRectanglesize in interface IRectanglepublic Rectangle intersection(float rx, float ry, float rw, float rh)
IRectangleintersection in interface IRectanglepublic Rectangle intersection(IRectangle r)
IRectangleintersection in interface IRectanglepublic Rectangle union(IRectangle r)
IRectangleunion in interface IRectanglepublic boolean intersectsLine(float x1,
float y1,
float x2,
float y2)
IRectangleintersectsLine in interface IRectanglepublic boolean intersectsLine(ILine l)
IRectangleintersectsLine in interface IRectanglepublic int outcode(float px,
float py)
IRectangleIRectangle.OUT_LEFT, etc.outcode in interface IRectanglepublic int outcode(XY p)
IRectangleIRectangle.OUT_LEFT, etc.outcode in interface IRectanglepublic Rectangle clone()
IRectangleclone in interface IRectangleclone in class Objectpublic boolean contains(float px,
float py)
IShapepublic boolean contains(float rx,
float ry,
float rw,
float rh)
IShapepublic boolean intersects(float rx,
float ry,
float rw,
float rh)
IShapeintersects in interface IShapepublic PathIterator pathIterator(Transform t)
IShapepathIterator in interface IShapet - if supplied, the points in the path are transformed using this.public PathIterator pathIterator(Transform t, float flatness)
IShapepathIterator in interface IShapepathIterator in class RectangularShapet - 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.