public final class GridGraphLayout<N,E> extends GraphLayout<N,E>
You can call setChecker method to enable checker style. If the parameter is true, that the layout uses only half of nodes on a grid like a single color on a chess board.
You can define horizontal and vertical gaps between nodes using the setGaps method.
Constructor and Description |
---|
GridGraphLayout()
Creates a grid graph layout.
|
Modifier and Type | Method and Description |
---|---|
protected void |
performGraphLayout(UniversalGraph<N,E> graph)
Performs the grid graph layout on an universal graph.
|
protected void |
performNodesLayout(UniversalGraph<N,E> graph,
Collection<N> nodes)
Should perform nodes layout.
|
GridGraphLayout<N,E> |
setChecker(boolean checker)
Sets a checker style.
|
GridGraphLayout<N,E> |
setGaps(int horizontalGap,
int verticalGap)
Sets horizontal and vertical gap between nodes.
|
addGraphLayoutListener, isAnimated, layoutGraph, layoutGraph, layoutNodes, layoutNodes, removeGraphLayoutListener, setAnimated, setResolvedNodeLocation
public GridGraphLayout<N,E> setChecker(boolean checker)
checker
- if true, then checker style is enabled and nodes are organized like a single color on a chess board.public GridGraphLayout<N,E> setGaps(int horizontalGap, int verticalGap)
horizontalGap
- the horizontal gapverticalGap
- the vertical gapprotected void performGraphLayout(UniversalGraph<N,E> graph)
performGraphLayout
in class GraphLayout<N,E>
graph
- the universal graphprotected void performNodesLayout(UniversalGraph<N,E> graph, Collection<N> nodes)
performNodesLayout
in class GraphLayout<N,E>
graph
- the universal graphnodes
- the collection of nodes to resolve