|
ReportMill 7.0 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.reportmill.foundation.RMObject
com.reportmill.foundation.RMRect
This class represents a simple rectangular geometric area (x, y, width and height).
| Field Summary | |
float |
height
|
static byte |
maxXEdge
|
static byte |
maxYEdge
|
static byte |
minXEdge
|
static byte |
minYEdge
|
static RMRect |
unitRect
|
float |
width
|
float |
x
|
float |
y
|
static RMRect |
zeroRect
|
| 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(float x,
float y,
float w,
float h)
Creates a rect with the given x, y, width and height (floats). |
|
RMRect(RMPoint[] p)
Creates a rect enclosing the given array of points. |
|
RMRect(RMPoint p1,
RMPoint p2)
Creates a rect enclosing the two given points. |
|
RMRect(RMPoint or,
RMSize sz)
Creates a rect from the given location and size. |
|
RMRect(RMRect aRect)
Creates a rect from a given rect. |
|
RMRect(java.lang.String s)
Creates a rect from a string of the form "x y w h". |
|
| Method Summary | |
java.awt.Rectangle |
awt()
Returns an AWT Rectangle representation of this rect. |
boolean |
containsRect(RMRect aRect)
Returns whether the receiver contains the given rect. |
RMRect |
divideRect(float amount,
byte edge)
Slices rect by given amount (from given edge) - returns remainder. |
RMRect |
divideRect(float amount,
byte edge,
RMRect remainder)
Slices rect by given amount (from given edge) - returns remainder. |
boolean |
equals(java.lang.Object anObj)
Standard equals implementation. |
static RMRect |
fromXMLString(java.lang.String aString)
Creates a rect from an String in XML format as defined in toXMLString(). |
RMPoint |
getOrigin()
Returns the origin of the rect as an RMPoint. |
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. |
void |
integral()
Rounds the receiver to integer values. |
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. |
boolean |
isEmpty()
Returns whether the rect has no area (width or height is zero). |
float |
maxX()
Returns the max x of the rect. |
float |
maxY()
Returns the max y of the rect. |
float |
midX()
Returns the x mid-point of the rect. |
float |
midY()
Returns the y mid-point of the rect. |
RMRect |
offset(float dx,
float 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 amount)
Scales the receiver rect by the given amount. |
RMRect |
scaledRect(float amount)
Creates a rect derived from the receiver scaled by the given amount. |
RMRect |
set(float x,
float y,
float w,
float h)
Sets the x, y, width and height of the rect. |
RMRect |
setOrigin(float x,
float y)
Sets the origin of the rect. |
RMRect |
setOrigin(RMPoint origin)
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. |
RMRect |
trimRect(float amount,
byte edge)
Slices rect by given amount (from given edge) - 'divide' versions return remainder. |
RMRect |
union(RMRect r2)
Unions the receiver rect with the given rect. |
RMRect |
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. |
RMRect |
unionRectEvenIfEmpty(RMRect r2)
Creates a rect encompasing the receiver and the given rect. |
boolean |
widthsIntersect(RMRect r2)
Returns whether the receiver intersects with the given rect (horizontally only). |
static RMRect |
zeroRect()
|
| Methods inherited from class com.reportmill.foundation.RMObject |
archiverClassName, clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public float x
public float y
public float width
public float height
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(RMRect aRect)
public RMRect(float x,
float y,
float w,
float h)
public RMRect(double x,
double y,
double w,
double h)
public RMRect(RMPoint or,
RMSize sz)
public RMRect(RMPoint p1,
RMPoint p2)
public RMRect(java.lang.String s)
throws java.io.IOException
public RMRect(RMPoint[] p)
| Method Detail |
public static final RMRect zeroRect()
public RMRect set(float x,
float y,
float w,
float h)
public RMRect setOrigin(RMPoint origin)
public RMRect setOrigin(float x,
float y)
public float maxX()
public float maxY()
public float midX()
public float midY()
public RMPoint getOrigin()
public RMSize size()
public boolean isEmpty()
public RMRect intersectedRect(RMRect r2)
public RMRect union(RMRect r2)
public RMRect unionRect(RMRect r2)
public RMRect unionRectEvenIfEmpty(RMRect r2)
public RMRect unionEvenIfEmpty(RMRect r2)
public boolean intersectsRect(RMRect aRect)
public boolean intersectsRectEvenIfEmpty(RMRect aRect)
public boolean widthsIntersect(RMRect r2)
public RMRect offset(float dx,
float dy)
public RMRect offsetRect(float dx,
float dy)
public void integral()
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 RMRect trimRect(float amount,
byte edge)
public RMRect divideRect(float amount,
byte edge)
public RMRect divideRect(float amount,
byte edge,
RMRect remainder)
public RMRect scale(float amount)
public RMRect scaledRect(float amount)
public boolean equals(java.lang.Object anObj)
public java.lang.String toString()
public java.awt.Rectangle awt()
public java.lang.String toXMLString()
public static RMRect fromXMLString(java.lang.String aString)
|
ReportMill 7.0 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||