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(double px,
double py)
Returns true if this shape contains the specified point.
|
boolean |
contains(double rx,
double ry,
double rw,
double rh)
Returns true if this shape completely contains the specified rectangle.
|
boolean |
equals(Object obj) |
int |
hashCode() |
Rectangle |
intersection(double rx,
double ry,
double rw,
double 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(double rx,
double ry,
double rw,
double rh)
Returns true if this shape intersects the specified rectangle.
|
boolean |
intersectsLine(double x1,
double y1,
double x2,
double 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(double px,
double 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,
double 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, setFrameFromDiagonal
public Point location()
IRectangle
location
in interface IRectangle
public Point location(Point target)
IRectangle
location
in interface IRectangle
public Dimension size()
IRectangle
size
in interface IRectangle
public Dimension size(Dimension target)
IRectangle
size
in interface IRectangle
public Rectangle intersection(double rx, double ry, double rw, double rh)
IRectangle
intersection
in interface IRectangle
public Rectangle intersection(IRectangle r)
IRectangle
intersection
in interface IRectangle
public Rectangle union(IRectangle r)
IRectangle
union
in interface IRectangle
public boolean intersectsLine(double x1, double y1, double x2, double y2)
IRectangle
intersectsLine
in interface IRectangle
public boolean intersectsLine(ILine l)
IRectangle
intersectsLine
in interface IRectangle
public int outcode(double px, double py)
IRectangle
IRectangle.OUT_LEFT
, etc.outcode
in interface IRectangle
public int outcode(XY p)
IRectangle
IRectangle.OUT_LEFT
, etc.outcode
in interface IRectangle
public Rectangle clone()
IRectangle
clone
in interface IRectangle
clone
in class Object
public boolean contains(double px, double py)
IShape
public boolean contains(double rx, double ry, double rw, double rh)
IShape
public boolean intersects(double rx, double ry, double rw, double rh)
IShape
intersects
in interface IShape
public PathIterator pathIterator(Transform t)
IShape
pathIterator
in interface IShape
t
- if supplied, the points in the path are transformed using this.public PathIterator pathIterator(Transform t, double flatness)
IShape
pathIterator
in interface IShape
pathIterator
in class RectangularShape
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.