mxGraphModel
| mxGraphModel | Extends mxEventSource to implement a graph model. |
| Events | |
| mxEvent. | Fires when an undoable edit is dispatched. |
| mxEvent. | Same as mxEvent.CHANGE, this event can be used for classes that need to implement a sync mechanism between this model and, say, a remote model. |
| mxEvent. | Fires between begin- and endUpdate and after an atomic change was executed in the model. |
| mxEvent. | Fires between START_EDIT and END_EDIT after an atomic change was executed. |
| mxEvent. | Fires after the updateLevel was incremented in beginUpdate. |
| mxEvent. | Fires after the updateLevel was changed from 0 to 1. |
| mxEvent. | Fires after the updateLevel was decreased in endUpdate but before any notification or change dispatching. |
| mxEvent. | Fires after the updateLevel was changed from 1 to 0. |
| mxEvent. | Fires before the change is dispatched after the update level has reached 0 in endUpdate. |
| mxEvent.UNDO | Fires after the change was dispatched in endUpdate. |
| Functions | |
| mxGraphModel | Constructs a new graph model. |
| Variables | |
| root | Holds the root cell, which in turn contains the cells that represent the layers of the diagram as child cells. |
| cells | Maps from Ids to cells. |
| maintainEdgeParent | Specifies if edges should automatically be moved into the nearest common ancestor of their terminals. |
| ignoreRelativeEdgeParent | Specifies if relative edge parents should be ignored for finding the nearest common ancestors of an edge’s terminals. |
| createIds | Specifies if the model should automatically create Ids for new cells. |
| prefix | Defines the prefix of new Ids. |
| postfix | Defines the postfix of new Ids. |
| nextId | Specifies the next Id to be created. |
| currentEdit | Holds the changes for the current transaction. |
| updateLevel | Counter for the depth of nested transactions. |
| endingUpdate | True if the program flow is currently inside endUpdate. |
| Functions | |
| clear | Sets a new root using createRoot. |
| isCreateIds | Returns createIds. |
| setCreateIds | Sets createIds. |
| createRoot | Creates a new root cell with a default layer (child 0). |
| getCell | Returns the mxCell for the specified Id or null if no cell can be found for the given Id. |
| filterCells | Returns the cells from the given array where the given filter function returns true. |
| getDescendants | Returns all descendants of the given cell and the cell itself in an array. |
| filterDescendants | Visits all cells recursively and applies the specified filter function to each cell. |
| getRoot | Returns the root of the model or the topmost parent of the given cell. |
| setRoot | Sets the root of the model using mxRootChange and adds the change to the current transaction. |
| rootChanged | Inner callback to change the root of the model and update the internal datastructures, such as cells and nextId. |
| isRoot | Returns true if the given cell is the root of the model and a non-null value. |
| isLayer | Returns true if isRoot returns true for the parent of the given cell. |
| isAncestor | Returns true if the given parent is an ancestor of the given child. |
| contains | Returns true if the model contains the given mxCell. |
| getParent | Returns the parent of the given cell. |
| add | Adds the specified child to the parent at the given index using mxChildChange and adds the change to the current transaction. |
| cellAdded | Inner callback to update cells when a cell has been added. |
| createId | Hook method to create an Id for the specified cell. |
| updateEdgeParents | Updates the parent for all edges that are connected to cell or one of its descendants using updateEdgeParent. |
| updateEdgeParent | Inner callback to update the parent of the specified mxCell to the nearest-common-ancestor of its two terminals. |
| getOrigin | Returns the absolute, accumulated origin for the children inside the given parent as an mxPoint. |
| getNearestCommonAncestor | Returns the nearest common ancestor for the specified cells. |
| remove | Removes the specified cell from the model using mxChildChange and adds the change to the current transaction. |
| cellRemoved | Inner callback to update cells when a cell has been removed. |
| parentForCellChanged | Inner callback to update the parent of a cell using mxCell.insert on the parent and return the previous parent. |
| getChildCount | Returns the number of children in the given cell. |
| getChildAt | Returns the child of the given mxCell at the given index. |
| getChildren | Returns all children of the given mxCell as an array of mxCells. |
| getChildVertices | Returns the child vertices of the given parent. |
| getChildEdges | Returns the child edges of the given parent. |
| getChildCells | Returns the children of the given cell that are vertices and/or edges depending on the arguments. |
| getTerminal | Returns the source or target mxCell of the given edge depending on the value of the boolean parameter. |
| setTerminal | Sets the source or target terminal of the given mxCell using mxTerminalChange and adds the change to the current transaction. |
| setTerminals | Sets the source and target mxCell of the given mxCell in a single transaction using setTerminal for each end of the edge. |
| terminalForCellChanged | Inner helper function to update the terminal of the edge using mxCell.insertEdge and return the previous terminal. |
| getEdgeCount | Returns the number of distinct edges connected to the given cell. |
| getEdgeAt | Returns the edge of cell at the given index. |
| getDirectedEdgeCount | Returns the number of incoming or outgoing edges, ignoring the given edge. |
| getConnections | Returns all edges of the given cell without loops. |
| getIncomingEdges | Returns the incoming edges of the given cell without loops. |
| getOutgoingEdges | Returns the outgoing edges of the given cell without loops. |
| getEdges | Returns all distinct edges connected to this cell as a new array of mxCells. |
| getEdgesBetween | Returns all edges between the given source and target pair. |
| getOpposites | Returns all opposite vertices wrt terminal for the given edges, only returning sources and/or targets as specified. |
| getTopmostCells | Returns the topmost cells of the hierarchy in an array that contains no descendants for each mxCell that it contains. |
| isVertex | Returns true if the given cell is a vertex. |
| isEdge | Returns true if the given cell is an edge. |
| isConnectable | Returns true if the given mxCell is connectable. |
| getValue | Returns the user object of the given mxCell using mxCell.getValue. |
| setValue | Sets the user object of then given mxCell using mxValueChange and adds the change to the current transaction. |
| valueForCellChanged | Inner callback to update the user object of the given mxCell using mxCell.valueChanged and return the previous value, that is, the return value of mxCell.valueChanged. |
| getGeometry | Returns the mxGeometry of the given mxCell. |
| setGeometry | Sets the mxGeometry of the given mxCell. |
| geometryForCellChanged | Inner callback to update the mxGeometry of the given mxCell using mxCell.setGeometry and return the previous mxGeometry. |
| getStyle | Returns the style of the given mxCell. |
| setStyle | Sets the style of the given mxCell using mxStyleChange and adds the change to the current transaction. |
| styleForCellChanged | Inner callback to update the style of the given mxCell using mxCell.setStyle and return the previous style. |
| isCollapsed | Returns true if the given mxCell is collapsed. |
| setCollapsed | Sets the collapsed state of the given mxCell using mxCollapseChange and adds the change to the current transaction. |
| collapsedStateForCellChanged | Inner callback to update the collapsed state of the given mxCell using mxCell.setCollapsed and return the previous collapsed state. |
| isVisible | Returns true if the given mxCell is visible. |
| setVisible | Sets the visible state of the given mxCell using mxVisibleChange and adds the change to the current transaction. |
| visibleStateForCellChanged | Inner callback to update the visible state of the given mxCell using mxCell.setCollapsed and return the previous visible state. |
| execute | Executes the given edit and fires events if required. |
| beginUpdate | Increments the updateLevel by one. |
| endUpdate | Decrements the updateLevel by one and fires an <undo> event if the updateLevel reaches 0. |
| createUndoableEdit | Creates a new mxUndoableEdit that implements the notify function to fire a <change> and <notify> event through the mxUndoableEdit’s source. |
| mergeChildren | Merges the children of the given cell into the given target cell inside this model. |
| mergeChildren | Clones the children of the source cell into the given target cell in this model and adds an entry to the mapping that maps from the source cell to the target cell with the same id or the clone of the source cell that was inserted into this model. |
| getParents | Returns an array that represents the set (no duplicates) of all parents for the given array of cells. |
| cloneCell | Returns a deep clone of the given mxCell (including the children) which is created using cloneCells. |
| cloneCells | Returns an array of clones for the given array of mxCells. |
| cloneCellImpl | Inner helper method for cloning cells recursively. |
| cellCloned | Hook for cloning the cell. |
| restoreClone | Inner helper method for restoring the connections in a network of cloned cells. |
| mxRootChange | Action to change the root in a model. |
| Functions | |
| mxRootChange | Constructs a change of the root in the specified model. |
| execute | Carries out a change of the root using mxGraphModel.rootChanged. |
| mxChildChange | Action to add or remove a child in a model. |
| Functions | |
| mxChildChange | Constructs a change of a child in the specified model. |
| execute | Changes the parent of <child> using mxGraphModel.parentForCellChanged and removes or restores the cell’s connections. |
| disconnect | Disconnects the given cell recursively from its terminals and stores the previous terminal in the cell’s terminals. |
| mxTerminalChange | Action to change a terminal in a model. |
| Functions | |
| mxTerminalChange | Constructs a change of a terminal in the specified model. |
| execute | Changes the terminal of <cell> to <previous> using mxGraphModel.terminalForCellChanged. |
| mxValueChange | Action to change a user object in a model. |
| Functions | |
| mxValueChange | Constructs a change of a user object in the specified model. |
| execute | Changes the value of <cell> to <previous> using mxGraphModel.valueForCellChanged. |
| mxStyleChange | Action to change a cell’s style in a model. |
| Functions | |
| mxStyleChange | Constructs a change of a style in the specified model. |
| execute | Changes the style of <cell> to <previous> using mxGraphModel.styleForCellChanged. |
| mxGeometryChange | Action to change a cell’s geometry in a model. |
| Functions | |
| mxGeometryChange | Constructs a change of a geometry in the specified model. |
| execute | Changes the geometry of <cell> ro <previous> using mxGraphModel.geometryForCellChanged. |
| mxCollapseChange | Action to change a cell’s collapsed state in a model. |
| Functions | |
| mxCollapseChange | Constructs a change of a collapsed state in the specified model. |
| execute | Changes the collapsed state of <cell> to <previous> using mxGraphModel.collapsedStateForCellChanged. |
| mxVisibleChange | Action to change a cell’s visible state in a model. |
| Functions | |
| mxVisibleChange | Constructs a change of a visible state in the specified model. |
| execute | Changes the visible state of <cell> to <previous> using mxGraphModel.visibleStateForCellChanged. |
| mxCellAttributeChange | Action to change the attribute of a cell’s user object. |
| Functions | |
| mxCellAttributeChange | Constructs a change of a attribute of the DOM node stored as the value of the given mxCell. |
| execute | Changes the attribute of the cell’s user object by using mxCell.setAttribute. |