Implements a view for the graph. Fires scale and translate events if one of the values change.
mxEvent.SCALE fires after the scale was changed in setScale. The <code>scale</code> and <code>previousScale</code> arguments contain the new and previous scale.
mxEvent.TRANSLATE fires after the translate was changed in setTranslate. The <code>translate</code> and <code>previousTranslate</code> arguments contain the new and previous value for translate.
mxGraphView | Implements a view for the graph. |
Variables | |
EMPTY_POINT | An empty mxPoint instance. |
graph | Holds the mxGraph. |
graphBounds | Holds the bounds of the current view. |
scale | Holds the current scale. |
translate | Holds the current translate. |
states | Maps from cells to states. |
Functions | |
mxGraphView | Constructs a new view for the specified mxGraph. |
setScale | Sets the scale, revalidates the view and fires a scale event. |
setTranslate | Sets the translation, revalidates the view and fires a translate event. |
getGraphBounds | Returns graphBounds. |
setGraphBounds | Sets graphBounds. |
getBoundingBox | Returns the bounding for for an array of cells or null, if no cells are specified. |
getBounds | Returns the bounding for for an array of cells or null, if no cells are specified. |
invalidate | |
invalidate | Invalidates the cached cell states. |
validate | Calls validateBounds followed by validatePoints on the root cell if the cache is invalid. |
validateBounds | Validates the bounds of the cell state for the specified cell recursively, for all children if the cell is not collapsed. |
updateVertexLabelOffset | Updates the absoluteOffset of the given vertex cell state. |
validatePoints | Validates the points of the cell state for the specified cell recursively, for all children if the cell is not collapsed. |
childMoved | Invoked when a child state was moved as a result of late evaluation of its position. |
updateBoundingBox | Updates the label bounds in the given state. |
updateBoundingBox | Updates the bounding box in the given cell state. |
updateFixedTerminalPoints | Sets the initial absolute terminal points in the given state before the edge style is computed. |
updateFixedTerminalPoint | Sets the fixed source or target terminal point on the given edge. |
updatePoints | Updates the absolute points in the given state using the specified array of mxPoints as the relative points. |
transformControlPoint | Transforms the given control point to an absolute point. |
getEdgeStyle | Returns the edge style function to be used to render the given edge state. |
updateFloatingTerminalPoints | Updates the terminal points in the given state after the edge style was computed for the edge. |
updateFloatingTerminalPoint | Updates the absolute terminal point in the given state for the given start and end state, where start is the source if source is true. |
getTerminalPort | Returns an mxCellState that represents the source or target terminal or port for the given edge. |
getPerimeterPoint | Returns an mxPoint that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point. |
getRoutingCenterX | Returns the x-coordinate of the center point for automatic routing. |
getRoutingCenterY | Returns the y-coordinate of the center point for automatic routing. |
getPerimeterBounds | Returns the perimeter bounds for the given terminal, edge pair as an mxRectangle. |
getPerimeterFunction | Returns the perimeter function for the given state. |
getNextPoint | Returns the nearest point in the list of absolute points or the center of the opposite terminal. |
getVisibleTerminal | Returns the nearest ancestor terminal that is visible. |
updateEdgeBounds | Updates the bounds of the specified state based on the absolute points in the state. |
getPoint | Returns the absolute point on the edge for the given relative mxGeometry as an mxPoint. |
getState | Returns the cell state for the specified cell. |
getHashCode | Returns a unique string that represents the given instance. |
getStates | Returns the mxCellStates for the given array of mxCells. |
getStates | Returns the mxCellStates for the given array of mxCells. |
removeState | Removes and returns the mxCellState for the given cell. |
createState | Creates the state for the specified cell. |
var $EMPTY_POINT
An empty mxPoint instance.
var $graph
Holds the mxGraph.
function mxGraphView( $graph )
Constructs a new view for the specified mxGraph.
function getGraphBounds()
Returns graphBounds.
function setGraphBounds( $value )
Sets graphBounds.
function validate( $cell = null )
Calls validateBounds followed by validatePoints on the root cell if the cache is invalid.
function updateVertexLabelOffset( $state )
Updates the absoluteOffset of the given vertex cell state. This takes into account the label position styles.
state | mxCellState whose absolute offset should be updated. |
function childMoved( $parent, $child )
Invoked when a child state was moved as a result of late evaluation of its position. This is invoked for relative edge children whose position can only be determined after the points of the parent edge are updated in validatePoints, and validates the bounds of all descendants of the child using validateBounds.
parent | mxCellState that represents the parent state. |
child | mxCellState that represents the child state. |
function updateFixedTerminalPoints( $edge, $source, $target )
Sets the initial absolute terminal points in the given state before the edge style is computed.
edge | mxCellState whose initial terminal points should be updated. |
source | mxCellState which represents the source terminal. |
target | mxCellState which represents the target terminal. |
function updateFixedTerminalPoint( $edge, $terminal, $source, $constraint )
Sets the fixed source or target terminal point on the given edge.
edge | mxCellState whose terminal point should be updated. |
terminal | mxCellState which represents the actual terminal. |
source | Boolean that specifies if the terminal is the source. |
constraint | mxConnectionConstraint that specifies the connection. |
function updatePoints( $edge, $points, $source, $target )
Updates the absolute points in the given state using the specified array of mxPoints as the relative points.
edge | mxCellState whose absolute points should be updated. |
points | Array of mxPoints that constitute the relative points. |
source | mxCellState that represents the source terminal. |
target | mxCellState that represents the target terminal. |
function updateFloatingTerminalPoints( $state, $source, $target )
Updates the terminal points in the given state after the edge style was computed for the edge.
state | mxCellState whose terminal points should be updated. |
source | mxCellState that represents the source terminal. |
target | mxCellState that represents the target terminal. |
function updateFloatingTerminalPoint( $edge, $start, $end, $source )
Updates the absolute terminal point in the given state for the given start and end state, where start is the source if source is true.
edge | mxCellState whose terminal point should be updated. |
start | mxCellState for the terminal on “this” side of the edge. |
end | mxCellState for the terminal on the other side of the edge. |
source | Boolean indicating if start is the source terminal state. |
function getTerminalPort( $state, $terminal, $source )
Returns an mxCellState that represents the source or target terminal or port for the given edge.
state | mxCellState that represents the state of the edge. |
terminal | mxCellState that represents the terminal. |
source | Boolean indicating if the given terminal is the source terminal. |
function getPerimeterPoint( $terminal, $next, $orthogonal, $border = null )
Returns an mxPoint that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point.
terminal | mxCellState for the source or target terminal. |
next | mxPoint that lies outside of the given terminal. |
orthogonal | Boolean that specifies if the orthogonal projection onto the perimeter should be returned. If this is false then the intersection of the perimeter and the line between the next and the center point is returned. |
border | Optional border between the perimeter and the shape. |
function getPerimeterBounds( $terminal, $border = 0 )
Returns the perimeter bounds for the given terminal, edge pair as an mxRectangle.
terminal | mxCellState that represents the terminal. |
border | Number that adds a border between the shape and the perimeter. |
function getNextPoint( $edge, $opposite, $source )
Returns the nearest point in the list of absolute points or the center of the opposite terminal.
edge | mxCellState that represents the edge. |
opposite | mxCellState that represents the opposite terminal. |
source | Boolean indicating if the next point for the source or target should be returned. |
function getVisibleTerminal( $edge, $source )
Returns the nearest ancestor terminal that is visible. The edge appears to be connected to this terminal on the display.
edge | mxCell whose visible terminal should be returned. |
source | Boolean that specifies if the source or target terminal should be returned. |
function getPoint( $state, $geometry = null )
Returns the absolute point on the edge for the given relative mxGeometry as an mxPoint. The edge is represented by the given mxCellState.
state | mxCellState that represents the state of the parent edge. |
geometry | mxGeometry that represents the relative location. |
function getStates()
Returns the mxCellStates for the given array of mxCells. The array contains all states that are not null, that is, the returned array may have less elements than the given array.
Returns the mxCellStates for the given array of mxCells. The array contains all states that are not null, that is, the returned array may have less elements than the given array.
An empty mxPoint instance.
var $EMPTY_POINT
Holds the mxGraph.
var $graph
Holds the bounds of the current view.
var $graphBounds
Holds the current scale.
var $scale
Holds the current translate.
var $translate
Maps from cells to states.
var $states
Constructs a new view for the specified mxGraph.
function mxGraphView( $graph )
Sets the scale, revalidates the view and fires a scale event.
function setScale( $scale )
Sets the translation, revalidates the view and fires a translate event.
function setTranslate( $translate )
Returns graphBounds.
function getGraphBounds()
Sets graphBounds.
function setGraphBounds( $value )
Returns the bounding for for an array of cells or null, if no cells are specified.
function getBoundingBox( $cells )
Returns the bounding for for an array of cells or null, if no cells are specified.
function getBounds( $cells, $boundingBox = false )
Invalidates the cached cell states.
function invalidate()
Calls validateBounds followed by validatePoints on the root cell if the cache is invalid.
function validate( $cell = null )
Validates the bounds of the cell state for the specified cell recursively, for all children if the cell is not collapsed.
function validateBounds( $parentState, $cell )
Validates the points of the cell state for the specified cell recursively, for all children if the cell is not collapsed.
function validatePoints( $parentState, $cell )
Updates the absoluteOffset of the given vertex cell state.
function updateVertexLabelOffset( $state )
Invoked when a child state was moved as a result of late evaluation of its position.
function childMoved( $parent, $child )
Updates the bounding box in the given cell state.
function updateBoundingBox( $state )
Sets the initial absolute terminal points in the given state before the edge style is computed.
function updateFixedTerminalPoints( $edge, $source, $target )
Sets the fixed source or target terminal point on the given edge.
function updateFixedTerminalPoint( $edge, $terminal, $source, $constraint )
Updates the absolute points in the given state using the specified array of mxPoints as the relative points.
function updatePoints( $edge, $points, $source, $target )
Transforms the given control point to an absolute point.
function transformControlPoint( $state, $pt )
Returns the edge style function to be used to render the given edge state.
function getEdgeStyle( $edge, $points, $source, $target )
Updates the terminal points in the given state after the edge style was computed for the edge.
function updateFloatingTerminalPoints( $state, $source, $target )
Updates the absolute terminal point in the given state for the given start and end state, where start is the source if source is true.
function updateFloatingTerminalPoint( $edge, $start, $end, $source )
Returns an mxCellState that represents the source or target terminal or port for the given edge.
function getTerminalPort( $state, $terminal, $source )
Returns an mxPoint that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point.
function getPerimeterPoint( $terminal, $next, $orthogonal, $border = null )
Returns the x-coordinate of the center point for automatic routing.
function getRoutingCenterX( $state )
Returns the y-coordinate of the center point for automatic routing.
function getRoutingCenterY( $state )
Returns the perimeter bounds for the given terminal, edge pair as an mxRectangle.
function getPerimeterBounds( $terminal, $border = 0 )
Returns the perimeter function for the given state.
function getPerimeterFunction( $state )
Returns the nearest point in the list of absolute points or the center of the opposite terminal.
function getNextPoint( $edge, $opposite, $source )
Returns the nearest ancestor terminal that is visible.
function getVisibleTerminal( $edge, $source )
Updates the bounds of the specified state based on the absolute points in the state.
function updateEdgeBounds( $state )
Returns the absolute point on the edge for the given relative mxGeometry as an mxPoint.
function getPoint( $state, $geometry = null )
Returns the cell state for the specified cell.
function getState( $cell, $create = false )
Returns a unique string that represents the given instance.
function getHashCode( $cell )
Returns the mxCellStates for the given array of mxCells.
function getStates()
Removes and returns the mxCellState for the given cell.
function removeState( $cell )
Creates the state for the specified cell.
function createState( $cell )