mxGraph
Public Member Functions | Protected Attributes | Properties | List of all members
com.mxgraph.mxRectangle Class Reference

Implements a 2-dimensional rectangle with double precision coordinates. More...

Inheritance diagram for com.mxgraph.mxRectangle:
com.mxgraph.mxPoint com.mxgraph.mxCellState com.mxgraph.mxGeometry

Public Member Functions

 mxRectangle ()
 Constructs a new rectangle at (0, 0) with the width and height set to 0. More...
 
 mxRectangle (mxRectangle rect)
 Constructs a copy of the given rectangle. More...
 
 mxRectangle (Rectangle rect)
 Constructs a copy of the given rectangle. More...
 
 mxRectangle (double x, double y, double width, double height)
 Constructs a rectangle using the given parameters. More...
 
void setRect (double x, double y, double w, double h)
 Sets this rectangle to the specified values More...
 
double GetCenterX ()
 Returns the x-coordinate of the center. More...
 
double GetCenterY ()
 Returns the y-coordinate of the center. More...
 
void Add (mxRectangle rect)
 Adds the given rectangle to this rectangle. More...
 
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. More...
 
bool Contains (double x, double y)
 Returns true if this rectangle contains the given point (x, y). More...
 
Rectangle GetRectangle ()
 Returns the bounds as a new rectangle. More...
 
new Boolean Equals (Object obj)
 Returns true if the given object equals this rectangle. More...
 
new mxRectangle Clone ()
 Returns a new instance of the same rectangle. More...
 
- Public Member Functions inherited from com.mxgraph.mxPoint
 mxPoint ()
 Constructs a new point at (0, 0). More...
 
 mxPoint (Point point)
 Constructs a new point at the location of the given point. More...
 
 mxPoint (mxPoint point)
 Constructs a new point at the location of the given point. More...
 
 mxPoint (double x, double y)
 Constructs a new point at (x, y). More...
 
Point GetPoint ()
 Returns the coordinates as a new point. More...
 
new Boolean Equals (Object obj)
 Returns true if the given object equals this point. More...
 
mxPoint Clone ()
 Returns a new instance of the same point. More...
 

Protected Attributes

double width
 Holds the width. Default is 0. More...
 
double height
 Holds the height. Default is 0. More...
 
- Protected Attributes inherited from com.mxgraph.mxPoint
double x
 Holds the x-coordinate of the point. Default is 0. More...
 
double y
 Holds the y-coordinate of the point. Default is 0. More...
 

Properties

double Width [get, set]
 Sets or returns the width of the rectangle. More...
 
double Height [get, set]
 Sets or returns the height of the rectangle. More...
 
- Properties inherited from com.mxgraph.mxPoint
double X [get, set]
 Sets or returns the x-coordinate of the point. More...
 
double Y [get, set]
 Sets or returns the y-coordinate of the point. More...
 

Detailed Description

Implements a 2-dimensional rectangle with double precision coordinates.

Constructor & Destructor Documentation

◆ mxRectangle() [1/4]

com.mxgraph.mxRectangle.mxRectangle ( )
inline

Constructs a new rectangle at (0, 0) with the width and height set to 0.

◆ mxRectangle() [2/4]

com.mxgraph.mxRectangle.mxRectangle ( mxRectangle  rect)
inline

Constructs a copy of the given rectangle.

Parameters
rectRectangle to construct a copy of.

◆ mxRectangle() [3/4]

com.mxgraph.mxRectangle.mxRectangle ( Rectangle  rect)
inline

Constructs a copy of the given rectangle.

Parameters
rectRectangle to construct a copy of.

◆ mxRectangle() [4/4]

com.mxgraph.mxRectangle.mxRectangle ( double  x,
double  y,
double  width,
double  height 
)
inline

Constructs a rectangle using the given parameters.

Parameters
xX-coordinate of the new rectangle.
yY-coordinate of the new rectangle.
widthWidth of the new rectangle.
heightHeight of the new rectangle.

Member Function Documentation

◆ Add()

void com.mxgraph.mxRectangle.Add ( mxRectangle  rect)
inline

◆ Clone()

new mxRectangle com.mxgraph.mxRectangle.Clone ( )
inline

Returns a new instance of the same rectangle.

Returns
Returns a clone of the rectangle.

Referenced by com.mxgraph.mxCellState.Clone(), com.mxgraph.mxGraphView.GetBoundingBox(), and com.mxgraph.mxGeometry.mxGeometry().

◆ Contains()

bool com.mxgraph.mxRectangle.Contains ( double  x,
double  y 
)
inline

Returns true if this rectangle contains the given point (x, y).

Parameters
xX-coordinate of the point.
yY-coordinate of the point.
Returns
Returns true if (x, y) lies within the given area.

◆ Equals()

new Boolean com.mxgraph.mxRectangle.Equals ( Object  obj)
inline

Returns true if the given object equals this rectangle.

Returns
Returns true if obj is equal.

References com.mxgraph.mxRectangle.Height, com.mxgraph.mxRectangle.Width, com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.

Referenced by com.mxgraph.mxUtils.GetLabelPaintBounds().

◆ GetCenterX()

double com.mxgraph.mxRectangle.GetCenterX ( )
inline

Returns the x-coordinate of the center.

Returns
Returns the x-coordinate of the center.

Referenced by com.mxgraph.mxGraphView.GetNextPoint(), com.mxgraph.mxGraphView.GetPoint(), com.mxgraph.mxGraphView.GetRoutingCenterX(), and com.mxgraph.mxStencil.PaintShape().

◆ GetCenterY()

double com.mxgraph.mxRectangle.GetCenterY ( )
inline

Returns the y-coordinate of the center.

Returns
Returns the y-coordinate of the center.

Referenced by com.mxgraph.mxGraphView.GetNextPoint(), com.mxgraph.mxGraphView.GetPoint(), com.mxgraph.mxGraphView.GetRoutingCenterY(), and com.mxgraph.mxStencil.PaintShape().

◆ GetRectangle()

Rectangle com.mxgraph.mxRectangle.GetRectangle ( )
inline

◆ Grow()

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.

Parameters
amountAmount by which the rectangle should be grown.

Referenced by com.mxgraph.mxCellState.GetPerimeterBounds(), com.mxgraph.mxGraph.Intersects(), and com.mxgraph.mxGraphView.UpdateBoundingBox().

◆ setRect()

void com.mxgraph.mxRectangle.setRect ( double  x,
double  y,
double  w,
double  h 
)
inline

Sets this rectangle to the specified values

Member Data Documentation

◆ height

double com.mxgraph.mxRectangle.height
protected

Holds the height. Default is 0.

Referenced by com.mxgraph.mxRectangle.Add(), and com.mxgraph.mxCellState.Clone().

◆ width

double com.mxgraph.mxRectangle.width
protected

Holds the width. Default is 0.

Referenced by com.mxgraph.mxRectangle.Add(), and com.mxgraph.mxCellState.Clone().

Property Documentation

◆ Height

double com.mxgraph.mxRectangle.Height
getset

◆ Width

double com.mxgraph.mxRectangle.Width
getset

The documentation for this class was generated from the following file: