Class JGraphGreedyCycleRemover

java.lang.Object
com.jgraph.layout.hierarchical.JGraphGreedyCycleRemover
All Implemented Interfaces:
JGraphHierarchicalLayoutStep

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 Details

    • sources

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

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

      protected Object[] roots
      The root cells of this hierarchy
  • Constructor Details

    • JGraphGreedyCycleRemover

      public JGraphGreedyCycleRemover(Object[] roots)
      Constructor that has the roots specified
      Parameters:
      roots - the roots of this hierarchy
  • Method Details

    • run

      Reverses cycles in the internal model using the graph information specified
      Specified by:
      run in interface JGraphHierarchicalLayoutStep
      Parameters:
      facade - the facade describing the input graph
      model - an internal model of the hierarchical layout
      Returns:
      the updated hierarchy model
    • 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