|
JGraph X 1.4.1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mxgraph.util.mxPoint
com.mxgraph.util.mxRectangle
public class mxRectangle
Implements a 2-dimensional rectangle with double precision coordinates.
| Field Summary | |
|---|---|
protected double |
height
Holds the width and the height. |
protected double |
width
Holds the width and the height. |
| Fields inherited from class com.mxgraph.util.mxPoint |
|---|
x, y |
| Constructor Summary | |
|---|---|
mxRectangle()
Constructs a new rectangle at (0, 0) with the width and height set to 0. |
|
mxRectangle(double x,
double y,
double width,
double height)
Constructs a rectangle using the given parameters. |
|
mxRectangle(mxRectangle rect)
Constructs a copy of the given rectangle. |
|
mxRectangle(Rectangle2D rect)
Constructs a copy of the given rectangle. |
|
| Method Summary | |
|---|---|
void |
add(mxRectangle rect)
Adds the given rectangle to this rectangle. |
Object |
clone()
Returns a new instance of the same rectangle. |
boolean |
contains(double x,
double y)
Returns true if the given point is contained in the rectangle. |
boolean |
equals(Object obj)
Returns true if the given object equals this rectangle. |
double |
getCenterX()
Returns the x-coordinate of the center. |
double |
getCenterY()
Returns the y-coordinate of the center. |
double |
getHeight()
Returns the height of the rectangle. |
Rectangle |
getRectangle()
Returns the bounds as a new rectangle. |
double |
getWidth()
Returns the width of the rectangle. |
void |
grow(double amount)
Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height. |
mxPoint |
intersectLine(double x0,
double y0,
double x1,
double y1)
Returns the point at which the specified point intersects the perimeter of this rectangle or null if there is no intersection. |
void |
setHeight(double value)
Sets the height of the rectangle. |
void |
setWidth(double value)
Sets the width of the rectangle. |
| Methods inherited from class com.mxgraph.util.mxPoint |
|---|
getPoint, getX, getY, setX, setY, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double width
protected double height
| Constructor Detail |
|---|
public mxRectangle()
public mxRectangle(Rectangle2D rect)
rect - Rectangle to construct a copy of.public mxRectangle(mxRectangle rect)
rect - Rectangle to construct a copy of.
public mxRectangle(double x,
double y,
double width,
double height)
x - X-coordinate of the new rectangle.y - Y-coordinate of the new rectangle.width - Width of the new rectangle.height - Height of the new rectangle.| Method Detail |
|---|
public double getWidth()
public void setWidth(double value)
value - Double that specifies the new width.public double getHeight()
public void setHeight(double value)
value - Double that specifies the new height.public void add(mxRectangle rect)
public double getCenterX()
public double getCenterY()
public void grow(double amount)
amount - Amount by which the rectangle should be grown.
public boolean contains(double x,
double y)
x - X-coordinate of the point.y - Y-coordinate of the point.
public mxPoint intersectLine(double x0,
double y0,
double x1,
double y1)
x0 - the x co-ordinate of the first point of the liney0 - the y co-ordinate of the first point of the linex1 - the x co-ordinate of the second point of the liney1 - the y co-ordinate of the second point of the line
public Rectangle getRectangle()
public boolean equals(Object obj)
equals in class mxPointpublic Object clone()
clone in class mxPoint
|
JGraph X 1.4.1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||