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, 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(float rx, float ry, float rw, float 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(float x1, float y1, float x2, float y2)
IRectangle
intersectsLine
in interface IRectangle
public boolean intersectsLine(ILine l)
IRectangle
intersectsLine
in interface IRectangle
public int outcode(float px, float 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(float px, float py)
IShape
public boolean contains(float rx, float ry, float rw, float rh)
IShape
public boolean intersects(float rx, float ry, float rw, float 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, float 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.