de.cau.cs.kieler.klay.layered.graph
Class LayeredGraph

java.lang.Object
  extended by de.cau.cs.kieler.core.properties.MapPropertyHolder
      extended by de.cau.cs.kieler.klay.layered.graph.LGraphElement
          extended by de.cau.cs.kieler.klay.layered.graph.LayeredGraph
All Implemented Interfaces:
IPropertyHolder, Comparable<LGraphElement>

public class LayeredGraph
extends LGraphElement

A layered graph has a set of layers that contain the nodes, as well as a list of nodes that are not yet assigned to a layer. Layout algorithms are required to layout the graph from left to right. If another layout direction is desired, it can be obtained by pre-processing and post-processing the graph.

TODO add methods to rotate / mirror the graph for alternative layout directions

Rating red

Field Summary
 
Fields inherited from class de.cau.cs.kieler.klay.layered.graph.LGraphElement
id
 
Constructor Summary
LayeredGraph()
           
 
Method Summary
 Insets.Double getInsets()
          Returns the insets of the graph.
 List<LNode> getLayerlessNodes()
          Returns the list of nodes that are not currently assigned to a layer.
 List<Layer> getLayers()
          Returns the list of layers of the graph.
 KVector getOffset()
          Returns the offset for the graph, that is a coordinate vector that has to be added to all position values of nodes and edges.
 KVector getSize()
          Returns the size of the graph, that is the bounding box that covers the whole drawing.
 String toString()
          
 void writeDotGraph(Writer writer)
          Outputs a representation of this graph in dot format to the given writer.
 
Methods inherited from class de.cau.cs.kieler.klay.layered.graph.LGraphElement
compareTo
 
Methods inherited from class de.cau.cs.kieler.core.properties.MapPropertyHolder
checkProperties, copyProperties, getAllProperties, getProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LayeredGraph

public LayeredGraph()
Method Detail

toString

public String toString()

Overrides:
toString in class Object

getSize

public KVector getSize()
Returns the size of the graph, that is the bounding box that covers the whole drawing.

Returns:
the size of the layered graph

getInsets

public Insets.Double getInsets()
Returns the insets of the graph. The insets determine the amount of space between the content area and the graph's actual border.

Returns:
the insets.

getOffset

public KVector getOffset()
Returns the offset for the graph, that is a coordinate vector that has to be added to all position values of nodes and edges. It is usually used to reserve some space in the content area for additional edge routing.

Returns:
the offset of the layered graph

getLayerlessNodes

public List<LNode> getLayerlessNodes()
Returns the list of nodes that are not currently assigned to a layer.

Returns:
the layerless nodes.

getLayers

public List<Layer> getLayers()
Returns the list of layers of the graph.

Returns:
the layers

writeDotGraph

public void writeDotGraph(Writer writer)
                   throws IOException
Outputs a representation of this graph in dot format to the given writer. The following conventions are used:

Parameters:
writer - the writer to output the graph to. An attempt is made to close the writer when finished.
Throws:
IOException - if anything goes wrong with the writer.