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

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

org.netbeans.api.visual 2.2

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

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

public abstract class GraphLayout<N,E>
extends Object

This class represents a graph-orinted layout. The layout is invoked using layoutGraph methods. The layoutNodes method could be called for resolving locations of a sub-set of all nodes.

Internally the invoked method creates an UniversalGraph from the scene in the arguments. Then it calls the particular (performGraphLayout or performNodesLayout) methods with the UniversalGraph as a parameter. These protected methods are implemented by the GraphLayout based class and performs particular layout using an UniversalGraph.


Constructor Summary
GraphLayout()
           
 
Method Summary
 void addGraphLayoutListener(GraphLayoutListener<N,E> listener)
          Adds a graph layout listener.
 boolean isAnimated()
          Returns whether the layout uses animations.
 void layoutGraph(GraphPinScene<N,E,?> graphPinScene)
          Invokes graph-oriented layout on a GraphPinScene.
 void layoutGraph(GraphScene<N,E> graphScene)
          Invokes graph-oriented layout on a GraphScene.
 void layoutNodes(GraphPinScene<N,E,?> graphPinScene, Collection<N> nodes)
          Invokes resolving of locations for a collection of nodes in a GraphPinScene.
 void layoutNodes(GraphScene<N,E> graphScene, Collection<N> nodes)
          Invokes resolving of locations for a collection of nodes in a GraphScene.
protected abstract  void performGraphLayout(UniversalGraph<N,E> graph)
          Implements and performs particular graph-oriented algorithm of a UniversalGraph.
protected abstract  void performNodesLayout(UniversalGraph<N,E> graph, Collection<N> nodes)
          Implements and performs particular location resolution of a collection of nodes in a UniversalGraph.
 void removeGraphLayoutListener(GraphLayoutListener<N,E> listener)
          Removes a graph layout listener.
 void setAnimated(boolean animated)
          Sets whether the layout is animated.
protected  void setResolvedNodeLocation(UniversalGraph<N,E> graph, N node, Point newPreferredLocation)
          Should be called to set a new resolved preferred location of a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphLayout

public GraphLayout()
Method Detail

isAnimated

public final boolean isAnimated()
Returns whether the layout uses animations.

Returns:
true if animated

setAnimated

public final void setAnimated(boolean animated)
Sets whether the layout is animated.

Parameters:
animated - if true, then the layout is animated

addGraphLayoutListener

public final void addGraphLayoutListener(GraphLayoutListener<N,E> listener)
Adds a graph layout listener.

Parameters:
listener - the graph layout listener

removeGraphLayoutListener

public final void removeGraphLayoutListener(GraphLayoutListener<N,E> listener)
Removes a graph layout listener.

Parameters:
listener - the graph layout listener

layoutGraph

public final void layoutGraph(GraphScene<N,E> graphScene)
Invokes graph-oriented layout on a GraphScene.

Parameters:
graphScene - the graph scene

layoutGraph

public final void layoutGraph(GraphPinScene<N,E,?> graphPinScene)
Invokes graph-oriented layout on a GraphPinScene.

Parameters:
graphPinScene - the graph pin scene

layoutNodes

public final void layoutNodes(GraphScene<N,E> graphScene,
                              Collection<N> nodes)
Invokes resolving of locations for a collection of nodes in a GraphScene.

Parameters:
graphScene - the graph scene
nodes - the collection of nodes to resolve

layoutNodes

public final void layoutNodes(GraphPinScene<N,E,?> graphPinScene,
                              Collection<N> nodes)
Invokes resolving of locations for a collection of nodes in a GraphPinScene.

Parameters:
graphPinScene - the graph pin scene
nodes - the collection of nodes to resolve

setResolvedNodeLocation

protected final void setResolvedNodeLocation(UniversalGraph<N,E> graph,
                                             N node,
                                             Point newPreferredLocation)
Should be called to set a new resolved preferred location of a node.

Parameters:
graph - the universal graph
node - the node with resolved location
newPreferredLocation - the new resolved location

performGraphLayout

protected abstract void performGraphLayout(UniversalGraph<N,E> graph)
Implements and performs particular graph-oriented algorithm of a UniversalGraph. Call GraphLayout.setResolvedNodeLocation method for setting the resolved node location.

Parameters:
graph - the universal graph on which the layout should be performed

performNodesLayout

protected abstract void performNodesLayout(UniversalGraph<N,E> graph,
                                           Collection<N> nodes)
Implements and performs particular location resolution of a collection of nodes in a UniversalGraph. Call GraphLayout.setResolvedNodeLocation method for setting the resolved node location.

Parameters:
graph - the universal graph on which the nodes should be resolved
nodes - the collection of nodes to be resolved

org.netbeans.api.visual 2.2

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