de.cau.cs.kieler.klay.layered
Class CompoundKGraphImporter

java.lang.Object
  extended by de.cau.cs.kieler.klay.layered.AbstractGraphImporter<KNode>
      extended by de.cau.cs.kieler.klay.layered.KGraphImporter
          extended by de.cau.cs.kieler.klay.layered.CompoundKGraphImporter
All Implemented Interfaces:
IGraphImporter<KNode>

public class CompoundKGraphImporter
extends KGraphImporter

Manages the transformation of Compound KGraphs to LayeredGraphs.

Rating red

Constructor Summary
CompoundKGraphImporter()
           
 
Method Summary
 void applyLayout(LayeredGraph layeredGraph)
          Apply the computed layout of the given layered graph to the original input graph.
 LayeredGraph importGraph(KNode kgraph)
          Create a layered graph from the given graph.
static boolean isDescendant(KNode node, KNode candidate)
          Checks, if a KNode is descendant of another in the inclusion tree.
 
Methods inherited from class de.cau.cs.kieler.klay.layered.KGraphImporter
clip, transformEdge, transformNode
 
Methods inherited from class de.cau.cs.kieler.klay.layered.AbstractGraphImporter
createExternalPortDummy, getExternalPortPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundKGraphImporter

public CompoundKGraphImporter()
Method Detail

importGraph

public LayeredGraph importGraph(KNode kgraph)
Create a layered graph from the given graph.

Specified by:
importGraph in interface IGraphImporter<KNode>
Overrides:
importGraph in class KGraphImporter
Parameters:
kgraph - the graph to turn into a layered graph.
Returns:
a layered graph, or null if the input was not recognized

isDescendant

public static boolean isDescendant(KNode node,
                                   KNode candidate)
Checks, if a KNode is descendant of another in the inclusion tree. attention: returns true, if nodes are equal.

Parameters:
node - node that is the possible ancestor.
candidate - node that is the possible descendant.
Returns:
returns a boolean value indicating, if candidate is descendant of node (false if nodes are equal).

applyLayout

public void applyLayout(LayeredGraph layeredGraph)
Apply the computed layout of the given layered graph to the original input graph.
Precondition:
the graph has all its dummy nodes and edges removed; edges that were reversed during layout have been restored to their original orientation
Postcondition:
none

Specified by:
applyLayout in interface IGraphImporter<KNode>
Overrides:
applyLayout in class KGraphImporter
Parameters:
layeredGraph - a graph for which layout is applied