Class GridGraphLayout<N,E>
java.lang.Object
org.netbeans.api.visual.graph.layout.GraphLayout<N,E>
org.netbeans.api.visual.graph.layout.GridGraphLayout<N,E>
This class represents a graph-oriented layout which organizes nodes into a grid.
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.setChecker
(boolean checker) Sets a checker style.setGaps
(int horizontalGap, int verticalGap) Sets horizontal and vertical gap between nodes.Methods inherited from class org.netbeans.api.visual.graph.layout.GraphLayout
addGraphLayoutListener, isAnimated, layoutGraph, layoutGraph, layoutNodes, layoutNodes, removeGraphLayoutListener, setAnimated, setResolvedNodeLocation
-
Constructor Details
-
GridGraphLayout
public GridGraphLayout()Creates a grid graph layout.
-
-
Method Details
-
setChecker
Sets a checker style.- Parameters:
checker
- if true, then checker style is enabled and nodes are organized like a single color on a chess board.- Returns:
- the instance of the grid graph layout
-
setGaps
Sets horizontal and vertical gap between nodes.- Parameters:
horizontalGap
- the horizontal gapverticalGap
- the vertical gap- Returns:
- the instance of the grid graph layout
-
performGraphLayout
Performs the grid graph layout on an universal graph.- Specified by:
performGraphLayout
in classGraphLayout<N,
E> - Parameters:
graph
- the universal graph
-
performNodesLayout
Should perform nodes layout. Currently unsupported.- Specified by:
performNodesLayout
in classGraphLayout<N,
E> - Parameters:
graph
- the universal graphnodes
- the collection of nodes to resolve
-