public final class Rectangle extends Object implements Comparable
Class represents rectangle.
Constructor and Description |
---|
Rectangle(double llx,
double lly,
double urx,
double ury)
Constructor of Rectangle.
|
Modifier and Type | Method and Description |
---|---|
void |
_Intersect(Rectangle otherRect)
Deprecated.
|
Point |
center()
Returncs coordinates of center of the rectangle.
|
Object |
clone()
Clones the Rectangle object.
|
int |
compareTo(Object arg0) |
boolean |
contains(Point point)
Determinces whether given point is inside of the rectangle.
|
Object |
deepClone()
Clones the Rectangle object.
|
boolean |
equals(Object other)
Check if rectangles are equal i.e.
|
static Rectangle |
fromRect(android.graphics.Rect src) |
static Rectangle |
fromRect(Rectangle src) |
static Rectangle |
getEmpty()
Gets empty rectangle
|
double |
getHeight()
Height of rectangle.
|
double |
getLLX()
X-coordinate of lower - left corner.
|
double |
getLLY()
Y - coordinate of lower-left corner.
|
static Rectangle |
getTrivial()
Initializes trivial rectangle i.e.
|
double |
getURX()
X - coordinate of upper-right corner.
|
double |
getURY()
Y - coordinate of upper-right corner.
|
double |
getWidth()
Width of rectangle.
|
void |
intersect(Rectangle otherRect)
Intersects rectangles
|
boolean |
isEmpty()
Checks if rectangle is empty.
|
boolean |
isIntersect(Rectangle otherRect)
Determines whether this rectangle intersects with other rectangle.
|
boolean |
isPoint()
Checks if rectangle is point i.e.
|
boolean |
isTrivial()
Checks if rectangle is trivial i.e.
|
static Rectangle |
parse(String value)
Try to parse string and extract from it rectangle components llx, lly, urx, ury.
|
void |
rotate(int angle)
Rotate rectangle by the specified angle.
|
void |
setLLX(double value) |
void |
setLLY(double value) |
void |
setURX(double value) |
void |
setURY(double value) |
com.aspose.pdf.engine.data.PdfArray |
toArray(com.aspose.pdf.engine.data.ITrailerable trailerable) |
android.graphics.Rect |
toRect() |
String |
toString()
Gets rectangle string representation.
|
public static Rectangle Empty
public Rectangle(double llx, double lly, double urx, double ury)
Constructor of Rectangle.
llx
- X of lower left corner.lly
- Y of lower left corner.urx
- X of upper right corner.ury
- Y of upper right corner.public double getWidth()
Width of rectangle.
public double getHeight()
Height of rectangle.
public double getLLX()
X-coordinate of lower - left corner.
public void setLLX(double value)
public double getLLY()
Y - coordinate of lower-left corner.
public void setLLY(double value)
public double getURX()
X - coordinate of upper-right corner.
public void setURX(double value)
public double getURY()
Y - coordinate of upper-right corner.
public void setURY(double value)
public android.graphics.Rect toRect()
public static Rectangle fromRect(android.graphics.Rect src)
public com.aspose.pdf.engine.data.PdfArray toArray(com.aspose.pdf.engine.data.ITrailerable trailerable)
public String toString()
Gets rectangle string representation.
public static Rectangle parse(String value)
Try to parse string and extract from it rectangle components llx, lly, urx, ury.
value
- String to parse.public static Rectangle getTrivial()
Initializes trivial rectangle i.e. rectangle with zero position and size.
public boolean isTrivial()
Checks if rectangle is trivial i.e. has zero size and position.
public boolean isEmpty()
public boolean isPoint()
public boolean equals(Object other)
Check if rectangles are equal i.e. hase same position and sizes.
public void intersect(Rectangle otherRect)
otherRect
- public void rotate(int angle)
Rotate rectangle by the specified angle.
angle
- Angle of rotation. Member of Rotation enumeration.public int compareTo(Object arg0)
compareTo
in interface Comparable
public Object deepClone()
Clones the Rectangle object.
public static Rectangle getEmpty()
Gets empty rectangle
public boolean isIntersect(Rectangle otherRect)
Determines whether this rectangle intersects with other rectangle.
otherRect
- Intersection will be tested with specified rectangle.@Deprecated public void _Intersect(Rectangle otherRect)
Intersects rectangles. Obsolete method. Please use Intersect instead.
otherRect
- Rectangle objectpublic boolean contains(Point point)
Determinces whether given point is inside of the rectangle.
point
- Point to check.public Point center()
Returncs coordinates of center of the rectangle.
Copyright © 2020 Aspose. All Rights Reserved.