|
JGraphLayout |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgraph.layout.JGraphFacade
com.jgraph.layout.JGraphModelFacade
An abstract description of a graph that can be used by a layout algorithm. This abstracts visibility, grouping, directed edges, any root cells, translation and scaling functions. It also stores the actual graph to be acted upon by the layout and provides utility method to determine the characteristics of the contained cells. After the layout has been applied this class stores the result of that layout as a nested attribute map.
Nested Class Summary |
Nested classes inherited from class com.jgraph.layout.JGraphFacade |
JGraphFacade.CellVisitor, JGraphFacade.DefaultComparator |
Field Summary |
Fields inherited from class com.jgraph.layout.JGraphFacade |
algebra, attributes, circleRadiusFactor, directed, distanceCostFunction, edgePromotion, graph, graphLayoutCache, groupHierarchies, ignoresCellsInGroups, ignoresHiddenCells, ignoresUnconnectedCells, model, order, ordered, roots, verticesFilter |
Constructor Summary | |
JGraphModelFacade(org.jgraph.graph.GraphModel model)
Constructs a JGraphGraphFacade specifying the graph passed in as the input graph |
|
JGraphModelFacade(org.jgraph.graph.GraphModel model,
Object[] roots)
Constructs a JGraphGraphFacade specifying the graph passed in as the input graph |
|
JGraphModelFacade(org.jgraph.graph.GraphModel model,
Object[] roots,
boolean ignoresHiddenCells,
boolean ignoresCellsInGroups,
boolean ignoresUnconnectedCells,
boolean directed)
Constructs a JGraphGraphFacade |
|
JGraphModelFacade(org.jgraph.graph.GraphModel model,
Object[] roots,
boolean ignoresHiddenCells,
boolean ignoresCellsInGroups,
boolean ignoresUnconnectedCells,
boolean directed,
JGraphCostFunction distanceCostFunction,
JGraphAlgebra algebra)
Creates a JGraphGraphFacade specifying the graph passed in as the input graph. |
Method Summary | |
Object[] |
getEdgesBetween(Object cell1,
Object cell2,
boolean directed)
Returns the edges between two specified ports or two specified vertices. |
Rectangle2D |
getGraphBounds()
Returns the minimal rectangular bounds that enclose all the elements in the bounds map. |
List |
getIncomingEdges(Object cell,
Set exclude,
boolean visibleCells,
boolean selfLoops)
Returns the incoming edges for cell. |
List |
getNeighbours(Object cell,
boolean ordered)
A shortcut method that calls getNeighbours with no cells to exclude. |
List |
getNeighbours(Object cell,
Set exclude,
boolean ordered)
Returns a collection of cells that are connected to the specified cell by edges. |
List |
getOutgoingEdges(Object cell,
Set exclude,
boolean visibleCells,
boolean selfLoops)
Returns the outgoing edges for cell. |
boolean |
isEdge(Object cell)
Returns whether or not the specified cell is an edge and should be taken into account by the layout |
boolean |
isVertex(Object cell)
Returns whether or not the specified cell is a vertex and should be taken into account by the layout |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JGraphModelFacade(org.jgraph.graph.GraphModel model)
model
- the GraphModel to be laid outpublic JGraphModelFacade(org.jgraph.graph.GraphModel model, Object[] roots)
model
- the JGraph to be laid outroots
- the root vertices to be used by tree layouts. This is not the
same thing as the roots of the graph model.public JGraphModelFacade(org.jgraph.graph.GraphModel model, Object[] roots, boolean ignoresHiddenCells, boolean ignoresCellsInGroups, boolean ignoresUnconnectedCells, boolean directed)
JGraphModelFacade(GraphModel, Object[], boolean, boolean, boolean, boolean,
JGraphCostFunction, JGraphAlgebra)
public JGraphModelFacade(org.jgraph.graph.GraphModel model, Object[] roots, boolean ignoresHiddenCells, boolean ignoresCellsInGroups, boolean ignoresUnconnectedCells, boolean directed, JGraphCostFunction distanceCostFunction, JGraphAlgebra algebra)
model
- The graph used as input to the layoutroots
- the root vertices to be used by tree layoutsignoresHiddenCells
- ignoresCellsInGroups
- ignoresUnconnectedCells
- directed
- distanceCostFunction
- the cost function that defines the distance metricsalgebra
- the algebra used for basic algorithms and functionsisVertex(java.lang.Object)
,
JGraphFacade.ignoresHiddenCells
,
JGraphFacade.ignoresCellsInGroups
,
JGraphFacade.ignoresUnconnectedCells
,
JGraphFacade.directed
Method Detail |
public boolean isVertex(Object cell)
isVertex
in class JGraphFacade
cell
- the cell that is to be classified as a vertex or not
cell
is a vertexpublic boolean isEdge(Object cell)
isEdge
in class JGraphFacade
cell
- the cell that is to be classified as an edge or not
public List getNeighbours(Object cell, boolean ordered)
getNeighbours
in class JGraphFacade
getNeighbours(Object, Set, boolean)
public List getNeighbours(Object cell, Set exclude, boolean ordered)
getNeighbours
in class JGraphFacade
cell
- The cell from which the neighbours will be determinedexclude
- The set of cells to ignore when searchingordered
- whether or not to order the returned value in the order of the
current order
comparator. Be very careful
using the default comparator on the default graph model,
getIndexOfRoot
has linear performance and so
sorting the entire model roots will have quadratic
performance.
cell
public List getOutgoingEdges(Object cell, Set exclude, boolean visibleCells, boolean selfLoops)
getOutgoingEdges
in class JGraphFacade
cell
- The cell from which the outgoing edges will be determinedexclude
- The set of edges to ignore when searchingvisibleCells
- whether or not only visible cells should be processedselfLoops
- whether or not to include self loops in the returned list
cell
public List getIncomingEdges(Object cell, Set exclude, boolean visibleCells, boolean selfLoops)
getIncomingEdges
in class JGraphFacade
cell
- The cell from which the incoming edges will be determinedexclude
- The set of edges to ignore when searchingvisibleCells
- whether or not only visible cells should be processedselfLoops
- whether or not to include self loops in the returned list
cell
public Rectangle2D getGraphBounds()
bounds
map. After a layout has completed this method
will return the collective bounds of the new laid out graph.
getGraphBounds
in class JGraphFacade
null
public Object[] getEdgesBetween(Object cell1, Object cell2, boolean directed)
cell1
must be the source of the
returned edges.
getEdgesBetween
in class JGraphFacade
cell1
- the first of the pair of cells to find edges betweencell2
- the second of the pair of cells to find edges betweendirected
- whether or not only edges going from cell1
to
cell2
should be returned and not edges in the
other direction
|
JGraphLayout |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |