mxGraph
|
Implements a 2-dimensional rectangle with double precision coordinates. More...
Public Member Functions | |
mxRectangle () | |
Constructs a new rectangle at (0, 0) with the width and height set to 0. | |
mxRectangle (mxRectangle rect) | |
Constructs a copy of the given rectangle. | |
mxRectangle (Rectangle rect) | |
Constructs a copy of the given rectangle. | |
mxRectangle (double x, double y, double width, double height) | |
Constructs a rectangle using the given parameters. | |
void | setRect (double x, double y, double w, double h) |
Sets this rectangle to the specified values. | |
double | GetCenterX () |
Returns the x-coordinate of the center. | |
double | GetCenterY () |
Returns the y-coordinate of the center. | |
void | Add (mxRectangle rect) |
Adds the given rectangle to this 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. | |
bool | Contains (double x, double y) |
Returns true if this rectangle contains the given point (x, y). | |
Rectangle | GetRectangle () |
Returns the bounds as a new rectangle. | |
new Boolean | Equals (Object obj) |
Returns true if the given object equals this rectangle. | |
new mxRectangle | Clone () |
Returns a new instance of the same rectangle. | |
Protected Attributes | |
double | width |
Holds the width. Default is 0. | |
double | height |
Holds the height. Default is 0. | |
Properties | |
double | Width [get, set] |
Sets or returns the width of the rectangle. | |
double | Height [get, set] |
Sets or returns the height of the rectangle. |
Implements a 2-dimensional rectangle with double precision coordinates.
com.mxgraph.mxRectangle.mxRectangle | ( | ) | [inline] |
Constructs a new rectangle at (0, 0) with the width and height set to 0.
com.mxgraph.mxRectangle.mxRectangle | ( | mxRectangle | rect | ) | [inline] |
Constructs a copy of the given rectangle.
rect | Rectangle to construct a copy of. |
com.mxgraph.mxRectangle.mxRectangle | ( | Rectangle | rect | ) | [inline] |
Constructs a copy of the given rectangle.
rect | Rectangle to construct a copy of. |
com.mxgraph.mxRectangle.mxRectangle | ( | double | x, |
double | y, | ||
double | width, | ||
double | height | ||
) | [inline] |
Constructs a rectangle using the given parameters.
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. |
void com.mxgraph.mxRectangle.Add | ( | mxRectangle | rect | ) | [inline] |
Adds the given rectangle to this rectangle.
new mxRectangle com.mxgraph.mxRectangle.Clone | ( | ) | [inline] |
Returns a new instance of the same rectangle.
Reimplemented from com.mxgraph.mxPoint.
Reimplemented in com.mxgraph.mxCellState, and com.mxgraph.mxGeometry.
bool com.mxgraph.mxRectangle.Contains | ( | double | x, |
double | y | ||
) | [inline] |
Returns true if this rectangle contains the given point (x, y).
x | X-coordinate of the point. |
y | Y-coordinate of the point. |
new Boolean com.mxgraph.mxRectangle.Equals | ( | Object | obj | ) | [inline] |
Returns true if the given object equals this rectangle.
Reimplemented from com.mxgraph.mxPoint.
double com.mxgraph.mxRectangle.GetCenterX | ( | ) | [inline] |
Returns the x-coordinate of the center.
double com.mxgraph.mxRectangle.GetCenterY | ( | ) | [inline] |
Returns the y-coordinate of the center.
Rectangle com.mxgraph.mxRectangle.GetRectangle | ( | ) | [inline] |
Returns the bounds as a new rectangle.
void com.mxgraph.mxRectangle.Grow | ( | double | amount | ) | [inline] |
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.
amount | Amount by which the rectangle should be grown. |
void com.mxgraph.mxRectangle.setRect | ( | double | x, |
double | y, | ||
double | w, | ||
double | h | ||
) | [inline] |
Sets this rectangle to the specified values.
double com.mxgraph.mxRectangle.height [protected] |
Holds the height. Default is 0.
double com.mxgraph.mxRectangle.width [protected] |
Holds the width. Default is 0.
double com.mxgraph.mxRectangle.Height [get, set] |
Sets or returns the height of the rectangle.
double com.mxgraph.mxRectangle.Width [get, set] |
Sets or returns the width of the rectangle.