org.wilmascope.columnlayout
Class ColumnLayout

java.lang.Object
  extended by org.wilmascope.graph.LayoutEngine
      extended by org.wilmascope.columnlayout.ColumnLayout

public class ColumnLayout
extends LayoutEngine

Column layout simply places each node in the cluster at the same x,y position as the root cluster but with the z determined by each node's stratum


Constructor Summary
ColumnLayout()
           
 
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.
 int getBaseStratum()
           
 javax.swing.JPanel getControls()
           
 java.util.Vector getExtraSpacing()
           
 float getHeight()
           
 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()
 int getStrataCount()
           
 float getStrataSeparation()
           
 void reset()
           
 void resetProperties()
          process your custom properties by overriding this method, but, again call super.resetProperties in your overriding implementation
 void setBalanced(boolean balanced)
           
 void setBaseStratum(int stratum)
           
 void setExtraSpacing(java.util.Vector extraSpacing)
           
 void setStrataSeparation(float strataSeparation)
           
 void skipStratum()
           
 
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
 

Constructor Detail

ColumnLayout

public ColumnLayout()
Method Detail

setExtraSpacing

public void setExtraSpacing(java.util.Vector extraSpacing)

getExtraSpacing

public java.util.Vector getExtraSpacing()

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

setBalanced

public void setBalanced(boolean balanced)

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

setBaseStratum

public void setBaseStratum(int stratum)

getBaseStratum

public int getBaseStratum()

getStrataCount

public int getStrataCount()

skipStratum

public void skipStratum()

reset

public void reset()

setStrataSeparation

public void setStrataSeparation(float strataSeparation)

getStrataSeparation

public float getStrataSeparation()

getHeight

public float getHeight()

getControls

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

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