Package com.mxgraph.analysis
Class mxAnalysisGraph
- java.lang.Object
-
- com.mxgraph.analysis.mxAnalysisGraph
-
public class mxAnalysisGraph extends java.lang.Object
Implements a collection of utility methods abstracting the graph structure taking into account graph properties such as visible/non-visible traversal
-
-
Field Summary
Fields Modifier and Type Field Description protected mxGraphGenerator
generator
protected mxGraph
graph
protected java.util.Map<java.lang.String,java.lang.Object>
properties
-
Constructor Summary
Constructors Constructor Description mxAnalysisGraph()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object[]
getChildCells(java.lang.Object parent, boolean vertices, boolean edges)
java.lang.Object[]
getChildEdges(java.lang.Object parent)
java.lang.Object[]
getChildVertices(java.lang.Object parent)
java.lang.Object[]
getEdges(java.lang.Object cell, java.lang.Object parent, boolean includeLoops, boolean recurse)
Returns the incoming and/or outgoing edges for the given cell.java.lang.Object[]
getEdges(java.lang.Object cell, java.lang.Object parent, boolean incoming, boolean outgoing, boolean includeLoops, boolean recurse)
Returns the incoming and/or outgoing edges for the given cell.mxGraphGenerator
getGenerator()
mxGraph
getGraph()
java.lang.Object[]
getOpposites(java.lang.Object[] edges, java.lang.Object terminal)
Returns all distinct opposite cells for the specified terminal on the given edges.java.lang.Object[]
getOpposites(java.lang.Object[] edges, java.lang.Object terminal, boolean sources, boolean targets)
Returns all distinct opposite cells for the specified terminal on the given edges.java.util.Map<java.lang.String,java.lang.Object>
getProperties()
java.lang.Object
getTerminal(java.lang.Object edge, boolean isSource)
void
setGenerator(mxGraphGenerator generator)
void
setGraph(mxGraph graph)
void
setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
-
-
-
Field Detail
-
properties
protected java.util.Map<java.lang.String,java.lang.Object> properties
-
generator
protected mxGraphGenerator generator
-
graph
protected mxGraph graph
-
-
Method Detail
-
getEdges
public java.lang.Object[] getEdges(java.lang.Object cell, java.lang.Object parent, boolean incoming, boolean outgoing, boolean includeLoops, boolean recurse)
Returns the incoming and/or outgoing edges for the given cell. If the optional parent argument is specified, then only edges are returned where the opposite is in the given parent cell.- Parameters:
cell
- Cell whose edges should be returned.parent
- Optional parent. If specified the opposite end of any edge must be a child of that parent in order for the edge to be returned. The recurse parameter specifies whether or not it must be the direct child or the parent just be an ancestral parent.incoming
- Specifies if incoming edges should be included in the result.outgoing
- Specifies if outgoing edges should be included in the result.includeLoops
- Specifies if loops should be included in the result.recurse
- Specifies if the parent specified only need be an ancestral parent,true
, or the direct parent,false
- Returns:
- Returns the edges connected to the given cell.
-
getEdges
public java.lang.Object[] getEdges(java.lang.Object cell, java.lang.Object parent, boolean includeLoops, boolean recurse)
Returns the incoming and/or outgoing edges for the given cell. If the optional parent argument is specified, then only edges are returned where the opposite is in the given parent cell.- Parameters:
cell
- Cell whose edges should be returned.parent
- Optional parent. If specified the opposite end of any edge must be a child of that parent in order for the edge to be returned. The recurse parameter specifies whether or not it must be the direct child or the parent just be an ancestral parent.includeLoops
- Specifies if loops should be included in the result.recurse
- Specifies if the parent specified only need be an ancestral parent,true
, or the direct parent,false
- Returns:
- Returns the edges connected to the given cell.
-
getChildVertices
public java.lang.Object[] getChildVertices(java.lang.Object parent)
- Parameters:
parent
- the cell whose children will be return- Returns:
- all vertices of the given parent
-
getChildEdges
public java.lang.Object[] getChildEdges(java.lang.Object parent)
- Parameters:
parent
- the cell whose child edges will be return- Returns:
- all edges of the given parent
-
getTerminal
public java.lang.Object getTerminal(java.lang.Object edge, boolean isSource)
- Parameters:
edge
- the whose terminal is being soughtisSource
- whether the source terminal is being sought- Returns:
- the terminal as specified
-
getChildCells
public java.lang.Object[] getChildCells(java.lang.Object parent, boolean vertices, boolean edges)
- Parameters:
parent
-vertices
-edges
-- Returns:
-
getOpposites
public java.lang.Object[] getOpposites(java.lang.Object[] edges, java.lang.Object terminal, boolean sources, boolean targets)
Returns all distinct opposite cells for the specified terminal on the given edges.- Parameters:
edges
- Edges whose opposite terminals should be returned.terminal
- Terminal that specifies the end whose opposite should be returned.sources
- Specifies if source terminals should be included in the result.targets
- Specifies if target terminals should be included in the result.- Returns:
- Returns the cells at the opposite ends of the given edges.
-
getOpposites
public java.lang.Object[] getOpposites(java.lang.Object[] edges, java.lang.Object terminal)
Returns all distinct opposite cells for the specified terminal on the given edges.- Parameters:
edges
- Edges whose opposite terminals should be returned.terminal
- Terminal that specifies the end whose opposite should be returned.- Returns:
- Returns the cells at the opposite ends of the given edges.
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
-
getGraph
public mxGraph getGraph()
-
setGraph
public void setGraph(mxGraph graph)
-
getGenerator
public mxGraphGenerator getGenerator()
-
setGenerator
public void setGenerator(mxGraphGenerator generator)
-
-