com.jgraph.layout.hierarchical

Class JGraphGreedyCycleRemover

public class JGraphGreedyCycleRemover extends Object implements JGraphHierarchicalLayoutStep

A Greedy Cycle removal algorithm for pre-processing cyclic graphs prior to applying a hierarchical layout. The cycles are only reversed in the internal model of the hierarchy.
Field Summary
protected Object[]roots
The root cells of this hierarchy
protected Listsinks
A list of the end point nodes in the layout
protected Listsources
A list of the start point nodes in the layout
Constructor Summary
JGraphGreedyCycleRemover(Object[] roots)
Constructor that has the roots specified
Method Summary
protected Object[]getOrderedVertices(JGraphFacade facade)
Performs the actual greedy cycle removal routine.
JGraphHierarchyModelrun(JGraphFacade facade, JGraphHierarchyModel model)
Reverses cycles in the internal model using the graph information specified

Field Detail

roots

protected Object[] roots
The root cells of this hierarchy

sinks

protected List sinks
A list of the end point nodes in the layout

sources

protected List sources
A list of the start point nodes in the layout

Constructor Detail

JGraphGreedyCycleRemover

public JGraphGreedyCycleRemover(Object[] roots)
Constructor that has the roots specified

Parameters: roots the roots of this hierarchy

Method Detail

getOrderedVertices

protected Object[] getOrderedVertices(JGraphFacade facade)
Performs the actual greedy cycle removal routine.

Parameters: facade the hierarchy facade to be acted upon

Returns: the ordered vertices

run

public JGraphHierarchyModel run(JGraphFacade facade, JGraphHierarchyModel model)
Reverses cycles in the internal model using the graph information specified

Parameters: facade the facade describing the input graph model an internal model of the hierarchical layout

Returns: the updated hierarchy model

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