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

Represents the geometry of a cell. For vertices, the geometry consists of the x- and y-location, as well as the width and height. For edges, the edge either defines the source- and target-terminal, or the geometry defines the respective terminal points. More...

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

Public Member Functions

 mxGeometry ()
 Constructs a new geometry at (0, 0) with the width and height set to 0. More...
 
 mxGeometry (double x, double y, double width, double height)
 Constructs a geometry using the given parameters. More...
 
 mxGeometry (mxGeometry geometry)
 Constructs a copy of the given geometry. More...
 
mxPoint GetTerminalPoint (bool source)
 Returns the point representing the source or target point of this edge. This is only used if the edge has no source or target vertex. More...
 
mxPoint SetTerminalPoint (mxPoint point, bool source)
 Sets the sourcePoint or targetPoint to the given point and returns the new point. More...
 
void Translate (double dx, double dy)
 Translates the geometry by the specified amount. That is, x and y of the geometry, the sourcePoint, targetPoint and all elements of points are translated by the given amount. X and y are only translated if the geometry is not relative. If TRANSLATE_CONTROL_POINTS is false, then are not modified by this function. More...
 
new mxGeometry Clone ()
 Returns a new instance of the same geometry. More...
 
- Public Member Functions inherited from com.mxgraph.mxRectangle
 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...
 

Static Public Attributes

static bool TRANSLATE_CONTROL_POINTS = true
 Global switch to translate the points in translate. Default is true. More...
 

Protected Attributes

mxRectangle alternateBounds
 Stores alternate values for x, y, width and height in a rectangle. Default is null. More...
 
mxPoint sourcePoint
 Defines the source-point of the edge. This is used if the corresponding edge does not have a source vertex. Otherwise it is ignored. Default is null. More...
 
mxPoint targetPoint
 Defines the target-point of the edge. This is used if the corresponding edge does not have a source vertex. Otherwise it is ignored. Default is null. More...
 
mxPoint offset
 Holds the offset of the label for edges. This is the absolute vector between the center of the edge and the top, left point of the label. Default is null. More...
 
List< mxPointpoints
 List of mxPoints which specifies the control points along the edge. These points are the intermediate points on the edge, for the endpoints use targetPoint and sourcePoint or set the terminals of the edge to a non-null value. Default is null. More...
 
bool relative = false
 Specifies if the coordinates in the geometry are to be interpreted as relative coordinates. Default is false. This is used to mark a geometry with an x- and y-coordinate that is used to describe an edge label position. More...
 
- Protected Attributes inherited from com.mxgraph.mxRectangle
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

mxRectangle AlternateBounds [get, set]
 Sets or returns the alternate bounds. More...
 
mxPoint SourcePoint [get, set]
 Sets or returns the source point. More...
 
mxPoint TargetPoint [get, set]
 Sets or returns the target point. More...
 
List< mxPointPoints [get, set]
 Sets or returns the list of control points. More...
 
mxPoint Offset [get, set]
 Sets or returns the offset. More...
 
bool Relative [get, set]
 Sets or returns if the geometry is relative. More...
 
- Properties inherited from com.mxgraph.mxRectangle
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

Represents the geometry of a cell. For vertices, the geometry consists of the x- and y-location, as well as the width and height. For edges, the edge either defines the source- and target-terminal, or the geometry defines the respective terminal points.

Constructor & Destructor Documentation

com.mxgraph.mxGeometry.mxGeometry ( )
inline

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

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

Constructs a geometry using the given parameters.

Parameters
xX-coordinate of the new geometry.
yY-coordinate of the new geometry.
widthWidth of the new geometry.
heightHeight of the new geometry.
com.mxgraph.mxGeometry.mxGeometry ( mxGeometry  geometry)
inline

Member Function Documentation

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

Returns a new instance of the same geometry.

Returns
Returns a clone of the geometry.

Referenced by com.mxgraph.mxCell.Clone(), com.mxgraph.mxFastOrganicLayout.execute(), and com.mxgraph.mxGraphModel.UpdateEdgeParent().

mxPoint com.mxgraph.mxGeometry.GetTerminalPoint ( bool  source)
inline

Returns the point representing the source or target point of this edge. This is only used if the edge has no source or target vertex.

Parameters
sourceBoolean that specifies if the source or target point should be returned.
Returns
Returns the source or target point.

Referenced by com.mxgraph.mxGraphView.UpdateEdgeState(), and com.mxgraph.mxGraphView.UpdateFixedTerminalPoint().

mxPoint com.mxgraph.mxGeometry.SetTerminalPoint ( mxPoint  point,
bool  source 
)
inline

Sets the sourcePoint or targetPoint to the given point and returns the new point.

Parameters
pointPoint to be used as the new source or target point.
sourceBoolean that specifies if the source or target point should be set.
Returns
Returns the new point.
void com.mxgraph.mxGeometry.Translate ( double  dx,
double  dy 
)
inline

Translates the geometry by the specified amount. That is, x and y of the geometry, the sourcePoint, targetPoint and all elements of points are translated by the given amount. X and y are only translated if the geometry is not relative. If TRANSLATE_CONTROL_POINTS is false, then are not modified by this function.

Parameters
dxInteger that specifies the x-coordinate of the translation.
dyInteger that specifies the y-coordinate of the translation.

References com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.

Referenced by com.mxgraph.mxGraphModel.UpdateEdgeParent().

Member Data Documentation

mxRectangle com.mxgraph.mxGeometry.alternateBounds
protected

Stores alternate values for x, y, width and height in a rectangle. Default is null.

Referenced by com.mxgraph.mxGeometry.mxGeometry().

mxPoint com.mxgraph.mxGeometry.offset
protected

Holds the offset of the label for edges. This is the absolute vector between the center of the edge and the top, left point of the label. Default is null.

Referenced by com.mxgraph.mxGeometry.mxGeometry().

List<mxPoint> com.mxgraph.mxGeometry.points
protected

List of mxPoints which specifies the control points along the edge. These points are the intermediate points on the edge, for the endpoints use targetPoint and sourcePoint or set the terminals of the edge to a non-null value. Default is null.

Referenced by com.mxgraph.mxGeometry.mxGeometry().

bool com.mxgraph.mxGeometry.relative = false
protected

Specifies if the coordinates in the geometry are to be interpreted as relative coordinates. Default is false. This is used to mark a geometry with an x- and y-coordinate that is used to describe an edge label position.

Referenced by com.mxgraph.mxGeometry.mxGeometry().

mxPoint com.mxgraph.mxGeometry.sourcePoint
protected

Defines the source-point of the edge. This is used if the corresponding edge does not have a source vertex. Otherwise it is ignored. Default is null.

Referenced by com.mxgraph.mxGeometry.mxGeometry().

mxPoint com.mxgraph.mxGeometry.targetPoint
protected

Defines the target-point of the edge. This is used if the corresponding edge does not have a source vertex. Otherwise it is ignored. Default is null.

Referenced by com.mxgraph.mxGeometry.mxGeometry().

bool com.mxgraph.mxGeometry.TRANSLATE_CONTROL_POINTS = true
static

Global switch to translate the points in translate. Default is true.

Property Documentation

mxRectangle com.mxgraph.mxGeometry.AlternateBounds
getset

Sets or returns the alternate bounds.

mxPoint com.mxgraph.mxGeometry.Offset
getset

Sets or returns the offset.

Referenced by com.mxgraph.mxGraphView.GetPoint(), and com.mxgraph.mxGraphView.UpdateCellState().

List<mxPoint> com.mxgraph.mxGeometry.Points
getset

Sets or returns the list of control points.

Referenced by com.mxgraph.mxGraphView.UpdateEdgeState().

bool com.mxgraph.mxGeometry.Relative
getset
mxPoint com.mxgraph.mxGeometry.SourcePoint
getset

Sets or returns the source point.

mxPoint com.mxgraph.mxGeometry.TargetPoint
getset

Sets or returns the target point.


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