Package com.iizix.prop
Class GRect
java.lang.Object
com.iizix.prop.GRect
- All Implemented Interfaces:
- Serializable,- Cloneable
Simple immutable rectangle class for multiple use accepting negative width and height.
- Author:
- Christopher Mindus
- See Also:
- Field SummaryFields
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- void- append- (SendTransaction trans) Appends the rectangle to a transaction.- clone()Clones this instance.- booleanChecks if two rectangles are equal.- int- getCX()Gets the width.- int- getCY()Gets the height.- intGets the height.- int- getWidth()Gets the width.- int- getX()Gets the X position.- int- getY()Gets the Y position.- int- hashCode()Hash code.- booleanChecks if a position is inside.- toString()Formats to a string as "x,y,cx,cy".
- Field Details- EMPTY_ARRAYEmpty array of Rect's.
- ZEROZero rectangle.
 
- Constructor Details- GRectpublic GRect()Constructor for x=y=cx=cy=0.
- GRectConstructor from a String formatted as "x,y,cx,cy".- Parameters:
- string- The string.
- Throws:
- IllegalArgumentException- If the string is not well formatted.
 
- GRectConstructor from a Transaction.- Parameters:
- trans- The transaction.
 
- GRectpublic GRect- (int x, int y, int cx, int cy) Constructor.- Parameters:
- x- X position.
- y- Y position.
- cx- Width.
- cy- Height.
 
 
- Method Details- isInsideChecks if a position is inside.- Parameters:
- p- The position.
- Returns:
- true if inside, false otherwise.
 
- equalsChecks if two rectangles are equal. Supports comparison with- Rect.
- cloneClones this instance.
- hashCodepublic int hashCode()Hash code.
- toStringFormats to a string as "x,y,cx,cy".
- appendAppends the rectangle to a transaction.- Parameters:
- trans- Transaction to append to.
 
- getXpublic int getX()Gets the X position.- Returns:
- The X position.
 
- getYpublic int getY()Gets the Y position.- Returns:
- The Y position.
 
- getCXpublic int getCX()Gets the width.- Returns:
- The width.
 
- getCYpublic int getCY()Gets the height.- Returns:
- The height.
 
- getWidthpublic int getWidth()Gets the width.- Returns:
- The width.
 
- getHeightpublic int getHeight()Gets the height.- Returns:
- The height.