mxGeometry

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.

Summary
mxGeometryRepresents the geometry of a cell.
Variables
TRANSLATE_CONTROL_POINTSGlobal switch to translate the points in translate.
alternateBoundsStores alternate values for x, y, width and height in a rectangle.
sourcePointDefines the source point of the edge.
targetPointDefines the target point of the edge.
pointsArray of mxPoints which specifies the control points along the edge.
offsetHolds the offset of the label for edges.
relativeSpecifies if the coordinates in the geometry are to be interpreted as relative coordinates.
Functions
mxGeometryConstructs a new object to describe the size and location of a vertex or the control points of an edge.
getTerminalPointReturns the mxPoint representing the source or target point of this edge.
setTerminalPointSets the sourcePoint or targetPoint to the given mxPoint and returns the new point.
translateTranslates the geometry by the specified amount.
copyReturns a copy of this mxGeometry.

Variables

TRANSLATE_CONTROL_POINTS

public static $TRANSLATE_CONTROL_POINTS

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

alternateBounds

var $alternateBounds

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

sourcePoint

var $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.

targetPoint

var $targetPoint

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

points

var $points

Array 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.

offset

var $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.

relative

var $relative

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.

Functions

mxGeometry

function mxGeometry($x = 0,
$y = 0,
$width = 0,
$height = 0)

Constructs a new object to describe the size and location of a vertex or the control points of an edge.

getTerminalPoint

function getTerminalPoint($isSource)

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

Parameters

isSourceBoolean that specifies if the source or target point should be returned.

setTerminalPoint

function setTerminalPoint($point,
$isSource)

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

Parameters

pointPoint to be used as the new source or target point.
isSourceBoolean that specifies if the source or target point should be set.

translate

function translate($dx,
$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 relative is false.  If TRANSLATE_CONTROL_POINTS is false, then points 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.

copy

function copy()

Returns a copy of this mxGeometry.

public static $TRANSLATE_CONTROL_POINTS
Global switch to translate the points in translate.
var $alternateBounds
Stores alternate values for x, y, width and height in a rectangle.
var $sourcePoint
Defines the source point of the edge.
var $targetPoint
Defines the target point of the edge.
var $points
Array of mxPoints which specifies the control points along the edge.
Implements a 2-dimensional point with double precision coordinates.
var $offset
Holds the offset of the label for edges.
var $relative
Specifies if the coordinates in the geometry are to be interpreted as relative coordinates.
function mxGeometry($x = 0,
$y = 0,
$width = 0,
$height = 0)
Constructs a new object to describe the size and location of a vertex or the control points of an edge.
function getTerminalPoint($isSource)
Returns the mxPoint representing the source or target point of this edge.
function setTerminalPoint($point,
$isSource)
Sets the sourcePoint or targetPoint to the given mxPoint and returns the new point.
function translate($dx,
$dy)
Translates the geometry by the specified amount.
function copy()
Returns a copy of this mxGeometry.
Close