public class mxGraphModel extends mxEventSource implements mxIGraphModel, java.io.Serializable
edit
property contains the mxUndoableEdit. The changes
property
contains the list of undoable changes inside the undoable edit. The changes
property is deprecated, please use edit.getChanges() instead.
mxEvent.EXECUTE fires between begin- and endUpdate and after an atomic
change was executed in the model. The change
property contains
the atomic change that was executed.
mxEvent.BEGIN_UPDATE fires after the updateLevel was incremented in
beginUpdate. This event contains no properties.
mxEvent.END_UPDATE fires after the updateLevel was decreased in endUpdate
but before any notification or change dispatching. The edit
property contains the current mxUndoableEdit.
mxEvent.BEFORE_UNDO fires before the change is dispatched after the update
level has reached 0 in endUpdate. The edit
property contains
the current mxUndoableEdit.
mxEvent.UNDO fires after the change was dispatched in endUpdate. The
edit
property contains the current mxUndoableEdit.Modifier and Type | Class and Description |
---|---|
static interface |
mxGraphModel.Filter |
static class |
mxGraphModel.mxChildChange |
static class |
mxGraphModel.mxCollapseChange |
static class |
mxGraphModel.mxGeometryChange |
static class |
mxGraphModel.mxRootChange |
static class |
mxGraphModel.mxStyleChange |
static class |
mxGraphModel.mxTerminalChange |
static class |
mxGraphModel.mxValueChange |
static class |
mxGraphModel.mxVisibleChange |
mxEventSource.mxIEventListener
mxIGraphModel.mxAtomicGraphModelChange
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
cells
Maps from Ids to cells.
|
protected boolean |
createIds
Specifies if the model should automatically create Ids for new cells.
|
protected mxUndoableEdit |
currentEdit
Holds the changes for the current transaction.
|
protected boolean |
endingUpdate |
protected boolean |
maintainEdgeParent
Specifies if edges should automatically be moved into the nearest common
ancestor of their terminals.
|
protected int |
nextId
Specifies the next Id to be created.
|
protected mxICell |
root
Holds the root cell, which in turn contains the cells that represent the
layers of the diagram as child cells.
|
protected int |
updateLevel
Counter for the depth of nested transactions.
|
eventListeners, eventsEnabled, eventSource
Constructor and Description |
---|
mxGraphModel()
Constructs a new empty graph model.
|
mxGraphModel(java.lang.Object root)
Constructs a new graph model.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
add(java.lang.Object parent,
java.lang.Object child,
int index)
Adds the specified child to the parent at the given index.
|
void |
beginUpdate()
Increments the updateLevel by one.
|
protected void |
cellAdded(java.lang.Object cell)
Invoked after a cell has been added to a parent.
|
protected void |
cellRemoved(java.lang.Object cell)
Invoked after a cell has been removed from the model.
|
void |
clear()
Sets a new root using createRoot.
|
protected java.lang.Object |
cloneCell(java.lang.Object cell,
java.util.Map<java.lang.Object,java.lang.Object> mapping,
boolean includeChildren)
Inner helper method for cloning cells recursively.
|
java.lang.Object[] |
cloneCells(java.lang.Object[] cells,
boolean includeChildren)
Returns an array of clones for the given array of cells.
|
protected boolean |
collapsedStateForCellChanged(java.lang.Object cell,
boolean collapsed)
Inner callback to update the collapsed state of the
given mxCell using mxCell.setCollapsed and return
the previous collapsed state.
|
boolean |
contains(java.lang.Object cell)
Returns true if the model contains the given cell.
|
java.lang.String |
createId(java.lang.Object cell)
Creates a new Id for the given cell and increments the global counter
for creating new Ids.
|
java.lang.Object |
createRoot()
Creates a new root cell with a default layer (child 0).
|
protected mxUndoableEdit |
createUndoableEdit()
Creates a new undoable edit.
|
void |
endUpdate()
Decrements the updateLevel by one and fires a notification event if the
updateLevel reaches 0.
|
void |
execute(mxIGraphModel.mxAtomicGraphModelChange change)
Executes the given atomic change and adds it to the current edit.
|
static java.lang.Object[] |
filterCells(java.lang.Object[] cells,
mxGraphModel.Filter filter) |
static java.util.Collection<java.lang.Object> |
filterDescendants(mxIGraphModel model,
mxGraphModel.Filter filter)
Creates a collection of cells using the visitor pattern.
|
static java.util.Collection<java.lang.Object> |
filterDescendants(mxIGraphModel model,
mxGraphModel.Filter filter,
java.lang.Object parent)
Creates a collection of cells using the visitor pattern.
|
protected mxGeometry |
geometryForCellChanged(java.lang.Object cell,
mxGeometry geometry)
Inner callback to update the mxGeometry of the given mxCell using
mxCell.setGeometry and return the previous mxGeometry.
|
java.lang.Object |
getCell(java.lang.String id)
Returns the cell for the specified Id or null if no cell can be
found for the given Id.
|
java.util.Map<java.lang.String,java.lang.Object> |
getCells()
Returns the internal lookup table that is used to map from Ids to cells.
|
java.lang.Object |
getChildAt(java.lang.Object parent,
int index)
Returns the child of the given parent at the given index.
|
static java.lang.Object[] |
getChildCells(mxIGraphModel model,
java.lang.Object parent,
boolean vertices,
boolean edges)
Returns the children of the given cell that are vertices and/or edges
depending on the arguments.
|
int |
getChildCount(java.lang.Object cell)
Returns the number of children in the given cell.
|
static java.lang.Object[] |
getChildEdges(mxIGraphModel model,
java.lang.Object parent)
Returns the child edges of the given parent.
|
static java.lang.Object[] |
getChildren(mxIGraphModel model,
java.lang.Object parent)
Returns all children of the given cell regardless of their type.
|
static java.lang.Object[] |
getChildVertices(mxIGraphModel model,
java.lang.Object parent)
Returns the child vertices of the given parent.
|
static java.lang.Object[] |
getConnections(mxIGraphModel model,
java.lang.Object cell)
Returns all edges connected to this cell without loops.
|
static java.util.Collection<java.lang.Object> |
getDescendants(mxIGraphModel model,
java.lang.Object parent)
Returns a all descendants of the given cell and the cell itself
as a collection.
|
static int |
getDirectedEdgeCount(mxIGraphModel model,
java.lang.Object cell,
boolean outgoing)
Returns the number of incoming or outgoing edges.
|
static int |
getDirectedEdgeCount(mxIGraphModel model,
java.lang.Object cell,
boolean outgoing,
java.lang.Object ignoredEdge)
Returns the number of incoming or outgoing edges, ignoring the given
edge.
|
java.lang.Object |
getEdgeAt(java.lang.Object parent,
int index)
Returns the edge of cell at the given index.
|
int |
getEdgeCount(java.lang.Object cell)
Returns the number of distinct edges connected to the given cell.
|
static java.lang.Object[] |
getEdges(mxIGraphModel model,
java.lang.Object cell)
Returns all edges connected to this cell including loops.
|
static java.lang.Object[] |
getEdges(mxIGraphModel model,
java.lang.Object cell,
boolean incoming,
boolean outgoing,
boolean includeLoops)
Returns all distinct edges connected to this cell.
|
static java.lang.Object[] |
getEdgesBetween(mxIGraphModel model,
java.lang.Object source,
java.lang.Object target)
Returns all edges from the given source to the given target.
|
static java.lang.Object[] |
getEdgesBetween(mxIGraphModel model,
java.lang.Object source,
java.lang.Object target,
boolean directed)
Returns all edges between the given source and target pair.
|
mxGeometry |
getGeometry(java.lang.Object cell)
Returns the geometry of the given cell.
|
static java.lang.Object[] |
getIncomingEdges(mxIGraphModel model,
java.lang.Object cell)
Returns the incoming edges of the given cell without loops.
|
java.lang.Object |
getNearestCommonAncestor(java.lang.Object cell1,
java.lang.Object cell2)
Returns the nearest common ancestor for the specified cells.
|
static java.lang.Object[] |
getOpposites(mxIGraphModel model,
java.lang.Object[] edges,
java.lang.Object terminal)
Returns all opposite cells of terminal for the given edges.
|
static java.lang.Object[] |
getOpposites(mxIGraphModel model,
java.lang.Object[] edges,
java.lang.Object terminal,
boolean sources,
boolean targets)
Returns all opposite vertices wrt terminal for the given edges, only
returning sources and/or targets as specified.
|
mxPoint |
getOrigin(java.lang.Object cell)
Returns the absolute, accumulated origin for the children inside the
given parent.
|
static java.lang.Object[] |
getOutgoingEdges(mxIGraphModel model,
java.lang.Object cell)
Returns the outgoing edges of the given cell without loops.
|
java.lang.Object |
getParent(java.lang.Object child)
Returns the parent of the given cell.
|
static java.lang.Object[] |
getParents(mxIGraphModel model,
java.lang.Object[] cells) |
java.lang.Object |
getRoot()
Returns the root of the model or the topmost parent of the given cell.
|
java.lang.String |
getStyle(java.lang.Object cell)
Returns the style of the given cell.
|
java.lang.Object |
getTerminal(java.lang.Object edge,
boolean isSource)
Returns the source or target terminal of the given edge depending on the
value of the boolean parameter.
|
static java.lang.Object[] |
getTopmostCells(mxIGraphModel model,
java.lang.Object[] cells)
Function: getTopmostCells
Returns the topmost cells of the hierarchy in an array that contains no
desceandants for each
|
int |
getUpdateLevel() |
java.lang.Object |
getValue(java.lang.Object cell)
Returns the user object of the given cell.
|
boolean |
isAncestor(java.lang.Object parent,
java.lang.Object child)
Returns true if the given parent is an ancestor of the given child.
|
boolean |
isCollapsed(java.lang.Object cell)
Returns true if the given cell is collapsed.
|
boolean |
isConnectable(java.lang.Object cell)
Returns true if the given cell is connectable.
|
boolean |
isCreateIds()
Returns true if the model automatically creates Ids and resolves Id
collisions.
|
boolean |
isEdge(java.lang.Object cell)
Returns true if the given cell is an edge.
|
boolean |
isMaintainEdgeParent()
Returns true if the model automatically update parents of edges so that
the edge is contained in the nearest-common-ancestor of its terminals.
|
boolean |
isVertex(java.lang.Object cell)
Returns true if the given cell is a vertex.
|
boolean |
isVisible(java.lang.Object cell)
Returns true if the given cell is visible.
|
void |
mergeChildren(mxICell from,
mxICell to,
boolean cloneAllEdges)
Merges the children of the given cell into the given target cell inside
this model.
|
protected void |
mergeChildrenImpl(mxICell from,
mxICell to,
boolean cloneAllEdges,
java.util.Hashtable<java.lang.Object,java.lang.Object> mapping)
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.
|
protected java.lang.Object |
parentForCellChanged(java.lang.Object cell,
java.lang.Object parent,
int index)
Inner callback to update the parent of a cell using mxCell.insert
on the parent and return the previous parent.
|
java.lang.Object |
remove(java.lang.Object cell)
Removes the specified cell from the model.
|
protected void |
restoreClone(java.lang.Object clone,
java.lang.Object cell,
java.util.Map<java.lang.Object,java.lang.Object> mapping)
Inner helper method for restoring the connections in
a network of cloned cells.
|
protected java.lang.Object |
rootChanged(java.lang.Object root)
Inner callback to change the root of the model and update the internal
datastructures, such as cells and nextId.
|
boolean |
setCollapsed(java.lang.Object cell,
boolean collapsed)
Sets the collapsed state of the given cell.
|
void |
setCreateIds(boolean value)
Specifies if the model automatically creates Ids for new cells and
resolves Id collisions.
|
mxGeometry |
setGeometry(java.lang.Object cell,
mxGeometry geometry)
Sets the geometry of the given cell.
|
void |
setMaintainEdgeParent(boolean maintainEdgeParent)
Specifies if the model automatically updates parents of edges so that
the edge is contained in the nearest-common-ancestor of its terminals.
|
java.lang.Object |
setRoot(java.lang.Object root)
Sets the root of the model and resets all structures.
|
java.lang.String |
setStyle(java.lang.Object cell,
java.lang.String style)
Sets the style of the given cell.
|
java.lang.Object |
setTerminal(java.lang.Object edge,
java.lang.Object terminal,
boolean isSource)
Sets the source or target terminal of the given edge using.
|
static void |
setTerminals(mxIGraphModel model,
java.lang.Object edge,
java.lang.Object source,
java.lang.Object target)
Sets the source and target of the given edge in a single atomic change.
|
java.lang.Object |
setValue(java.lang.Object cell,
java.lang.Object value)
Sets the user object of then given cell.
|
boolean |
setVisible(java.lang.Object cell,
boolean visible)
Sets the visible state of the given cell.
|
protected java.lang.String |
styleForCellChanged(java.lang.Object cell,
java.lang.String style)
Inner callback to update the style of the given mxCell
using mxCell.setStyle and return the previous style.
|
protected java.lang.Object |
terminalForCellChanged(java.lang.Object edge,
java.lang.Object terminal,
boolean isSource)
Inner helper function to update the terminal of the edge using
mxCell.insertEdge and return the previous terminal.
|
void |
updateEdgeParent(java.lang.Object edge,
java.lang.Object root)
Inner helper method to update the parent of the specified edge to the
nearest-common-ancestor of its two terminals.
|
void |
updateEdgeParents(java.lang.Object cell)
Updates the parents of the edges connected to the given cell and all its
descendants so that each edge is contained in the nearest common
ancestor.
|
void |
updateEdgeParents(java.lang.Object cell,
java.lang.Object root)
Updates the parents of the edges connected to the given cell and all its
descendants so that the edge is contained in the nearest-common-ancestor.
|
protected java.lang.Object |
valueForCellChanged(java.lang.Object cell,
java.lang.Object value)
Inner callback to update the user object of the given mxCell
using mxCell.setValue and return the previous value,
that is, the return value of mxCell.getValue.
|
protected boolean |
visibleStateForCellChanged(java.lang.Object cell,
boolean visible)
Sets the visible state of the given mxCell using mxVisibleChange and
adds the change to the current transaction.
|
addListener, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, removeListener, removeListener
protected mxICell root
protected java.util.Map<java.lang.String,java.lang.Object> cells
protected boolean maintainEdgeParent
protected boolean createIds
protected int nextId
protected transient mxUndoableEdit currentEdit
protected transient int updateLevel
protected transient boolean endingUpdate
public mxGraphModel()
public mxGraphModel(java.lang.Object root)
root
- Cell that represents the root cell.public void clear()
public int getUpdateLevel()
public java.lang.Object createRoot()
public java.util.Map<java.lang.String,java.lang.Object> getCells()
public java.lang.Object getCell(java.lang.String id)
id
- A string representing the Id of the cell.public boolean isMaintainEdgeParent()
public void setMaintainEdgeParent(boolean maintainEdgeParent)
maintainEdgeParent
- Boolean indicating if the model should
maintain edge parents.public boolean isCreateIds()
public void setCreateIds(boolean value)
value
- Boolean indicating if the model should created Ids.public java.lang.Object getRoot()
mxIGraphModel
getRoot
in interface mxIGraphModel
public java.lang.Object setRoot(java.lang.Object root)
mxIGraphModel
setRoot
in interface mxIGraphModel
root
- Cell that specifies the new root.protected java.lang.Object rootChanged(java.lang.Object root)
protected mxUndoableEdit createUndoableEdit()
public java.lang.Object[] cloneCells(java.lang.Object[] cells, boolean includeChildren)
mxIGraphModel
cloneCells
in interface mxIGraphModel
cells
- Array of cells to be cloned.includeChildren
- Boolean indicating if the cells should be cloned
with all descendants.protected java.lang.Object cloneCell(java.lang.Object cell, java.util.Map<java.lang.Object,java.lang.Object> mapping, boolean includeChildren) throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
protected void restoreClone(java.lang.Object clone, java.lang.Object cell, java.util.Map<java.lang.Object,java.lang.Object> mapping)
public boolean isAncestor(java.lang.Object parent, java.lang.Object child)
mxIGraphModel
isAncestor
in interface mxIGraphModel
parent
- Cell that specifies the parent.child
- Cell that specifies the child.public boolean contains(java.lang.Object cell)
mxIGraphModel
contains
in interface mxIGraphModel
cell
- Cell to be checked.public java.lang.Object getParent(java.lang.Object child)
mxIGraphModel
getParent
in interface mxIGraphModel
child
- Cell whose parent should be returned.public java.lang.Object add(java.lang.Object parent, java.lang.Object child, int index)
mxIGraphModel
add
in interface mxIGraphModel
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.protected void cellAdded(java.lang.Object cell)
cell
- Cell that has been added.public java.lang.String createId(java.lang.Object cell)
cell
- Cell for which a new Id should be created.public java.lang.Object remove(java.lang.Object cell)
mxIGraphModel
remove
in interface mxIGraphModel
cell
- Cell that should be removed.protected void cellRemoved(java.lang.Object cell)
cell
- Cell that has been removed.protected java.lang.Object parentForCellChanged(java.lang.Object cell, java.lang.Object parent, int index)
public int getChildCount(java.lang.Object cell)
mxIGraphModel
getChildCount
in interface mxIGraphModel
cell
- Cell whose number of children should be returned.public java.lang.Object getChildAt(java.lang.Object parent, int index)
mxIGraphModel
getChildAt
in interface mxIGraphModel
parent
- Cell that represents the parent.index
- Integer that specifies the index of the child to be
returned.public java.lang.Object getTerminal(java.lang.Object edge, boolean isSource)
mxIGraphModel
getTerminal
in interface mxIGraphModel
edge
- Cell that specifies the edge.isSource
- Boolean indicating which end of the edge should be
returned.public java.lang.Object setTerminal(java.lang.Object edge, java.lang.Object terminal, boolean isSource)
mxIGraphModel
setTerminal
in interface mxIGraphModel
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.protected java.lang.Object terminalForCellChanged(java.lang.Object edge, java.lang.Object terminal, boolean isSource)
public void updateEdgeParents(java.lang.Object cell)
cell
- Cell whose edges should be checked and updated.public void updateEdgeParents(java.lang.Object cell, java.lang.Object root)
cell
- Cell whose edges should be checked and updated.root
- Root of the cell hierarchy that contains all cells.public void updateEdgeParent(java.lang.Object edge, java.lang.Object root)
edge
- Specifies the edge to be updated.root
- Current root of the model.public mxPoint getOrigin(java.lang.Object cell)
public java.lang.Object getNearestCommonAncestor(java.lang.Object cell1, java.lang.Object cell2)
cell1
- Cell that specifies the first cell in the tree.cell2
- Cell that specifies the second cell in the tree.public int getEdgeCount(java.lang.Object cell)
mxIGraphModel
getEdgeCount
in interface mxIGraphModel
cell
- Cell that represents the vertex.public java.lang.Object getEdgeAt(java.lang.Object parent, int index)
mxIGraphModel
getEdgeAt
in interface mxIGraphModel
parent
- Cell that specifies the vertex.index
- Integer that specifies the index of the edge to return.public boolean isVertex(java.lang.Object cell)
mxIGraphModel
isVertex
in interface mxIGraphModel
cell
- Cell that represents the possible vertex.public boolean isEdge(java.lang.Object cell)
mxIGraphModel
isEdge
in interface mxIGraphModel
cell
- Cell that represents the possible edge.public boolean isConnectable(java.lang.Object cell)
mxIGraphModel
isConnectable
in interface mxIGraphModel
cell
- Cell whose connectable state should be returned.public java.lang.Object getValue(java.lang.Object cell)
mxIGraphModel
getValue
in interface mxIGraphModel
cell
- Cell whose user object should be returned.public java.lang.Object setValue(java.lang.Object cell, java.lang.Object value)
mxIGraphModel
setValue
in interface mxIGraphModel
cell
- Cell whose user object should be changed.value
- Object that defines the new user object.protected java.lang.Object valueForCellChanged(java.lang.Object cell, java.lang.Object value)
public mxGeometry getGeometry(java.lang.Object cell)
mxIGraphModel
getGeometry
in interface mxIGraphModel
cell
- Cell whose geometry should be returned.public mxGeometry setGeometry(java.lang.Object cell, mxGeometry geometry)
mxIGraphModel
setGeometry
in interface mxIGraphModel
cell
- Cell whose geometry should be changed.geometry
- Object that defines the new geometry.protected mxGeometry geometryForCellChanged(java.lang.Object cell, mxGeometry geometry)
public java.lang.String getStyle(java.lang.Object cell)
mxIGraphModel
getStyle
in interface mxIGraphModel
cell
- Cell whose style should be returned.public java.lang.String setStyle(java.lang.Object cell, java.lang.String style)
mxIGraphModel
setStyle
in interface mxIGraphModel
cell
- Cell whose style should be changed.style
- String of the form stylename[;key=value] to specify
the new cell style.protected java.lang.String styleForCellChanged(java.lang.Object cell, java.lang.String style)
public boolean isCollapsed(java.lang.Object cell)
mxIGraphModel
isCollapsed
in interface mxIGraphModel
cell
- Cell whose collapsed state should be returned.public boolean setCollapsed(java.lang.Object cell, boolean collapsed)
mxIGraphModel
setCollapsed
in interface mxIGraphModel
cell
- Cell whose collapsed state should be changed.collapsed
- Boolean that specifies the new collpased state.protected boolean collapsedStateForCellChanged(java.lang.Object cell, boolean collapsed)
public boolean isVisible(java.lang.Object cell)
mxIGraphModel
isVisible
in interface mxIGraphModel
cell
- Cell whose visible state should be returned.public boolean setVisible(java.lang.Object cell, boolean visible)
mxIGraphModel
setVisible
in interface mxIGraphModel
cell
- Cell whose visible state should be changed.visible
- Boolean that specifies the new visible state.protected boolean visibleStateForCellChanged(java.lang.Object cell, boolean visible)
public void execute(mxIGraphModel.mxAtomicGraphModelChange change)
change
- Atomic change to be executed.public void beginUpdate()
mxIGraphModel
beginUpdate
in interface mxIGraphModel
public void endUpdate()
mxIGraphModel
endUpdate
in interface mxIGraphModel
public void mergeChildren(mxICell from, mxICell to, boolean cloneAllEdges) throws java.lang.CloneNotSupportedException
from
- to
- cloneAllEdges
- java.lang.CloneNotSupportedException
protected void mergeChildrenImpl(mxICell from, mxICell to, boolean cloneAllEdges, java.util.Hashtable<java.lang.Object,java.lang.Object> mapping) throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public static int getDirectedEdgeCount(mxIGraphModel model, java.lang.Object cell, boolean outgoing)
model
- Graph model that contains the connection data.cell
- Cell whose edges should be counted.outgoing
- Boolean that specifies if the number of outgoing or
incoming edges should be returned.public static int getDirectedEdgeCount(mxIGraphModel model, java.lang.Object cell, boolean outgoing, java.lang.Object ignoredEdge)
model
- Graph model that contains the connection data.cell
- Cell whose edges should be counted.outgoing
- Boolean that specifies if the number of outgoing or
incoming edges should be returned.ignoredEdge
- Object that represents an edge to be ignored.public static java.lang.Object[] getEdges(mxIGraphModel model, java.lang.Object cell)
model
- Model that contains the connection information.cell
- Cell whose connections should be returned.public static java.lang.Object[] getConnections(mxIGraphModel model, java.lang.Object cell)
model
- Model that contains the connection information.cell
- Cell whose connections should be returned.public static java.lang.Object[] getIncomingEdges(mxIGraphModel model, java.lang.Object cell)
model
- Graphmodel that contains the edges.cell
- Cell whose incoming edges should be returned.public static java.lang.Object[] getOutgoingEdges(mxIGraphModel model, java.lang.Object cell)
model
- Graphmodel that contains the edges.cell
- Cell whose outgoing edges should be returned.public static java.lang.Object[] getEdges(mxIGraphModel model, java.lang.Object cell, boolean incoming, boolean outgoing, boolean includeLoops)
model
- Model that contains the connection information.cell
- Cell whose connections should be returned.incoming
- Specifies if incoming edges should be returned.outgoing
- Specifies if outgoing edges should be returned.includeLoops
- Specifies if loops should be returned.public static java.lang.Object[] getEdgesBetween(mxIGraphModel model, java.lang.Object source, java.lang.Object target)
model
- The graph model that contains the graph.source
- Object that defines the source cell.target
- Object that defines the target cell.public static java.lang.Object[] getEdgesBetween(mxIGraphModel model, java.lang.Object source, java.lang.Object target, boolean directed)
model
- The graph model that contains the graph.source
- Object that defines the source cell.target
- Object that defines the target cell.directed
- Boolean that specifies if the direction of the edge
should be taken into account.public static java.lang.Object[] getOpposites(mxIGraphModel model, java.lang.Object[] edges, java.lang.Object terminal)
model
- Model that contains the connection information.edges
- Array of edges to be examined.terminal
- Cell that specifies the known end of the edges.public static java.lang.Object[] getOpposites(mxIGraphModel model, java.lang.Object[] edges, java.lang.Object terminal, boolean sources, boolean targets)
model
- Model that contains the connection information.edges
- Array of edges to be examined.terminal
- Cell that specifies the known end of the edges.sources
- Boolean that specifies if source terminals should
be contained in the result. Default is true.targets
- Boolean that specifies if target terminals should
be contained in the result. Default is true.public static void setTerminals(mxIGraphModel model, java.lang.Object edge, java.lang.Object source, java.lang.Object target)
edge
- Cell that specifies the edge.source
- Cell that specifies the new source terminal.target
- Cell that specifies the new target terminal.public static java.lang.Object[] getChildren(mxIGraphModel model, java.lang.Object parent)
model
- Model that contains the hierarchical information.parent
- Cell whose child vertices or edges should be returned.public static java.lang.Object[] getChildVertices(mxIGraphModel model, java.lang.Object parent)
model
- Model that contains the hierarchical information.parent
- Cell whose child vertices should be returned.public static java.lang.Object[] getChildEdges(mxIGraphModel model, java.lang.Object parent)
model
- Model that contains the hierarchical information.parent
- Cell whose child edges should be returned.public static java.lang.Object[] getChildCells(mxIGraphModel model, java.lang.Object parent, boolean vertices, boolean edges)
model
- Model that contains the hierarchical information.parent
- Cell whose child vertices or edges should be returned.vertices
- Boolean indicating if child vertices should be returned.edges
- Boolean indicating if child edges should be returned.public static java.lang.Object[] getParents(mxIGraphModel model, java.lang.Object[] cells)
public static java.lang.Object[] filterCells(java.lang.Object[] cells, mxGraphModel.Filter filter)
public static java.util.Collection<java.lang.Object> getDescendants(mxIGraphModel model, java.lang.Object parent)
public static java.util.Collection<java.lang.Object> filterDescendants(mxIGraphModel model, mxGraphModel.Filter filter)
public static java.util.Collection<java.lang.Object> filterDescendants(mxIGraphModel model, mxGraphModel.Filter filter, java.lang.Object parent)
public static java.lang.Object[] getTopmostCells(mxIGraphModel model, java.lang.Object[] cells)
Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.