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

List of all members.

Public Member Functions

 mxGeometry ()
 Constructs a new geometry at (0, 0) with the width and height set to 0.
 mxGeometry (double x, double y, double width, double height)
 Constructs a geometry using the given parameters.
 mxGeometry (mxGeometry geometry)
 Constructs a copy of the given geometry.
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.
mxPoint SetTerminalPoint (mxPoint point, bool source)
 Sets the sourcePoint or targetPoint to the given point and returns the new point.
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.
new mxGeometry Clone ()
 Returns a new instance of the same geometry.

Static Public Attributes

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

Protected Attributes

mxRectangle alternateBounds
 Stores alternate values for x, y, width and height in a rectangle. Default is null.
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.
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.
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.
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.
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.

Properties

mxRectangle AlternateBounds [get, set]
 Sets or returns the alternate bounds.
mxPoint SourcePoint [get, set]
 Sets or returns the source point.
mxPoint TargetPoint [get, set]
 Sets or returns the target point.
List< mxPointPoints [get, set]
 Sets or returns the list of control points.
mxPoint Offset [get, set]
 Sets or returns the offset.
bool Relative [get, set]
 Sets or returns if the geometry is relative.

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:
x X-coordinate of the new geometry.
y Y-coordinate of the new geometry.
width Width of the new geometry.
height Height of the new geometry.
com::mxgraph::mxGeometry::mxGeometry ( mxGeometry  geometry  )  [inline]

Constructs a copy of the given geometry.

Parameters:
geometry Geometry to construct a copy of.

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.

Reimplemented from com::mxgraph::mxRectangle.

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:
source Boolean that specifies if the source or target point should be returned.
Returns:
Returns the source or target point.
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:
point Point to be used as the new source or target point.
source Boolean 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:
dx Integer that specifies the x-coordinate of the translation.
dy Integer that specifies the y-coordinate of the translation.

Member Data Documentation

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

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.

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.

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.

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.

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.

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


Property Documentation

mxRectangle com::mxgraph::mxGeometry::AlternateBounds [get, set]

Sets or returns the alternate bounds.

mxPoint com::mxgraph::mxGeometry::Offset [get, set]

Sets or returns the offset.

List<mxPoint> com::mxgraph::mxGeometry::Points [get, set]

Sets or returns the list of control points.

bool com::mxgraph::mxGeometry::Relative [get, set]

Sets or returns if the geometry is relative.

mxPoint com::mxgraph::mxGeometry::SourcePoint [get, set]

Sets or returns the source point.

mxPoint com::mxgraph::mxGeometry::TargetPoint [get, set]

Sets or returns the target point.


The documentation for this class was generated from the following file:
Generated on Thu Feb 21 15:48:43 2013 for mxGraph by  doxygen 1.6.3