Interface mxIGraphModel
- All Known Implementing Classes:
mxGraphModel
public interface mxIGraphModel
Defines the requirements for a graph model to be used with mxGraph.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDefines the interface for an atomic change of the graph model. -
Method Summary
Modifier and TypeMethodDescriptionAdds the specified child to the parent at the given index.voidaddListener(String eventName, mxEventSource.mxIEventListener listener) Binds the specified function to the given event name.voidIncrements the updateLevel by one.Object[]cloneCells(Object[] cells, boolean includeChildren) Returns an array of clones for the given array of cells.booleanReturns true if the model contains the given cell.voidDecrements the updateLevel by one and fires a notification event if the updateLevel reaches 0.getChildAt(Object parent, int index) Returns the child of the given parent at the given index.intgetChildCount(Object cell) Returns the number of children in the given cell.Returns the edge of cell at the given index.intgetEdgeCount(Object cell) Returns the number of distinct edges connected to the given cell.getGeometry(Object cell) Returns the geometry of the given cell.Returns the parent of the given cell.getRoot()Returns the root of the model or the topmost parent of the given cell.Returns the style of the given cell.getTerminal(Object edge, boolean isSource) Returns the source or target terminal of the given edge depending on the value of the boolean parameter.Returns the user object of the given cell.booleanisAncestor(Object parent, Object child) Returns true if the given parent is an ancestor of the given child.booleanisCollapsed(Object cell) Returns true if the given cell is collapsed.booleanisConnectable(Object cell) Returns true if the given cell is connectable.booleanReturns true if the given cell is an edge.booleanReturns true if the given cell is a vertex.booleanReturns true if the given cell is visible.Removes the specified cell from the model.voidremoveListener(mxEventSource.mxIEventListener listener) Function: removeListener Removes the given listener from the list of listeners.voidremoveListener(mxEventSource.mxIEventListener listener, String eventName) Function: removeListener Removes the given listener from the list of listeners.booleansetCollapsed(Object cell, boolean collapsed) Sets the collapsed state of the given cell.setGeometry(Object cell, mxGeometry geometry) Sets the geometry of the given cell.Sets the root of the model and resets all structures.Sets the style of the given cell.setTerminal(Object edge, Object terminal, boolean isSource) Sets the source or target terminal of the given edge using.Sets the user object of then given cell.booleansetVisible(Object cell, boolean visible) Sets the visible state of the given cell.
-
Method Details
-
getRoot
Object getRoot()Returns the root of the model or the topmost parent of the given cell.- Returns:
- Returns the root cell.
-
setRoot
-
cloneCells
Returns an array of clones for the given array of cells. Depending on the value of includeChildren, a deep clone is created for each cell. Connections are restored based if the corresponding cell is contained in the passed in array.- Parameters:
cells- Array of cells to be cloned.includeChildren- Boolean indicating if the cells should be cloned with all descendants.- Returns:
- Returns a cloned array of cells.
-
isAncestor
-
contains
Returns true if the model contains the given cell.- Parameters:
cell- Cell to be checked.- Returns:
- Returns true if the cell is in the model.
-
getParent
-
add
Adds the specified child to the parent at the given index. If no index is specified then the child is appended to the parent's array of children.- Parameters:
parent- Cell that specifies the parent to contain the child.child- Cell that specifies the child to be inserted.index- Integer that specifies the index of the child.- Returns:
- Returns the inserted child.
-
remove
-
getChildCount
Returns the number of children in the given cell.- Parameters:
cell- Cell whose number of children should be returned.- Returns:
- Returns the number of children in the given cell.
-
getChildAt
-
getTerminal
Returns the source or target terminal of the given edge depending on the value of the boolean parameter.- Parameters:
edge- Cell that specifies the edge.isSource- Boolean indicating which end of the edge should be returned.- Returns:
- Returns the source or target of the given edge.
-
setTerminal
Sets the source or target terminal of the given edge using.- Parameters:
edge- Cell that specifies the edge.terminal- Cell that specifies the new terminal.isSource- Boolean indicating if the terminal is the new source or target terminal of the edge.- Returns:
- Returns the new terminal.
-
getEdgeCount
Returns the number of distinct edges connected to the given cell.- Parameters:
cell- Cell that represents the vertex.- Returns:
- Returns the number of edges connected to cell.
-
getEdgeAt
-
isVertex
Returns true if the given cell is a vertex.- Parameters:
cell- Cell that represents the possible vertex.- Returns:
- Returns true if the given cell is a vertex.
-
isEdge
Returns true if the given cell is an edge.- Parameters:
cell- Cell that represents the possible edge.- Returns:
- Returns true if the given cell is an edge.
-
isConnectable
Returns true if the given cell is connectable.- Parameters:
cell- Cell whose connectable state should be returned.- Returns:
- Returns the connectable state of the given cell.
-
getValue
-
setValue
-
getGeometry
Returns the geometry of the given cell.- Parameters:
cell- Cell whose geometry should be returned.- Returns:
- Returns the geometry of the given cell.
-
setGeometry
Sets the geometry of the given cell.- Parameters:
cell- Cell whose geometry should be changed.geometry- Object that defines the new geometry.- Returns:
- Returns the new geometry.
-
getStyle
-
setStyle
-
isCollapsed
Returns true if the given cell is collapsed.- Parameters:
cell- Cell whose collapsed state should be returned.- Returns:
- Returns the collapsed state of the given cell.
-
setCollapsed
Sets the collapsed state of the given cell.- Parameters:
cell- Cell whose collapsed state should be changed.collapsed- Boolean that specifies the new collpased state.- Returns:
- Returns the new collapsed state.
-
isVisible
Returns true if the given cell is visible.- Parameters:
cell- Cell whose visible state should be returned.- Returns:
- Returns the visible state of the given cell.
-
setVisible
Sets the visible state of the given cell.- Parameters:
cell- Cell whose visible state should be changed.visible- Boolean that specifies the new visible state.- Returns:
- Returns the new visible state.
-
beginUpdate
void beginUpdate()Increments the updateLevel by one. The event notification is queued until updateLevel reaches 0 by use of endUpdate. -
endUpdate
void endUpdate()Decrements the updateLevel by one and fires a notification event if the updateLevel reaches 0. -
addListener
Binds the specified function to the given event name. If no event name is given, then the listener is registered for all events. -
removeListener
Function: removeListener Removes the given listener from the list of listeners. -
removeListener
Function: removeListener Removes the given listener from the list of listeners.
-