info.aduna.linkmap.layout
Class SubgraphRelocationManager

java.lang.Object
  extended by info.aduna.linkmap.layout.GraphLayoutManager
      extended by info.aduna.linkmap.layout.SubgraphRelocationManager
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
LinkGraphLayoutManager, LinkGraphLayoutManager2

public class SubgraphRelocationManager
extends GraphLayoutManager

A SubgraphRelocationManager is a GraphLayoutManager that uses other GraphLayoutManagers to calculate the layout for every connected subgraph of the total Graph, and combines the various parts of the Graph in a rectangular, square-like shape (if possible) so that the total amount of area needed by the Graph is close to minimal.


Field Summary
static int DEFAULT_BASELINE_INTERVAL
          The default value of the baseline interval parameter.
static double DEFAULT_SUBGRAPH_PADDING
          The default value of the subgraph padding parameter.
 
Constructor Summary
SubgraphRelocationManager(GraphLayoutManager subgraphLayoutManager)
          Create a new SubgraphRelocationManager with the specified subgraph GraphLayoutManager, default subgraph padding and (perhaps initially) no GraphRenderer.
SubgraphRelocationManager(GraphLayoutManager subgraphLayoutManager, GraphRenderer renderer)
          Create a new SubgraphRelocationManager with the specified subgraph GraphLayoutManager and GraphRenderer and with default subgraph padding.
SubgraphRelocationManager(GraphLayoutManager subgraphLayoutManager, GraphRenderer renderer, double subgraphPadding)
          Create a new SubgraphRelocationManager calculating layouts using the specified subgraph GraphLayoutManager, GraphRenderer and subgraph padding.
 
Method Summary
 void addSubgraphRelocationListener(SubgraphRelocationListener listener)
          Add a SubgraphRelocationListener to this SubgraphRelocationManager.
 LayoutConverter createLayoutConverter()
          This method passes the invocation to the subgraph layout manager, and returns 'null' when there is none.
 void doLayout()
          Calculates a layout for the complete Graph registered in this SubgraphRelocationManager.
 int getBaselineInterval()
           
 GraphRenderer getGraphRenderer()
           
 GraphLayoutManager getSubgraphLayoutManager()
           
 double getSubgraphPadding()
           
 void initialize(Graph graph)
          Invokes the initialize method of the subgraph GraphLayoutManager.
 void removeSubgraphRelocationListener(SubgraphRelocationListener listener)
          Remove a SubgraphRelocationListener from this SubgraphRelocationManager.
 void setBaselineInterval(int baselineInterval)
           
 void setGraphRenderer(GraphRenderer renderer)
           
 void setSubgraphLayoutManager(GraphLayoutManager subgraphLayoutManager)
           
 void setSubgraphPadding(double subgraphPadding)
           
 void stop()
          Sets a flag that will cause the SubgraphRelocationManager to stop as soon as possible.
 
Methods inherited from class info.aduna.linkmap.layout.GraphLayoutManager
getGraph, run, setGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SUBGRAPH_PADDING

public static final double DEFAULT_SUBGRAPH_PADDING
The default value of the subgraph padding parameter.

See Also:
Constant Field Values

DEFAULT_BASELINE_INTERVAL

public static final int DEFAULT_BASELINE_INTERVAL
The default value of the baseline interval parameter.

See Also:
Constant Field Values
Constructor Detail

SubgraphRelocationManager

public SubgraphRelocationManager(GraphLayoutManager subgraphLayoutManager)
Create a new SubgraphRelocationManager with the specified subgraph GraphLayoutManager, default subgraph padding and (perhaps initially) no GraphRenderer.


SubgraphRelocationManager

public SubgraphRelocationManager(GraphLayoutManager subgraphLayoutManager,
                                 GraphRenderer renderer)
Create a new SubgraphRelocationManager with the specified subgraph GraphLayoutManager and GraphRenderer and with default subgraph padding.


SubgraphRelocationManager

public SubgraphRelocationManager(GraphLayoutManager subgraphLayoutManager,
                                 GraphRenderer renderer,
                                 double subgraphPadding)
Create a new SubgraphRelocationManager calculating layouts using the specified subgraph GraphLayoutManager, GraphRenderer and subgraph padding. The GraphRenderer may be null, in which case the bounding box in layout space is used.

Method Detail

setSubgraphLayoutManager

public void setSubgraphLayoutManager(GraphLayoutManager subgraphLayoutManager)

getSubgraphLayoutManager

public GraphLayoutManager getSubgraphLayoutManager()

setGraphRenderer

public void setGraphRenderer(GraphRenderer renderer)

getGraphRenderer

public GraphRenderer getGraphRenderer()

setSubgraphPadding

public void setSubgraphPadding(double subgraphPadding)

getSubgraphPadding

public double getSubgraphPadding()

setBaselineInterval

public void setBaselineInterval(int baselineInterval)

getBaselineInterval

public int getBaselineInterval()

createLayoutConverter

public LayoutConverter createLayoutConverter()
This method passes the invocation to the subgraph layout manager, and returns 'null' when there is none.

Specified by:
createLayoutConverter in class GraphLayoutManager

initialize

public void initialize(Graph graph)
Invokes the initialize method of the subgraph GraphLayoutManager.

Specified by:
initialize in class GraphLayoutManager

doLayout

public void doLayout()
Calculates a layout for the complete Graph registered in this SubgraphRelocationManager.

Specified by:
doLayout in class GraphLayoutManager

stop

public void stop()
Sets a flag that will cause the SubgraphRelocationManager to stop as soon as possible. The various global starting and finished events (i.e. the events that do not refer to a single subgraph) are still send.


addSubgraphRelocationListener

public void addSubgraphRelocationListener(SubgraphRelocationListener listener)
Add a SubgraphRelocationListener to this SubgraphRelocationManager.


removeSubgraphRelocationListener

public void removeSubgraphRelocationListener(SubgraphRelocationListener listener)
Remove a SubgraphRelocationListener from this SubgraphRelocationManager.



Copyright © 1997-2008 Aduna. All Rights Reserved.