站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

GridGraphLayout (Visual Library API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.api.visual 2.2

org.netbeans.api.visual.graph.layout
Class GridGraphLayout<N,E>

java.lang.Object
  extended by org.netbeans.api.visual.graph.layout.GraphLayout<N,E>
      extended by org.netbeans.api.visual.graph.layout.GridGraphLayout<N,E>

public final class GridGraphLayout<N,E>
extends GraphLayout<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
GridGraphLayout()
          Creates a grid graph layout.
 
Method Summary
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.
 
Methods inherited from class org.netbeans.api.visual.graph.layout.GraphLayout
addGraphLayoutListener, isAnimated, layoutGraph, layoutGraph, layoutNodes, layoutNodes, removeGraphLayoutListener, setAnimated, setResolvedNodeLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridGraphLayout

public GridGraphLayout()
Creates a grid graph layout.

Method Detail

setChecker

public GridGraphLayout<N,E> setChecker(boolean checker)
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

public GridGraphLayout<N,E> setGaps(int horizontalGap,
                                    int verticalGap)
Sets horizontal and vertical gap between nodes.

Parameters:
horizontalGap - the horizontal gap
verticalGap - the vertical gap
Returns:
the instance of the grid graph layout

performGraphLayout

protected void performGraphLayout(UniversalGraph<N,E> graph)
Performs the grid graph layout on an universal graph.

Specified by:
performGraphLayout in class GraphLayout<N,E>
Parameters:
graph - the universal graph

performNodesLayout

protected void performNodesLayout(UniversalGraph<N,E> graph,
                                  Collection<N> nodes)
Should perform nodes layout. Currently unsupported.

Specified by:
performNodesLayout in class GraphLayout<N,E>
Parameters:
graph - the universal graph
nodes - the collection of nodes to resolve

org.netbeans.api.visual 2.2

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.