JGraph
v5.13.0.4


com.jgraph.layout
Class JGraphModelFacade

java.lang.Object
  extended by com.jgraph.layout.JGraphFacade
      extended by com.jgraph.layout.JGraphModelFacade

public class JGraphModelFacade
extends JGraphFacade

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/interfaces 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(GraphModel model)
          Constructs a JGraphGraphFacade specifying the graph passed in as the input graph
JGraphModelFacade(GraphModel model, java.lang.Object[] roots)
          Constructs a JGraphGraphFacade specifying the graph passed in as the input graph
JGraphModelFacade(GraphModel model, java.lang.Object[] roots, boolean ignoresHiddenCells, boolean ignoresCellsInGroups, boolean ignoresUnconnectedCells, boolean directed)
          Constructs a JGraphGraphFacade
JGraphModelFacade(GraphModel model, java.lang.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
 java.awt.geom.Rectangle2D getGraphBounds()
          Returns the minimal rectangular bounds that enclose all the elements in the bounds map.
 java.util.List getIncomingEdges(java.lang.Object cell, java.util.Set exclude, boolean visibleCells, boolean selfLoops)
          Returns the incoming edges for cell.
 java.util.List getNeighbours(java.lang.Object cell, boolean ordered)
          A shortcut method that calls getNeighbours with no cells to exclude.
 java.util.List getNeighbours(java.lang.Object cell, java.util.Set exclude, boolean ordered)
          Returns a collection of cells that are connected to the specified cell by edges.
 java.util.List getOutgoingEdges(java.lang.Object cell, java.util.Set exclude, boolean visibleCells, boolean selfLoops)
          Returns the outgoing edges for cell.
 
Methods inherited from class com.jgraph.layout.JGraphFacade
bfs, circle, createNestedMap, createNestedMap, createNestedMap, determineLayoutHierarchies, dfs, dfs, dfs, disableRouting, findTreeRoots, getAll, getAttributes, getAttributes, getBounds, getBounds, getBounds, getCellBounds, getCells, getCellView, getCircleRadiusFactor, getComponents, getConnectionComponents, getDistance, getEdges, getEdges, getEdges, getEdgesBetween, getGraphOrigin, getGroupHierarchies, getLength, getLocation, getLocations, getMaxSize, getMinimumSpanningTree, getOrder, getPath, getPoints, getRootAt, getRootCount, getRoots, getSize, getSource, getSourcePort, getTarget, getTargetPort, getUnconnectedVertices, getVertices, getVertices, getVerticesFilter, isDirected, isEdge, isEdgePromotion, IsIgnoresCellsInGroups, isIgnoresHiddenCells, isIgnoresUnconnectedCells, isMoveable, isOrdered, isRoot, isVertex, norm, populateGroupHierarchies, randomize, resetControlPoints, resetControlPoints, run, scale, scale, setAttributes, setAttributes, setBounds, setBounds, setBounds, setCircleRadiusFactor, setDirected, setEdgePromotion, setGroupHierarchies, setIgnoresCellsInGroups, setIgnoresHiddenCells, setIgnoresUnconnectedCells, setLocation, setLocation, setLocations, setLoggerLevel, setOrder, setOrdered, setPoints, setRoots, setSize, setVerticesFilter, tilt, translate, translateCells
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGraphModelFacade

public JGraphModelFacade(GraphModel model)
Constructs a JGraphGraphFacade specifying the graph passed in as the input graph

Parameters:
model - the GraphModel to be laid out

JGraphModelFacade

public JGraphModelFacade(GraphModel model,
                         java.lang.Object[] roots)
Constructs a JGraphGraphFacade specifying the graph passed in as the input graph

Parameters:
model - the JGraph to be laid out
roots - the root vertices to be used by tree layouts. This is not the same thing as the roots of the graph model.

JGraphModelFacade

public JGraphModelFacade(GraphModel model,
                         java.lang.Object[] roots,
                         boolean ignoresHiddenCells,
                         boolean ignoresCellsInGroups,
                         boolean ignoresUnconnectedCells,
                         boolean directed)
Constructs a JGraphGraphFacade

See Also:
JGraphModelFacade(GraphModel, Object[], boolean, boolean, boolean, boolean, JGraphCostFunction, JGraphAlgebra)

JGraphModelFacade

public JGraphModelFacade(GraphModel model,
                         java.lang.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. Also configures properties of layout, whether or not edge direction is to be taken into account, whether or not invisible cells are to be considered and whether or not only root cells are to be considered or roots and all their children. A root is only used if the isVertex method returns true.

Parameters:
model - The graph used as input to the layout
roots - the root vertices to be used by tree layouts
ignoresHiddenCells -
ignoresCellsInGroups -
ignoresUnconnectedCells -
directed -
distanceCostFunction - the cost function that defines the distance metrics
algebra - the algebra used for basic algorithms and functions
See Also:
JGraphFacade.isVertex(java.lang.Object), JGraphFacade.ignoresHiddenCells, JGraphFacade.ignoresCellsInGroups, JGraphFacade.ignoresUnconnectedCells, JGraphFacade.directed
Method Detail

getNeighbours

public java.util.List getNeighbours(java.lang.Object cell,
                                    boolean ordered)
A shortcut method that calls getNeighbours with no cells to exclude.

Overrides:
getNeighbours in class JGraphFacade
See Also:
getNeighbours(Object, Set, boolean)

getNeighbours

public java.util.List getNeighbours(java.lang.Object cell,
                                    java.util.Set exclude,
                                    boolean ordered)
Returns a collection of cells that are connected to the specified cell by edges. Any cells specified in the exclude set will be ignored.

Overrides:
getNeighbours in class JGraphFacade
Parameters:
cell - The cell from which the neighbours will be determined
exclude - The set of cells to ignore when searching
ordered - 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.
Returns:
Returns the set of neighbours for cell

getOutgoingEdges

public java.util.List getOutgoingEdges(java.lang.Object cell,
                                       java.util.Set exclude,
                                       boolean visibleCells,
                                       boolean selfLoops)
Returns the outgoing edges for cell. Cell should be a port or a vertex.

Overrides:
getOutgoingEdges in class JGraphFacade
Parameters:
cell - The cell from which the outgoing edges will be determined
exclude - The set of edges to ignore when searching
visibleCells - whether or not only visible cells should be processed
selfLoops - whether or not to include self loops in the returned list
Returns:
Returns the list of outgoing edges for cell

getIncomingEdges

public java.util.List getIncomingEdges(java.lang.Object cell,
                                       java.util.Set exclude,
                                       boolean visibleCells,
                                       boolean selfLoops)
Returns the incoming edges for cell. Cell should be a port or a vertex.

Overrides:
getIncomingEdges in class JGraphFacade
Parameters:
cell - The cell from which the incoming edges will be determined
exclude - The set of edges to ignore when searching
visibleCells - whether or not only visible cells should be processed
selfLoops - whether or not to include self loops in the returned list
Returns:
Returns the list of incoming edges for cell

getGraphBounds

public java.awt.geom.Rectangle2D getGraphBounds()
Returns the minimal rectangular bounds that enclose all the elements in the bounds map. After a layout has completed this method will return the collective bounds of the new laid out graph.

Overrides:
getGraphBounds in class JGraphFacade
Returns:
null

JGraph
v5.13.0.4


Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.