|
ReportMill 11 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Float
com.reportmill.base.RMRect
public class RMRect
This class extends Rectanlge2D to add some convenient rect methods.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D |
---|
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float |
Field Summary | |
---|---|
static byte |
MaxXEdge
|
static byte |
MaxYEdge
|
static byte |
MinXEdge
|
static byte |
MinYEdge
|
static RMRect |
unitRect
|
static RMRect |
zeroRect
|
Fields inherited from class java.awt.geom.Rectangle2D.Float |
---|
height, width, x, y |
Fields inherited from class java.awt.geom.Rectangle2D |
---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
Constructor Summary | |
---|---|
RMRect()
Creates an empty rect. |
|
RMRect(double x,
double y,
double w,
double h)
Creates a rect with the given x, y, width and height (doubles). |
|
RMRect(java.awt.geom.Point2D... points)
Creates a rect enclosing the given array of points. |
|
RMRect(java.awt.geom.Rectangle2D aRect)
Creates a rect from an awt rect. |
Method Summary | |
---|---|
boolean |
containsRect(RMRect aRect)
Returns whether the receiver contains the given rect. |
RMRect |
divideRect(float anAmount,
byte anEdge)
Slices rect by given amount (from given edge) - returns remainder. |
RMRect |
divideRect(float anAmount,
byte anEdge,
RMRect aRemainder)
Slices rect by given amount (from given edge) - returns remainder. |
static RMRect |
fromXMLString(java.lang.String aString)
Creates a rect from an String in XML format as defined in toXMLString(). |
int |
getHitEdges(java.awt.geom.Point2D aPoint,
float aRadius)
Returns the mask of edges hit by the given point. |
float |
getMidX()
Returns the x mid-point of the rect. |
float |
getMidY()
Returns the y mid-point of the rect. |
RMPoint |
getOrigin()
Returns the origin of the rect as an RMPoint. |
RMPoint |
getPerimeterPointForRadial(float anAngle,
boolean doEllipse)
Returns the point on the rectangle's perimeter that is intersected by a radial at the given angle from the center of the rect. |
RMPoint[] |
getPoints()
Returns an array of four points containing each corner of the rect. |
RMRect |
inset(float inset)
Insets the receiver rect by the given amount. |
RMRect |
inset(float xInset,
float yInset)
Insets the receiver rect by the given amount. |
RMRect |
insetRect(float anInset)
Creates a rect derived from the receiver inset by the given amount. |
RMRect |
insetRect(float xInset,
float yInset)
Creates a rect derived from the receiver inset by the given amount. |
RMRect |
intersectedRect(RMRect r2)
Returns the rect formed by the area overlapping with the given rect. |
boolean |
intersectsRect(RMRect aRect)
Returns whether the receiver intersects with the given rect. |
boolean |
intersectsRectEvenIfEmpty(RMRect aRect)
Returns whether the receiver intersects with the given rect. |
float |
maxX()
Returns the max x of the rect. |
float |
maxY()
Returns the max y of the rect. |
RMRect |
offset(double dx,
double dy)
Offsets the receiver by the given x & y. |
RMRect |
offsetRect(float dx,
float dy)
Creates a rect derived by offsetting the receiver by the given x & y. |
RMRect |
scale(float anAmount)
Scales the receiver rect by the given amount. |
RMRect |
scaledRect(float anAmount)
Creates a rect derived from the receiver scaled by the given amount. |
void |
setHitEdges(java.awt.geom.Point2D aPoint,
int anEdgeMask)
Resets the edges of a rect, given a mask of edges and a new point. |
RMRect |
setOrigin(float x,
float y)
Sets the origin of the rect. |
RMSize |
size()
Returns the size of the rect as an RMSize. |
RMRect |
squareRectInRect()
Creates a rect representing the largest square inside rect. |
java.lang.String |
toString()
Returns a String reprsentation of this rect. |
java.lang.String |
toXMLString()
Returns an XML string representation of this rect. |
void |
union(RMRect r2)
Unions the receiver rect with the given rect. |
void |
unionEvenIfEmpty(RMRect r2)
Unions the receiver rect with the given rect. |
RMRect |
unionRect(RMRect r2)
Creates a rect encompassing the receiver and the given rect. |
boolean |
widthsIntersect(RMRect r2)
Returns whether the receiver intersects with the given rect (horizontally only). |
Methods inherited from class java.awt.geom.Rectangle2D.Float |
---|
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect, setRect |
Methods inherited from class java.awt.geom.Rectangle2D |
---|
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union |
Methods inherited from class java.awt.geom.RectangularShape |
---|
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final RMRect zeroRect
public static final RMRect unitRect
public static final byte MinXEdge
public static final byte MinYEdge
public static final byte MaxXEdge
public static final byte MaxYEdge
Constructor Detail |
---|
public RMRect()
public RMRect(double x, double y, double w, double h)
public RMRect(java.awt.geom.Point2D... points)
public RMRect(java.awt.geom.Rectangle2D aRect)
Method Detail |
---|
public RMPoint getOrigin()
public RMRect setOrigin(float x, float y)
public RMSize size()
public float maxX()
public float maxY()
public float getMidX()
public float getMidY()
public void union(RMRect r2)
public RMRect unionRect(RMRect r2)
public void unionEvenIfEmpty(RMRect r2)
public boolean intersectsRect(RMRect aRect)
public boolean intersectsRectEvenIfEmpty(RMRect aRect)
public RMRect intersectedRect(RMRect r2)
public boolean widthsIntersect(RMRect r2)
public RMRect offset(double dx, double dy)
public RMRect offsetRect(float dx, float dy)
public RMRect squareRectInRect()
public boolean containsRect(RMRect aRect)
public RMPoint[] getPoints()
public RMRect inset(float inset)
public RMRect inset(float xInset, float yInset)
public RMRect insetRect(float anInset)
public RMRect insetRect(float xInset, float yInset)
public int getHitEdges(java.awt.geom.Point2D aPoint, float aRadius)
public void setHitEdges(java.awt.geom.Point2D aPoint, int anEdgeMask)
public RMRect divideRect(float anAmount, byte anEdge)
public RMRect divideRect(float anAmount, byte anEdge, RMRect aRemainder)
public RMRect scale(float anAmount)
public RMRect scaledRect(float anAmount)
public RMPoint getPerimeterPointForRadial(float anAngle, boolean doEllipse)
anAngle
- Angle in degrees.doEllipse
- Whether to scale radials into ellipse or leave them normal.
public java.lang.String toString()
toString
in class java.awt.geom.Rectangle2D.Float
public java.lang.String toXMLString()
public static RMRect fromXMLString(java.lang.String aString)
|
ReportMill 11 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |