mxGraphView

Extends mxEventSource to implement a view for a graph.  This class is in charge of computing the absolute coordinates for the relative child geometries, the points for perimeters and edge styles and keeping them cached in mxCellStates for faster retrieval.  The states are updated whenever the model or the view state (translate, scale) changes.  The scale and translate are honoured in the bounds.

Summary
mxGraphViewExtends mxEventSource to implement a view for a graph.
Events
mxEvent.UNDOFires after the root was changed in setCurrentRoot.
mxEvent.SCALE_AND_TRANSLATEFires after the scale and translate have been changed in scaleAndTranslate.
mxEvent.SCALEFires after the scale was changed in setScale.
mxEvent.TRANSLATEFires after the translate was changed in setTranslate.
mxEvent.DOWN and mxEvent.UPFire if the current root is changed by executing an mxCurrentRootChange.
Functions
mxGraphViewConstructs a new view for the given mxGraph.
Variables
doneResourceSpecifies the resource key for the status message after a long operation.
Functions
updatingDocumentResourceSpecifies the resource key for the status message while the document is being updated.
Variables
allowEvalSpecifies if string values in cell styles should be evaluated using mxUtils.eval.
captureDocumentGestureSpecifies if a gesture should be captured when it goes outside of the graph container.
optimizeVmlReflowsSpecifies if the <canvas> should be hidden while rendering in IE8 standards mode and quirks mode.
renderingSpecifies if shapes should be created, updated and destroyed using the methods of mxCellRenderer in graph.
graphReference to the enclosing mxGraph.
currentRootmxCell that acts as the root of the displayed cell hierarchy.
graphBoundsmxRectangle that caches the scales, translated bounds of the current view.
scaleSpecifies the scale.
translatemxPoint that specifies the current translation.
updateStyleSpecifies if the style should be updated in each validation step.
Functions
getGraphBoundsReturns graphBounds.
setGraphBoundsSets graphBounds.
getBoundsReturns the bounds (on the screen) for the given array of mxCells.
setCurrentRootSets and returns the current root and fires an <undo> event before calling mxGraph.sizeDidChange.
scaleAndTranslateSets the scale and translation and fires a scale and translate event before calling revalidate followed by mxGraph.sizeDidChange.
getScaleReturns the scale.
setScaleSets the scale and fires a scale event before calling revalidate followed by mxGraph.sizeDidChange.
getTranslateReturns the translate.
setTranslateSets the translation and fires a translate event before calling revalidate followed by mxGraph.sizeDidChange.
refreshClears the view if currentRoot is not null and revalidates.
revalidateRevalidates the complete view with all cell states.
clearRemoves the state of the given cell and all descendants if the given cell is not the current root.
invalidateInvalidates the state of the given cell, all its descendants and connected edges.
validateFirst validates all bounds and then validates all points recursively on all visible cells starting at the given cell.
createBackgroundPageShapeCreates and returns the shape used as the background page.
validateBackgroundCalls validateBackgroundImage and validateBackgroundPage.
validateBackgroundImageValidates the background image.
validateBackgroundPageValidates the background page.
getBackgroundPageBoundsReturns the bounds for the background page.
redrawBackgroundImageUpdates the bounds and redraws the background image.
validateBoundsValidates the bounds of the given parent’s child using the given parent state as the origin for the child.
updateVertexLabelOffsetUpdates the absoluteOffset of the given vertex cell state.
validatePointsValidates the points for the state of the given cell recursively if the cell is not collapsed and returns the bounding box of all visited states as an mxRectangle.
childMovedInvoked when a child state was moved as a result of late evaluation of its position.
updateFixedTerminalPointsSets the initial absolute terminal points in the given state before the edge style is computed.
updateFixedTerminalPointSets the fixed source or target terminal point on the given edge.
updatePointsUpdates the absolute points in the given state using the specified array of mxPoints as the relative points.
transformControlPointTransforms the given control point to an absolute point.
getEdgeStyleReturns the edge style function to be used to render the given edge state.
updateFloatingTerminalPointsUpdates the terminal points in the given state after the edge style was computed for the edge.
updateFloatingTerminalPointUpdates the absolute terminal point in the given state for the given start and end state, where start is the source if source is true.
getTerminalPortReturns an mxCellState that represents the source or target terminal or port for the given edge.
getPerimeterPointReturns 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.
getRoutingCenterXReturns the x-coordinate of the center point for automatic routing.
getRoutingCenterYReturns the y-coordinate of the center point for automatic routing.
getPerimeterBoundsReturns the perimeter bounds for the given terminal, edge pair as an mxRectangle.
getPerimeterFunctionReturns the perimeter function for the given state.
getNextPointReturns the nearest point in the list of absolute points or the center of the opposite terminal.
getVisibleTerminalReturns the nearest ancestor terminal that is visible.
updateEdgeBoundsUpdates the given state using the bounding box of the absolute points.
getPointReturns the absolute point on the edge for the given relative mxGeometry as an mxPoint.
getRelativePointGets the relative point that describes the given, absolute label position for the given edge state.
updateEdgeLabelOffsetUpdates mxCellState.absoluteOffset for the given state.
getStateReturns the mxCellState for the given cell.
isRenderingReturns rendering.
setRenderingSets rendering.
isAllowEvalReturns allowEval.
setAllowEvalSets allowEval.
getStatesReturns <states>.
setStatesSets <states>.
getCellStatesReturns the mxCellStates for the given array of mxCells.
removeStateRemoves and returns the mxCellState for the given cell.
createStateCreates and returns an mxCellState for the given cell and initializes it using mxCellRenderer.initialize.
getCanvasReturns the DOM node that contains the background-, draw- and overlaypane.
getBackgroundPaneReturns the DOM node that represents the background layer.
getDrawPaneReturns the DOM node that represents the main drawing layer.
getOverlayPaneReturns the DOM node that represents the topmost drawing layer.
isContainerEventReturns true if the event origin is one of the drawing panes or containers of the view.
isScrollEventReturns true if the event origin is one of the scrollbars of the container in IE.
initInitializes the graph event dispatch loop for the specified container and invokes create to create the required DOM nodes for the display.
installListenersInstalls the required listeners in the container.
createCreates the DOM nodes for the HTML display.
updateHtmlCanvasSizeUpdates the size of the HTML canvas.
createHtmlPaneCreates and returns a drawing pane in HTML (DIV).
createCreates the DOM nodes for the VML display.
createVmlPaneCreates a drawing pane in VML (group).
createCreates and returns the DOM nodes for the SVG display.
updateContainerStyleUpdates the style of the container after installing the SVG DOM elements.
destroyDestroys the view and all its resources.
mxCurrentRootChangeAction to change the current root in a view.
Functions
mxCurrentRootChangeConstructs a change of the current root in the given view.
executeChanges the current root of the view.

Events

mxEvent.UNDO

Fires after the root was changed in setCurrentRoot.  The <code>edit</code> property contains the mxUndoableEdit which contains the mxCurrentRootChange.

mxEvent.SCALE_AND_TRANSLATE

Fires after the scale and translate have been changed in scaleAndTranslate.  The <code>scale</code>, <code>previousScale</code>, <code>translate</code> and <code>previousTranslate</code> properties contain the new and previous scale and translate, respectively.

mxEvent.SCALE

Fires after the scale was changed in setScale.  The <code>scale</code> and <code>previousScale</code> properties contain the new and previous scale.

mxEvent.TRANSLATE

Fires after the translate was changed in setTranslate.  The <code>translate</code> and <code>previousTranslate</code> properties contain the new and previous value for translate.

mxEvent.DOWN and mxEvent.UP

Fire if the current root is changed by executing an mxCurrentRootChange.  The event name depends on the location of the root in the cell hierarchy with respect to the current root.  The <code>root</code> and <code>previous</code> properties contain the new and previous root, respectively.

Functions

mxGraphView

function mxGraphView(graph)

Constructs a new view for the given mxGraph.

Parameters

graphReference to the enclosing mxGraph.

Variables

doneResource

mxGraphView.prototype.doneResource

Specifies the resource key for the status message after a long operation.  If the resource for this key does not exist then the value is used as the status message.  Default is ‘done’.

Functions

updatingDocumentResource

Specifies the resource key for the status message while the document is being updated.  If the resource for this key does not exist then the value is used as the status message.  Default is ‘updatingDocument’.

Variables

allowEval

mxGraphView.prototype.allowEval

Specifies if string values in cell styles should be evaluated using mxUtils.eval.  This will only be used if the string values can’t be mapped to objects using mxStyleRegistry.  Default is false.  NOTE: Enabling this switch carries a possible security risk (see the section on security in the manual).

captureDocumentGesture

mxGraphView.prototype.captureDocumentGesture

Specifies if a gesture should be captured when it goes outside of the graph container.  Default is true.

optimizeVmlReflows

mxGraphView.prototype.optimizeVmlReflows

Specifies if the <canvas> should be hidden while rendering in IE8 standards mode and quirks mode.  This will significantly improve rendering performance.  Default is true.

rendering

mxGraphView.prototype.rendering

Specifies if shapes should be created, updated and destroyed using the methods of mxCellRenderer in graph.  Default is true.

graph

mxGraphView.prototype.graph

Reference to the enclosing mxGraph.

currentRoot

mxGraphView.prototype.currentRoot

mxCell that acts as the root of the displayed cell hierarchy.

graphBounds

mxGraphView.prototype.graphBounds

mxRectangle that caches the scales, translated bounds of the current view.

scale

mxGraphView.prototype.scale

Specifies the scale.  Default is 1 (100%).

translate

mxGraphView.prototype.translate

mxPoint that specifies the current translation.  Default is a new empty mxPoint.

updateStyle

mxGraphView.prototype.updateStyle

Specifies if the style should be updated in each validation step.  If this is false then the style is only updated if the state is created or if the style of the cell was changed.  Default is false.

Functions

getGraphBounds

mxGraphView.prototype.getGraphBounds = function()

Returns graphBounds.

setGraphBounds

mxGraphView.prototype.setGraphBounds = function(value)

Sets graphBounds.

getBounds

mxGraphView.prototype.getBounds = function(cells)

Returns the bounds (on the screen) for the given array of mxCells.

Parameters

cellsArray of mxCells to return the bounds for.

setCurrentRoot

mxGraphView.prototype.setCurrentRoot = function(root)

Sets and returns the current root and fires an <undo> event before calling mxGraph.sizeDidChange.

Parameters

rootmxCell that specifies the root of the displayed cell hierarchy.

scaleAndTranslate

mxGraphView.prototype.scaleAndTranslate = function(scale,
dx,
dy)

Sets the scale and translation and fires a scale and translate event before calling revalidate followed by mxGraph.sizeDidChange.

Parameters

scaleDecimal value that specifies the new scale (1 is 100%).
dxX-coordinate of the translation.
dyY-coordinate of the translation.

getScale

mxGraphView.prototype.getScale = function()

Returns the scale.

setScale

mxGraphView.prototype.setScale = function(value)

Sets the scale and fires a scale event before calling revalidate followed by mxGraph.sizeDidChange.

Parameters

valueDecimal value that specifies the new scale (1 is 100%).

getTranslate

mxGraphView.prototype.getTranslate = function()

Returns the translate.

setTranslate

mxGraphView.prototype.setTranslate = function(dx,
dy)

Sets the translation and fires a translate event before calling revalidate followed by mxGraph.sizeDidChange.  The translation is the negative of the origin.

Parameters

dxX-coordinate of the translation.
dyY-coordinate of the translation.

refresh

mxGraphView.prototype.refresh = function()

Clears the view if currentRoot is not null and revalidates.

revalidate

mxGraphView.prototype.revalidate = function()

Revalidates the complete view with all cell states.

clear

mxGraphView.prototype.clear = function(cell,
force,
recurse)

Removes the state of the given cell and all descendants if the given cell is not the current root.

Parameters

cellOptional mxCell for which the state should be removed.  Default is the root of the model.
forceBoolean indicating if the current root should be ignored for recursion.

invalidate

mxGraphView.prototype.invalidate = function(cell,
recurse,
includeEdges,
orderChanged)

Invalidates the state of the given cell, all its descendants and connected edges.

Parameters

cellOptional mxCell to be invalidated.  Default is the root of the model.

validate

mxGraphView.prototype.validate = function(cell)

First validates all bounds and then validates all points recursively on all visible cells starting at the given cell.  Finally the background is validated using validateBackground.

Parameters

cellOptional mxCell to be used as the root of the validation.  Default is currentRoot or the root of the model.

createBackgroundPageShape

mxGraphView.prototype.createBackgroundPageShape = function(bounds)

Creates and returns the shape used as the background page.

Parameters

boundsmxRectangle that represents the bounds of the shape.

validateBackground

mxGraphView.prototype.validateBackground = function()

Calls validateBackgroundImage and validateBackgroundPage.

validateBackgroundImage

mxGraphView.prototype.validateBackgroundImage = function()

Validates the background image.

validateBackgroundPage

mxGraphView.prototype.validateBackgroundPage = function()

Validates the background page.

getBackgroundPageBounds

mxGraphView.prototype.getBackgroundPageBounds = function()

Returns the bounds for the background page.

redrawBackgroundImage

mxGraphView.prototype.redrawBackgroundImage = function(backgroundImage,
bg)

Updates the bounds and redraws the background image.

Example

If the background image should not be scaled, this can be replaced with the following.

mxGraphView.prototype.redrawBackground = function(backgroundImage, bg)
{
  backgroundImage.bounds.x = this.translate.x;
  backgroundImage.bounds.y = this.translate.y;
  backgroundImage.bounds.width = bg.width;
  backgroundImage.bounds.height = bg.height;

  backgroundImage.redraw();
};

Parameters

backgroundImagemxImageShape that represents the background image.
bgmxImage that specifies the image and its dimensions.

validateBounds

mxGraphView.prototype.validateBounds = function(parentState,
cell)

Validates the bounds of the given parent’s child using the given parent state as the origin for the child.  The validation is carried out recursively for all non-collapsed descendants.

Parameters

parentStatemxCellState for the given parent.
cellmxCell for which the bounds in the state should be updated.

updateVertexLabelOffset

mxGraphView.prototype.updateVertexLabelOffset = function(state)

Updates the absoluteOffset of the given vertex cell state.  This takes into account the label position styles.

Parameters

statemxCellState whose absolute offset should be updated.

validatePoints

mxGraphView.prototype.validatePoints = function(parentState,
cell)

Validates the points for the state of the given cell recursively if the cell is not collapsed and returns the bounding box of all visited states as an mxRectangle.

Parameters

parentStatemxCellState for the parent cell.
cellmxCell whose points in the state should be updated.

childMoved

mxGraphView.prototype.childMoved = function(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.

Parameters

parentmxCellState that represents the parent state.
childmxCellState that represents the child state.

updateFixedTerminalPoints

mxGraphView.prototype.updateFixedTerminalPoints = function(edge,
source,
target)

Sets the initial absolute terminal points in the given state before the edge style is computed.

Parameters

edgemxCellState whose initial terminal points should be updated.
sourcemxCellState which represents the source terminal.
targetmxCellState which represents the target terminal.

updateFixedTerminalPoint

mxGraphView.prototype.updateFixedTerminalPoint = function(edge,
terminal,
source,
constraint)

Sets the fixed source or target terminal point on the given edge.

Parameters

edgemxCellState whose terminal point should be updated.
terminalmxCellState which represents the actual terminal.
sourceBoolean that specifies if the terminal is the source.
constraintmxConnectionConstraint that specifies the connection.

updatePoints

mxGraphView.prototype.updatePoints = function(edge,
points,
source,
target)

Updates the absolute points in the given state using the specified array of mxPoints as the relative points.

Parameters

edgemxCellState whose absolute points should be updated.
pointsArray of mxPoints that constitute the relative points.
sourcemxCellState that represents the source terminal.
targetmxCellState that represents the target terminal.

transformControlPoint

mxGraphView.prototype.transformControlPoint = function(state,
pt)

Transforms the given control point to an absolute point.

getEdgeStyle

mxGraphView.prototype.getEdgeStyle = function(edge,
points,
source,
target)

Returns the edge style function to be used to render the given edge state.

updateFloatingTerminalPoints

mxGraphView.prototype.updateFloatingTerminalPoints = function(state,
source,
target)

Updates the terminal points in the given state after the edge style was computed for the edge.

Parameters

statemxCellState whose terminal points should be updated.
sourcemxCellState that represents the source terminal.
targetmxCellState that represents the target terminal.

updateFloatingTerminalPoint

mxGraphView.prototype.updateFloatingTerminalPoint = function(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.

Parameters

edgemxCellState whose terminal point should be updated.
startmxCellState for the terminal on “this” side of the edge.
endmxCellState for the terminal on the other side of the edge.
sourceBoolean indicating if start is the source terminal state.

getTerminalPort

mxGraphView.prototype.getTerminalPort = function(state,
terminal,
source)

Returns an mxCellState that represents the source or target terminal or port for the given edge.

Parameters

statemxCellState that represents the state of the edge.
terminalmxCellState that represents the terminal.
sourceBoolean indicating if the given terminal is the source terminal.

getPerimeterPoint

mxGraphView.prototype.getPerimeterPoint = function(terminal,
next,
orthogonal,
border)

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.

Parameters

terminalmxCellState for the source or target terminal.
nextmxPoint that lies outside of the given terminal.
orthogonalBoolean 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.
borderOptional border between the perimeter and the shape.

getRoutingCenterX

mxGraphView.prototype.getRoutingCenterX = function (state)

Returns the x-coordinate of the center point for automatic routing.

getRoutingCenterY

mxGraphView.prototype.getRoutingCenterY = function (state)

Returns the y-coordinate of the center point for automatic routing.

getPerimeterBounds

mxGraphView.prototype.getPerimeterBounds = function(terminal,
border)

Returns the perimeter bounds for the given terminal, edge pair as an mxRectangle.

If you have a model where each terminal has a relative child that should act as the graphical endpoint for a connection from/to the terminal, then this method can be replaced as follows:

var oldGetPerimeterBounds = mxGraphView.prototype.getPerimeterBounds;
mxGraphView.prototype.getPerimeterBounds = function(terminal, edge, isSource)
{
  var model = this.graph.getModel();
  var childCount = model.getChildCount(terminal.cell);

  if (childCount > 0)
  {
    var child = model.getChildAt(terminal.cell, 0);
    var geo = model.getGeometry(child);

    if (geo != null &&
        geo.relative)
    {
      var state = this.getState(child);

      if (state != null)
      {
        terminal = state;
      }
    }
  }

  return oldGetPerimeterBounds.apply(this, arguments);
};

Parameters

terminalmxCellState that represents the terminal.
borderNumber that adds a border between the shape and the perimeter.

getPerimeterFunction

mxGraphView.prototype.getPerimeterFunction = function(state)

Returns the perimeter function for the given state.

getNextPoint

mxGraphView.prototype.getNextPoint = function(edge,
opposite,
source)

Returns the nearest point in the list of absolute points or the center of the opposite terminal.

Parameters

edgemxCellState that represents the edge.
oppositemxCellState that represents the opposite terminal.
sourceBoolean indicating if the next point for the source or target should be returned.

getVisibleTerminal

mxGraphView.prototype.getVisibleTerminal = function(edge,
source)

Returns the nearest ancestor terminal that is visible.  The edge appears to be connected to this terminal on the display.  The result of this method is cached in mxCellState.getVisibleTerminalState.

Parameters

edgemxCell whose visible terminal should be returned.
sourceBoolean that specifies if the source or target terminal should be returned.

updateEdgeBounds

mxGraphView.prototype.updateEdgeBounds = function(state)

Updates the given state using the bounding box of the absolute points.  Also updates mxCellState.terminalDistance, mxCellState.length and mxCellState.segments.

Parameters

statemxCellState whose bounds should be updated.

getPoint

mxGraphView.prototype.getPoint = function(state,
geometry)

Returns the absolute point on the edge for the given relative mxGeometry as an mxPoint.  The edge is represented by the given mxCellState.

Parameters

statemxCellState that represents the state of the parent edge.
geometrymxGeometry that represents the relative location.

getRelativePoint

mxGraphView.prototype.getRelativePoint = function(edgeState,
x,
y)

Gets the relative point that describes the given, absolute label position for the given edge state.

Parameters

statemxCellState that represents the state of the parent edge.
xSpecifies the x-coordinate of the absolute label location.
ySpecifies the y-coordinate of the absolute label location.

updateEdgeLabelOffset

mxGraphView.prototype.updateEdgeLabelOffset = function(state)

Updates mxCellState.absoluteOffset for the given state.  The absolute offset is normally used for the position of the edge label.  Is is calculated from the geometry as an absolute offset from the center between the two endpoints if the geometry is absolute, or as the relative distance between the center along the line and the absolute orthogonal distance if the geometry is relative.

Parameters

statemxCellState whose absolute offset should be updated.

getState

mxGraphView.prototype.getState = function(cell,
create)

Returns the mxCellState for the given cell.  If create is true, then the state is created if it does not yet exist.

Parameters

cellmxCell for which the mxCellState should be returned.
createOptional boolean indicating if a new state should be created if it does not yet exist.  Default is false.

isRendering

mxGraphView.prototype.isRendering = function()

Returns rendering.

setRendering

mxGraphView.prototype.setRendering = function(value)

Sets rendering.

isAllowEval

mxGraphView.prototype.isAllowEval = function()

Returns allowEval.

setAllowEval

mxGraphView.prototype.setAllowEval = function(value)

Sets allowEval.

getStates

mxGraphView.prototype.getStates = function()

Returns <states>.

setStates

mxGraphView.prototype.setStates = function(value)

Sets <states>.

getCellStates

mxGraphView.prototype.getCellStates = function(cells)

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.  If no argument is given, then this returns <states>.

removeState

mxGraphView.prototype.removeState = function(cell)

Removes and returns the mxCellState for the given cell.

Parameters

cellmxCell for which the mxCellState should be removed.

createState

mxGraphView.prototype.createState = function(cell)

Creates and returns an mxCellState for the given cell and initializes it using mxCellRenderer.initialize.

Parameters

cellmxCell for which a new mxCellState should be created.

getCanvas

mxGraphView.prototype.getCanvas = function()

Returns the DOM node that contains the background-, draw- and overlaypane.

getBackgroundPane

mxGraphView.prototype.getBackgroundPane = function()

Returns the DOM node that represents the background layer.

getDrawPane

mxGraphView.prototype.getDrawPane = function()

Returns the DOM node that represents the main drawing layer.

getOverlayPane

mxGraphView.prototype.getOverlayPane = function()

Returns the DOM node that represents the topmost drawing layer.

isContainerEvent

mxGraphView.prototype.isContainerEvent = function(evt)

Returns true if the event origin is one of the drawing panes or containers of the view.

isScrollEvent

mxGraphView.prototype.isScrollEvent = function(evt)

Returns true if the event origin is one of the scrollbars of the container in IE.  Such events are ignored.

init

mxGraphView.prototype.init = function()

Initializes the graph event dispatch loop for the specified container and invokes create to create the required DOM nodes for the display.

installListeners

mxGraphView.prototype.installListeners = function()

Installs the required listeners in the container.

create

mxGraphView.prototype.createHtml = function()

Creates the DOM nodes for the HTML display.

updateHtmlCanvasSize

mxGraphView.prototype.updateHtmlCanvasSize = function(width,
height)

Updates the size of the HTML canvas.

createHtmlPane

mxGraphView.prototype.createHtmlPane = function(width,
height)

Creates and returns a drawing pane in HTML (DIV).

create

mxGraphView.prototype.createVml = function()

Creates the DOM nodes for the VML display.

createVmlPane

mxGraphView.prototype.createVmlPane = function(width,
height)

Creates a drawing pane in VML (group).

create

mxGraphView.prototype.createSvg = function()

Creates and returns the DOM nodes for the SVG display.

updateContainerStyle

mxGraphView.prototype.updateContainerStyle = function(container)

Updates the style of the container after installing the SVG DOM elements.

destroy

mxGraphView.prototype.destroy = function()

Destroys the view and all its resources.

mxCurrentRootChange

Action to change the current root in a view.

Summary
Functions
mxCurrentRootChangeConstructs a change of the current root in the given view.
executeChanges the current root of the view.

Functions

mxCurrentRootChange

function mxCurrentRootChange(view,
root)

Constructs a change of the current root in the given view.

execute

mxCurrentRootChange.prototype.execute = function()

Changes the current root of the view.

Base class for objects that dispatch named events.
mxGraphView.prototype.setCurrentRoot = function(root)
Sets and returns the current root and fires an undo event before calling mxGraph.sizeDidChange.
mxGraphView.prototype.scaleAndTranslate = function(scale,
dx,
dy)
Sets the scale and translation and fires a scale and translate event before calling revalidate followed by mxGraph.sizeDidChange.
mxGraphView.prototype.setScale = function(value)
Sets the scale and fires a scale event before calling revalidate followed by mxGraph.sizeDidChange.
mxGraphView.prototype.setTranslate = function(dx,
dy)
Sets the translation and fires a translate event before calling revalidate followed by mxGraph.sizeDidChange.
Action to change the current root in a view.
function mxGraphView(graph)
Constructs a new view for the given mxGraph.
Extends mxEventSource to implement a graph component for the browser.
mxGraphView.prototype.doneResource
Specifies the resource key for the status message after a long operation.
mxGraphView.prototype.allowEval
Specifies if string values in cell styles should be evaluated using mxUtils.eval.
eval: function(expr)
Evaluates the given expression using eval and returns the JavaScript object that represents the expression result.
mxGraphView.prototype.captureDocumentGesture
Specifies if a gesture should be captured when it goes outside of the graph container.
mxGraphView.prototype.optimizeVmlReflows
Specifies if the canvas should be hidden while rendering in IE8 standards mode and quirks mode.
mxGraphView.prototype.rendering
Specifies if shapes should be created, updated and destroyed using the methods of mxCellRenderer in graph.
Renders cells into a document object model.
mxGraphView.prototype.graph
Reference to the enclosing mxGraph.
mxGraphView.prototype.currentRoot
mxCell that acts as the root of the displayed cell hierarchy.
Cells are the elements of the graph model.
mxGraphView.prototype.graphBounds
mxRectangle that caches the scales, translated bounds of the current view.
Extends mxPoint to implement a 2-dimensional rectangle with double precision coordinates.
mxGraphView.prototype.scale
Specifies the scale.
mxGraphView.prototype.translate
mxPoint that specifies the current translation.
Implements a 2-dimensional vector with double precision coordinates.
mxGraphView.prototype.updateStyle
Specifies if the style should be updated in each validation step.
mxGraphView.prototype.getGraphBounds = function()
Returns graphBounds.
mxGraphView.prototype.setGraphBounds = function(value)
Sets graphBounds.
mxGraphView.prototype.getBounds = function(cells)
Returns the bounds (on the screen) for the given array of mxCells.
mxGraph.prototype.sizeDidChange = function()
Called when the size of the graph has changed.
mxGraphView.prototype.revalidate = function()
Revalidates the complete view with all cell states.
mxGraphView.prototype.getScale = function()
Returns the scale.
mxGraphView.prototype.getTranslate = function()
Returns the translate.
mxGraphView.prototype.refresh = function()
Clears the view if currentRoot is not null and revalidates.
mxGraphView.prototype.clear = function(cell,
force,
recurse)
Removes the state of the given cell and all descendants if the given cell is not the current root.
mxGraphView.prototype.invalidate = function(cell,
recurse,
includeEdges,
orderChanged)
Invalidates the state of the given cell, all its descendants and connected edges.
mxGraphView.prototype.validate = function(cell)
First validates all bounds and then validates all points recursively on all visible cells starting at the given cell.
mxGraphView.prototype.createBackgroundPageShape = function(bounds)
Creates and returns the shape used as the background page.
mxGraphView.prototype.validateBackground = function()
Calls validateBackgroundImage and validateBackgroundPage.
mxGraphView.prototype.validateBackgroundImage = function()
Validates the background image.
mxGraphView.prototype.validateBackgroundPage = function()
Validates the background page.
mxGraphView.prototype.getBackgroundPageBounds = function()
Returns the bounds for the background page.
mxGraphView.prototype.redrawBackgroundImage = function(backgroundImage,
bg)
Updates the bounds and redraws the background image.
mxGraphView.prototype.validateBounds = function(parentState,
cell)
Validates the bounds of the given parent’s child using the given parent state as the origin for the child.
mxGraphView.prototype.updateVertexLabelOffset = function(state)
Updates the absoluteOffset of the given vertex cell state.
mxGraphView.prototype.validatePoints = function(parentState,
cell)
Validates the points for the state of the given cell recursively if the cell is not collapsed and returns the bounding box of all visited states as an mxRectangle.
mxGraphView.prototype.childMoved = function(parent,
child)
Invoked when a child state was moved as a result of late evaluation of its position.
mxGraphView.prototype.updateFixedTerminalPoints = function(edge,
source,
target)
Sets the initial absolute terminal points in the given state before the edge style is computed.
mxGraphView.prototype.updateFixedTerminalPoint = function(edge,
terminal,
source,
constraint)
Sets the fixed source or target terminal point on the given edge.
mxGraphView.prototype.updatePoints = function(edge,
points,
source,
target)
Updates the absolute points in the given state using the specified array of mxPoints as the relative points.
mxGraphView.prototype.transformControlPoint = function(state,
pt)
Transforms the given control point to an absolute point.
mxGraphView.prototype.getEdgeStyle = function(edge,
points,
source,
target)
Returns the edge style function to be used to render the given edge state.
mxGraphView.prototype.updateFloatingTerminalPoints = function(state,
source,
target)
Updates the terminal points in the given state after the edge style was computed for the edge.
mxGraphView.prototype.updateFloatingTerminalPoint = function(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.
mxGraphView.prototype.getTerminalPort = function(state,
terminal,
source)
Returns an mxCellState that represents the source or target terminal or port for the given edge.
Represents the current state of a cell in a given mxGraphView.
mxGraphView.prototype.getPerimeterPoint = function(terminal,
next,
orthogonal,
border)
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.
mxGraphView.prototype.getRoutingCenterX = function (state)
Returns the x-coordinate of the center point for automatic routing.
mxGraphView.prototype.getRoutingCenterY = function (state)
Returns the y-coordinate of the center point for automatic routing.
mxGraphView.prototype.getPerimeterBounds = function(terminal,
border)
Returns the perimeter bounds for the given terminal, edge pair as an mxRectangle.
mxGraphView.prototype.getPerimeterFunction = function(state)
Returns the perimeter function for the given state.
mxGraphView.prototype.getNextPoint = function(edge,
opposite,
source)
Returns the nearest point in the list of absolute points or the center of the opposite terminal.
mxGraphView.prototype.getVisibleTerminal = function(edge,
source)
Returns the nearest ancestor terminal that is visible.
mxGraphView.prototype.updateEdgeBounds = function(state)
Updates the given state using the bounding box of the absolute points.
mxGraphView.prototype.getPoint = function(state,
geometry)
Returns the absolute point on the edge for the given relative mxGeometry as an mxPoint.
Extends mxRectangle to represent the geometry of a cell.
mxGraphView.prototype.getRelativePoint = function(edgeState,
x,
y)
Gets the relative point that describes the given, absolute label position for the given edge state.
mxGraphView.prototype.updateEdgeLabelOffset = function(state)
Updates mxCellState.absoluteOffset for the given state.
mxCellState.prototype.absoluteOffset
mxPoint that holds the absolute offset.
mxGraphView.prototype.getState = function(cell,
create)
Returns the mxCellState for the given cell.
mxGraphView.prototype.isRendering = function()
Returns rendering.
mxGraphView.prototype.setRendering = function(value)
Sets rendering.
mxGraphView.prototype.isAllowEval = function()
Returns allowEval.
mxGraphView.prototype.setAllowEval = function(value)
Sets allowEval.
mxGraphView.prototype.getStates = function()
Returns states.
mxGraphView.prototype.setStates = function(value)
Sets states.
mxGraphView.prototype.getCellStates = function(cells)
Returns the mxCellStates for the given array of mxCells.
mxGraphView.prototype.removeState = function(cell)
Removes and returns the mxCellState for the given cell.
mxGraphView.prototype.createState = function(cell)
Creates and returns an mxCellState for the given cell and initializes it using mxCellRenderer.initialize.
mxCellRenderer.prototype.initialize = function(state,
rendering)
Initializes the display for the given cell state.
mxGraphView.prototype.getCanvas = function()
Returns the DOM node that contains the background-, draw- and overlaypane.
mxGraphView.prototype.getBackgroundPane = function()
Returns the DOM node that represents the background layer.
mxGraphView.prototype.getDrawPane = function()
Returns the DOM node that represents the main drawing layer.
mxGraphView.prototype.getOverlayPane = function()
Returns the DOM node that represents the topmost drawing layer.
mxGraphView.prototype.isContainerEvent = function(evt)
Returns true if the event origin is one of the drawing panes or containers of the view.
mxGraphView.prototype.isScrollEvent = function(evt)
Returns true if the event origin is one of the scrollbars of the container in IE.
mxGraphView.prototype.init = function()
Initializes the graph event dispatch loop for the specified container and invokes create to create the required DOM nodes for the display.
mxGraphView.prototype.createHtml = function()
Creates the DOM nodes for the HTML display.
mxGraphView.prototype.installListeners = function()
Installs the required listeners in the container.
mxGraphView.prototype.updateHtmlCanvasSize = function(width,
height)
Updates the size of the HTML canvas.
mxGraphView.prototype.createHtmlPane = function(width,
height)
Creates and returns a drawing pane in HTML (DIV).
mxGraphView.prototype.createVmlPane = function(width,
height)
Creates a drawing pane in VML (group).
mxGraphView.prototype.updateContainerStyle = function(container)
Updates the style of the container after installing the SVG DOM elements.
mxGraphView.prototype.destroy = function()
Destroys the view and all its resources.
function mxCurrentRootChange(view,
root)
Constructs a change of the current root in the given view.
mxCurrentRootChange.prototype.execute = function()
Changes the current root of the view.
Implements a composite undoable edit.
Singleton class that acts as a global converter from string to object values in a style.
Extends mxShape to implement an image shape.
Encapsulates the URL, width and height of an image.
Defines an object that contains the constraints about how to connect one side of an edge to its terminal.
mxCellState.prototype.getVisibleTerminalState = function (source)
Returns the visible source or target terminal state.
mxCellState.prototype.terminalDistance
Caches the distance between the end points for an edge.
mxCellState.prototype.length
Caches the length of an edge.
mxCellState.prototype.segments
Array of numbers that represent the cached length of each segment of the edge.
Close