JGraph
v5.13.0.0


com.jgraph.layout
Class JGraphCompoundLayout

java.lang.Object
  extended by com.jgraph.layout.JGraphCompoundLayout
All Implemented Interfaces:
JGraphLayout

public class JGraphCompoundLayout
extends Object
implements JGraphLayout

This allows to recursively compose any number of abstract layouts into a compound abstract layout. Note that this is more flexible than a decorator pattern, because you can use different class hierarchies to implement the input (facade) and the layout algorithms, while adhering to the rule that each layout algorithm uses the output of the last layout as its input.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jgraph.layout.JGraphLayout
JGraphLayout.Stoppable
 
Field Summary
protected  List layouts
          Holds all layouts.
 
Fields inherited from interface com.jgraph.layout.JGraphLayout
VERSION
 
Constructor Summary
JGraphCompoundLayout()
          Default constructor
JGraphCompoundLayout(JGraphLayout[] layouts)
          Constructs a compound layout consisting of the specified first- and secondStep.
 
Method Summary
 void add(JGraphLayout layout)
          Adds a layout to layouts.
 List getLayouts()
          Returns the list of layouts.
 void remove(JGraphLayout layout)
          Removes a layout from layouts
 void run(JGraphFacade graph)
          Runs all layouts in the order they were inserted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

layouts

protected List layouts
Holds all layouts.

Constructor Detail

JGraphCompoundLayout

public JGraphCompoundLayout()
Default constructor


JGraphCompoundLayout

public JGraphCompoundLayout(JGraphLayout[] layouts)
Constructs a compound layout consisting of the specified first- and secondStep.

Method Detail

run

public void run(JGraphFacade graph)
Runs all layouts in the order they were inserted. Note: The facade encapsulates the input and output of the algorithm, thus ensuring that each algorithm runs on the outcome of preceding algorithm.

Specified by:
run in interface JGraphLayout
Parameters:
graph - The layout facade that the layout will use as input

add

public void add(JGraphLayout layout)
Adds a layout to layouts.

Parameters:
layout - The layout to add.

remove

public void remove(JGraphLayout layout)
Removes a layout from layouts

Parameters:
layout - The layout to remove.

getLayouts

public List getLayouts()
Returns the list of layouts.

Returns:
Returns the list of layouts.

JGraph
v5.13.0.0


Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.