mxGraph
Public Member Functions | Static Public Attributes | Protected Attributes | Properties
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

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.

Constructs a copy of the given geometry.

Parameters:
geometryGeometry to construct a copy of.

Member Function Documentation

Returns a new instance of the same geometry.

Returns:
Returns a clone of the geometry.

Reimplemented from com.mxgraph.mxRectangle.

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

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

Sets or returns the alternate bounds.

Sets or returns the offset.

Sets or returns the list of control points.

Sets or returns if the geometry is relative.

Sets or returns the source point.

Sets or returns the target point.


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