Represents the current state of a cell in a given mxGraphView.
For edges, the edge label position is stored in absoluteOffset.
The size for oversize labels can be retrieved using the boundingBox property of the text field as shown below.
var bbox = (state.text != null) ? state.text.boundingBox : null;
mxCellState | Represents the current state of a cell in a given mxGraphView. |
Functions | |
mxCellState | Constructs a new object that represents the current state of the given cell in the specified view. |
Variables | |
view | Reference to the enclosing mxGraphView. |
cell | Reference to the mxCell that is represented by this state. |
style | Contains an array of key, value pairs that represent the style of the cell. |
invalidStyle | Specifies if the style is invalid. |
invalid | Specifies if the state is invalid. |
origin | mxPoint that holds the origin for all child cells. |
absolutePoints | Holds an array of mxPoints that represent the absolute points of an edge. |
absoluteOffset | mxPoint that holds the absolute offset. |
visibleSourceState | Caches the visible source terminal state. |
visibleTargetState | Caches the visible target terminal state. |
terminalDistance | Caches the distance between the end points for an edge. |
length | Caches the length of an edge. |
segments | Array of numbers that represent the cached length of each segment of the edge. |
shape | Holds the mxShape that represents the cell graphically. |
text | Holds the mxText that represents the label of the cell. |
unscaledWidth | Holds the unscaled width of the state. |
Functions | |
getPerimeterBounds | Returns the mxRectangle that should be used as the perimeter of the cell. |
setAbsoluteTerminalPoint | Sets the first or last point in absolutePoints depending on isSource. |
setCursor | Sets the given cursor on the shape and text shape. |
getVisibleTerminal | Returns the visible source or target terminal cell. |
getVisibleTerminalState | Returns the visible source or target terminal state. |
setVisibleTerminalState | Sets the visible source or target terminal state. |
getCellBounds | Returns the unscaled, untranslated bounds. |
getPaintBounds | Returns the unscaled, untranslated paint bounds. |
updateCachedBounds | Updates the cellBounds and paintBounds. |
setState | Copies all fields from the given state to this state. |
clone | Returns a clone of this mxPoint. |
destroy | Destroys the state and all associated resources. |
function mxCellState( view, cell, style )
Constructs a new object that represents the current state of the given cell in the specified view.
view | mxGraphView that contains the state. |
cell | mxCell that this state represents. |
style | Array of key, value pairs that constitute the style. |
mxCellState.prototype.view
Reference to the enclosing mxGraphView.
mxCellState.prototype.cell
Reference to the mxCell that is represented by this state.
mxCellState.prototype.absolutePoints
Holds an array of mxPoints that represent the absolute points of an edge.
mxCellState.prototype.absoluteOffset
mxPoint that holds the absolute offset. For edges, this is the absolute coordinates of the label position. For vertices, this is the offset of the label relative to the top, left corner of the vertex.
mxCellState.prototype.shape
Holds the mxShape that represents the cell graphically.
mxCellState.prototype.text
Holds the mxText that represents the label of the cell. Thi smay be null if the cell has no label.
mxCellState.prototype.getPerimeterBounds = function( border, bounds )
Returns the mxRectangle that should be used as the perimeter of the cell.
border | Optional border to be added around the perimeter bounds. |
bounds | Optional mxRectangle to be used as the initial bounds. |
mxCellState.prototype.setAbsoluteTerminalPoint = function( point, isSource )
Sets the first or last point in absolutePoints depending on isSource.
point | mxPoint that represents the terminal point. |
isSource | Boolean that specifies if the first or last point should be assigned. |
mxCellState.prototype.setVisibleTerminalState = function( terminalState, source )
Sets the visible source or target terminal state.
terminalState | mxCellState that represents the terminal. |
source | Boolean that specifies if the source or target state should be set. |
mxCellState.prototype.getPaintBounds = function()
Returns the unscaled, untranslated paint bounds. This is the same as getCellBounds but with a 90 degree rotation if the shape’s isPaintBoundsInverted returns true.
mxCellState.prototype.clone = function()
Returns a clone of this mxPoint.
Constructs a new object that represents the current state of the given cell in the specified view.
function mxCellState( view, cell, style )
Reference to the enclosing mxGraphView.
mxCellState.prototype.view
Reference to the mxCell that is represented by this state.
mxCellState.prototype.cell
Contains an array of key, value pairs that represent the style of the cell.
mxCellState.prototype.style
Specifies if the style is invalid.
mxCellState.prototype.invalidStyle
Specifies if the state is invalid.
mxCellState.prototype.invalid
mxPoint that holds the origin for all child cells.
mxCellState.prototype.origin
Holds an array of mxPoints that represent the absolute points of an edge.
mxCellState.prototype.absolutePoints
mxPoint that holds the absolute offset.
mxCellState.prototype.absoluteOffset
Caches the visible source terminal state.
mxCellState.prototype.visibleSourceState
Caches the visible target terminal state.
mxCellState.prototype.visibleTargetState
Caches the distance between the end points for an edge.
mxCellState.prototype.terminalDistance
Caches the length of an edge.
mxCellState.prototype.length
Array of numbers that represent the cached length of each segment of the edge.
mxCellState.prototype.segments
Holds the mxShape that represents the cell graphically.
mxCellState.prototype.shape
Holds the mxText that represents the label of the cell.
mxCellState.prototype.text
Holds the unscaled width of the state.
mxCellState.prototype.unscaledWidth
Returns the mxRectangle that should be used as the perimeter of the cell.
mxCellState.prototype.getPerimeterBounds = function( border, bounds )
Sets the first or last point in absolutePoints depending on isSource.
mxCellState.prototype.setAbsoluteTerminalPoint = function( point, isSource )
Sets the given cursor on the shape and text shape.
mxCellState.prototype.setCursor = function( cursor )
Returns the visible source or target terminal cell.
mxCellState.prototype.getVisibleTerminal = function( source )
Returns the visible source or target terminal state.
mxCellState.prototype.getVisibleTerminalState = function( source )
Sets the visible source or target terminal state.
mxCellState.prototype.setVisibleTerminalState = function( terminalState, source )
Returns the unscaled, untranslated bounds.
mxCellState.prototype.getCellBounds = function()
Returns the unscaled, untranslated paint bounds.
mxCellState.prototype.getPaintBounds = function()
Updates the cellBounds and paintBounds.
mxCellState.prototype.updateCachedBounds = function()
Copies all fields from the given state to this state.
mxCellState.prototype.setState = function( state )
Returns a clone of this mxPoint.
mxCellState.prototype.clone = function()
Destroys the state and all associated resources.
mxCellState.prototype.destroy = function()