public class Quadrangle
extends java.lang.Object
Stores a set of four Points that represent a Quadrangle region.
| Modifier and Type | Field and Description |
|---|---|
static Quadrangle |
EMPTY
Represents a
Quadrangle class with its properties left uninitialized. |
| Constructor and Description |
|---|
Quadrangle() |
Quadrangle(java.awt.Point leftTop,
java.awt.Point rightTop,
java.awt.Point rightBottom,
java.awt.Point leftBottom)
Initializes a new instance of the
Quadrangle class with the describing points. |
| Modifier and Type | Method and Description |
|---|---|
Quadrangle |
clone() |
boolean |
contains(int x,
int y)
Determines if the specified point is contained within this
Quadrangle class. |
boolean |
contains(java.awt.Point pt)
Determines if the specified
Point is contained within this Quadrangle class. |
boolean |
contains(Quadrangle quad)
Determines if the specified
Quadrangle is contained or intersect this Quadrangle class. |
boolean |
contains(java.awt.Rectangle rect)
Determines if the specified
Rectangle is contained or intersect this Quadrangle class. |
boolean |
equals(java.lang.Object obj)
Returns a value indicating whether this instance is equal to a specified
Quadrangle value. |
java.awt.Rectangle |
getBoundingRectangle()
Creates
Rectangle bounding this Quadrangle |
java.awt.Point |
getLeftBottom()
Gets left-bottom corner
Point of Quadrangle region |
java.awt.Point |
getLeftTop()
Gets left-top corner
Point of Quadrangle region |
java.awt.Point |
getRightBottom()
Gets right-bottom corner
Point of Quadrangle region |
java.awt.Point |
getRightTop()
Gets right-top corner
Point of Quadrangle region |
int |
hashCode()
Returns the hash code for this instance.
|
boolean |
isEmpty()
Tests whether all
Points of this Quadrangle have values of zero. |
void |
setLeftBottom(java.awt.Point value)
Gets left-bottom corner
Point of Quadrangle region |
void |
setLeftTop(java.awt.Point value)
Gets left-top corner
Point of Quadrangle region |
void |
setRightBottom(java.awt.Point value)
Gets right-bottom corner
Point of Quadrangle region |
void |
setRightTop(java.awt.Point value)
Gets right-top corner
Point of Quadrangle region |
java.lang.String |
toString()
Returns a human-readable string representation of this
Quadrangle. |
public static final Quadrangle EMPTY
Represents a Quadrangle class with its properties left uninitialized.
Quadranglepublic Quadrangle()
public Quadrangle(java.awt.Point leftTop,
java.awt.Point rightTop,
java.awt.Point rightBottom,
java.awt.Point leftBottom)
Initializes a new instance of the Quadrangle class with the describing points.
leftTop - A Point that represents the left-top corner of the Quadrangle.rightTop - A Point that represents the right-top corner of the Quadrangle.rightBottom - A Point that represents the right-bottom corner of the Quadrangle.leftBottom - A Point that represents the left-bottom corner of the Quadrangle.public java.awt.Point getLeftTop()
Gets left-top corner Point of Quadrangle region
Point of Quadrangle regionpublic void setLeftTop(java.awt.Point value)
Gets left-top corner Point of Quadrangle region
Point of Quadrangle regionpublic java.awt.Point getRightTop()
Gets right-top corner Point of Quadrangle region
Point of Quadrangle regionpublic void setRightTop(java.awt.Point value)
Gets right-top corner Point of Quadrangle region
Point of Quadrangle regionpublic java.awt.Point getRightBottom()
Gets right-bottom corner Point of Quadrangle region
Point of Quadrangle regionpublic void setRightBottom(java.awt.Point value)
Gets right-bottom corner Point of Quadrangle region
Point of Quadrangle regionpublic java.awt.Point getLeftBottom()
Gets left-bottom corner Point of Quadrangle region
Point of Quadrangle regionpublic void setLeftBottom(java.awt.Point value)
Gets left-bottom corner Point of Quadrangle region
Point of Quadrangle regionpublic boolean isEmpty()
Tests whether all Points of this Quadrangle have values of zero.
<b>true</b> if all Points of this Quadrangle have values of zero; otherwise, <b>false</b>.public boolean contains(java.awt.Point pt)
Determines if the specified Point is contained within this Quadrangle class.
pt - The Point to test.<b>true</b> if Point is contained within this Quadrangle class; otherwise, <b>false</b>.public boolean contains(int x,
int y)
Determines if the specified point is contained within this Quadrangle class.
x - The x point cordinate.y - The y point cordinate.<b>true</b> if point is contained within this Quadrangle class; otherwise, <b>false</b>.public boolean contains(Quadrangle quad)
Determines if the specified Quadrangle is contained or intersect this Quadrangle class.
quad - The Quadrangle to test.<b>true</b> if Quadrangle is contained or intersect this Quadrangle class; otherwise, <b>false</b>.public boolean contains(java.awt.Rectangle rect)
Determines if the specified Rectangle is contained or intersect this Quadrangle class.
rect - The Rectangle to test.<b>true</b> if Rectangle is contained or intersect this Quadrangle class; otherwise, <b>false</b>.public boolean equals(java.lang.Object obj)
Returns a value indicating whether this instance is equal to a specified Quadrangle value.
equals in class java.lang.Objectobj - An Quadrangle value to compare to this instance.<b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.public int hashCode()
Returns the hash code for this instance.
hashCode in class java.lang.Objectpublic java.lang.String toString()
Returns a human-readable string representation of this Quadrangle.
toString in class java.lang.ObjectQuadrangle.public java.awt.Rectangle getBoundingRectangle()
Creates Rectangle bounding this Quadrangle
Rectangle bounding this Quadranglepublic Quadrangle clone()
clone in class java.lang.Object