org.netbeans.api.visual.graph.layout
Class GraphLayoutFactory
java.lang.Object
org.netbeans.api.visual.graph.layout.GraphLayoutFactory
public class GraphLayoutFactory
- extends Object
The factory class of all built-in GraphLayout based implementations.
- Since:
- 2.4
|
Method Summary |
static
|
createHierarchicalGraphLayout(GraphScene<N,E> graphScene,
boolean animate)
|
static
|
createHierarchicalGraphLayout(GraphScene<N,E> graphScene,
boolean animate,
boolean inverted)
|
static
|
createHierarchicalGraphLayout(GraphScene<N,E> graphScene,
boolean animate,
boolean inverted,
int xOffset,
int layerOffset)
|
static
|
createOrthogonalGraphLayout(GraphScene<N,E> graphScene,
boolean animate)
|
static
|
createTreeGraphLayout(int originX,
int originY,
int verticalGap,
int horizontalGap,
boolean vertical)
Creates a tree graph layout. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphLayoutFactory
public GraphLayoutFactory()
createTreeGraphLayout
public static <N,E> GraphLayout<N,E> createTreeGraphLayout(int originX,
int originY,
int verticalGap,
int horizontalGap,
boolean vertical)
- Creates a tree graph layout.
Use GraphLayoutSupport.setTreeGraphLayoutRootNode method to set the root node of the graph.
If not set/found, then layout is not executed.
Note: Use GraphLayoutSupport.setTreeGraphLayoutProperties method to set the parameters of the layout later.
- Parameters:
originX - the x-axis originoriginY - the y-axis originverticalGap - the vertical gap between cellshorizontalGap - the horizontal gap between cellsvertical - if true, then layout organizes the graph vertically; if false, then horizontally
- Returns:
- the tree graph layout
- Since:
- 2.4
createOrthogonalGraphLayout
public static <N,E> GraphLayout<N,E> createOrthogonalGraphLayout(GraphScene<N,E> graphScene,
boolean animate)
- Type Parameters:
N - the node class for the nodes in the graph.E - the edge class for the edges in the graph.- Parameters:
graphScene - the GraphScene on which the layout is to be invoked.animate - if true, the layout will animate the nodes into their new
positions.
- Returns:
- a GraphLayout to be invoked from the calling class.
createHierarchicalGraphLayout
public static <N,E> GraphLayout<N,E> createHierarchicalGraphLayout(GraphScene<N,E> graphScene,
boolean animate)
- Type Parameters:
N - the node class for the nodes in the graph.E - the edge class for the edges in the graph.- Parameters:
graphScene - the GraphScene on which the layout is to be invoked.animate - if true, the layout will animate the nodes into their new
positions.
- Returns:
- a GraphLayout to be invoked from the calling class.
createHierarchicalGraphLayout
public static <N,E> GraphLayout<N,E> createHierarchicalGraphLayout(GraphScene<N,E> graphScene,
boolean animate,
boolean inverted)
- Type Parameters:
N - the node class for the nodes in the graph.E - the edge class for the edges in the graph.- Parameters:
graphScene - the GraphScene on which the layout is to be invoked.animate - if true, the layout will animate the nodes into their new
positions.inverted - if true, the target nodes of an edge will be poisitioned
in a layer higher than its source node.
- Returns:
- a GraphLayout to be invoked from the calling class.
createHierarchicalGraphLayout
public static <N,E> GraphLayout<N,E> createHierarchicalGraphLayout(GraphScene<N,E> graphScene,
boolean animate,
boolean inverted,
int xOffset,
int layerOffset)
- Type Parameters:
N - the node class for the nodes in the graph.E - the edge class for the edges in the graph.- Parameters:
graphScene - the GraphScene on which the layout is to be invoked.animate - if true, the layout will animate the nodes into their new
positions.inverted - if true, the target nodes of an edge will be poisitioned
in a layer higher than its source node.xOffset - the horizontal distance or gutter between the nodes.layerOffset - the vertical distance between the layers of nodes.
- Returns:
- a GraphLayout to be invoked from the calling class.