Class JGraphModelFacade
java.lang.Object
com.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/interfaces inherited from class JGraphFacade
JGraphFacade.CellVisitor, JGraphFacade.DefaultComparator -
Field Summary
Fields inherited from class JGraphFacade
algebra, attributes, circleRadiusFactor, directed, distanceCostFunction, edgePromotion, graph, graphLayoutCache, groupHierarchies, ignoresCellsInGroups, ignoresHiddenCells, ignoresUnconnectedCells, model, order, ordered, roots, verticesFilter -
Constructor Summary
ConstructorsConstructorDescriptionJGraphModelFacade(GraphModel model) Constructs a JGraphGraphFacade specifying the graph passed in as the input graphJGraphModelFacade(GraphModel model, Object[] roots) Constructs a JGraphGraphFacade specifying the graph passed in as the input graphJGraphModelFacade(GraphModel model, Object[] roots, boolean ignoresHiddenCells, boolean ignoresCellsInGroups, boolean ignoresUnconnectedCells, boolean directed) Constructs a JGraphGraphFacadeJGraphModelFacade(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
Modifier and TypeMethodDescriptionReturns the minimal rectangular bounds that enclose all the elements in theboundsmap.getIncomingEdges(Object cell, Set exclude, boolean visibleCells, boolean selfLoops) Returns the incoming edges for cell.getNeighbours(Object cell, boolean ordered) A shortcut method that calls getNeighbours with no cells to exclude.getNeighbours(Object cell, Set exclude, boolean ordered) Returns a collection of cells that are connected to the specified cell by edges.getOutgoingEdges(Object cell, Set exclude, boolean visibleCells, boolean selfLoops) Returns the outgoing edges for cell.Methods inherited from class 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
-
Constructor Details
-
JGraphModelFacade
Constructs a JGraphGraphFacade specifying the graph passed in as the input graph- Parameters:
model- the GraphModel to be laid out
-
JGraphModelFacade
Constructs a JGraphGraphFacade specifying the graph passed in as the input graph- Parameters:
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.
-
JGraphModelFacade
public JGraphModelFacade(GraphModel model, Object[] roots, boolean ignoresHiddenCells, boolean ignoresCellsInGroups, boolean ignoresUnconnectedCells, boolean directed) Constructs a JGraphGraphFacade- See Also:
-
JGraphModelFacade
public JGraphModelFacade(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. 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 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 functions- See Also:
-
-
Method Details
-
getNeighbours
A shortcut method that calls getNeighbours with no cells to exclude.- Overrides:
getNeighboursin classJGraphFacade- See Also:
-
getNeighbours
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:
getNeighboursin classJGraphFacade- Parameters:
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 currentordercomparator. Be very careful using the default comparator on the default graph model,getIndexOfRoothas linear performance and so sorting the entire model roots will have quadratic performance.- Returns:
- Returns the set of neighbours for
cell
-
getOutgoingEdges
Returns the outgoing edges for cell. Cell should be a port or a vertex.- Overrides:
getOutgoingEdgesin classJGraphFacade- Parameters:
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- Returns:
- Returns the list of outgoing edges for
cell
-
getIncomingEdges
Returns the incoming edges for cell. Cell should be a port or a vertex.- Overrides:
getIncomingEdgesin classJGraphFacade- Parameters:
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- Returns:
- Returns the list of incoming edges for
cell
-
getGraphBounds
Returns the minimal rectangular bounds that enclose all the elements in theboundsmap. After a layout has completed this method will return the collective bounds of the new laid out graph.- Overrides:
getGraphBoundsin classJGraphFacade- Returns:
null
-