org.wilmascope.dotlayout
Class DotLayout

java.lang.Object
  extended by org.wilmascope.graph.LayoutEngine
      extended by org.wilmascope.dotlayout.DotLayout

public class DotLayout
extends LayoutEngine

A layout engine which uses the dot program to find node and edge positions. Dot is part of the AT&T Labs-Research Graphviz suite.

Copyright: Copyright (c) Tim Dwyer 2001

Company: WilmaScope.org

Version:
1.0
Author:
Tim Dwyer

Field Summary
 int bbXMax
           
 int bbXMin
           
 int bbYMax
           
 int bbYMin
           
 float height
           
 float width
           
 
Constructor Summary
DotLayout()
           
 
Method Summary
 boolean applyLayout()
          apply the changes calculated by LayoutEngine.calculateLayout()
 void calculateLayout()
          calculate the changes required to move the graph to a nicer layout.
 EdgeLayout createEdgeLayout(Edge e)
          Factory method to create a new EdgeLayout implementation compatible with the layout engine implementing this interface.
 NodeLayout createNodeLayout(Node n)
          Factory method to create a new NodeLayout implementation compatible with the layout engine implementing this interface.
 javax.swing.JPanel getControls()
           
 java.lang.String getName()
          Return a string descriptor for the layout engine type.
 java.util.Properties getProperties()
          If you want custom properties for your layout you will need to override this method but be sure to super.getProperties()
 float getStrataSeparation()
           
 float getXScale()
           
 float getYScale()
           
 void reset()
           
 void resetProperties()
          process your custom properties by overriding this method, but, again call super.resetProperties in your overriding implementation
 void setStrataSeparation(float sep)
           
 void setXScale(float f)
           
 void setYScale(float f)
           
 
Methods inherited from class org.wilmascope.graph.LayoutEngine
getRoot, init, isIterative, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bbXMin

public int bbXMin

bbXMax

public int bbXMax

bbYMin

public int bbYMin

bbYMax

public int bbYMax

width

public float width

height

public float height
Constructor Detail

DotLayout

public DotLayout()
Method Detail

calculateLayout

public void calculateLayout()
Description copied from class: LayoutEngine
calculate the changes required to move the graph to a nicer layout. This method does not actually update the position of the nodes, rather this should be done by the LayoutEngine.applyLayout() method. Potentially, this means that the caller can calculate new positions (stored in the NodeLayouts), then opt not to apply the changes if it does not lead to an improvement. In practice this has not yet been utilised and such decisions are usually made internally to the layout engine.

Overrides:
calculateLayout in class LayoutEngine

applyLayout

public boolean applyLayout()
Description copied from class: LayoutEngine
apply the changes calculated by LayoutEngine.calculateLayout()

Specified by:
applyLayout in class LayoutEngine
Returns:
true when a stable state is reached

reset

public void reset()

createNodeLayout

public NodeLayout createNodeLayout(Node n)
Description copied from class: LayoutEngine
Factory method to create a new NodeLayout implementation compatible with the layout engine implementing this interface.

Specified by:
createNodeLayout in class LayoutEngine

createEdgeLayout

public EdgeLayout createEdgeLayout(Edge e)
Description copied from class: LayoutEngine
Factory method to create a new EdgeLayout implementation compatible with the layout engine implementing this interface.

Specified by:
createEdgeLayout in class LayoutEngine

getControls

public javax.swing.JPanel getControls()
Specified by:
getControls in class LayoutEngine

getXScale

public float getXScale()
Returns:
the horizontal scale for the layout

getYScale

public float getYScale()
Returns:
the vertical scale for the layout

setXScale

public void setXScale(float f)
Parameters:
f - horizontal scale

setYScale

public void setYScale(float f)
Parameters:
f - vertical scale

setStrataSeparation

public void setStrataSeparation(float sep)

getStrataSeparation

public float getStrataSeparation()

getProperties

public java.util.Properties getProperties()
Description copied from class: LayoutEngine
If you want custom properties for your layout you will need to override this method but be sure to super.getProperties()

Overrides:
getProperties in class LayoutEngine
Returns:
properties of this layout

resetProperties

public void resetProperties()
Description copied from class: LayoutEngine
process your custom properties by overriding this method, but, again call super.resetProperties in your overriding implementation

Overrides:
resetProperties in class LayoutEngine

getName

public java.lang.String getName()
Description copied from class: LayoutEngine
Return a string descriptor for the layout engine type. Useful in GUI elements such as comboboxes

Specified by:
getName in class LayoutEngine