pedviz.algorithms
Class RubberBands

java.lang.Object
  extended by pedviz.algorithms.RubberBands
All Implemented Interfaces:
java.lang.Runnable, Algorithm

public class RubberBands
extends java.lang.Object
implements Algorithm

This class implements the RubberBands algorithm. It provides methods for setting up the spacing between nodes and their size.

Version:
0.1
Author:
Lukas Forer

Constructor Summary
RubberBands(LayoutedGraph graph)
          Creates the RubberBands algorithm for the given Graph.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener changeListener)
          Registers a ChangeListener.
 float getDepth()
          Returns the spacing between two walls.
 int getHorizontalGap()
          Return the gap between two nodes, if they have the same parents.
 float getHorizontalSpacing()
          Return the gap between two nodes, if they have the same parents.
 int getMaxIterations()
          Returns the maximal number of iterations.
 java.lang.String getMessage()
          Returns a short description of the algorithm.
 int getNodeSize()
          Returns the size of a single node.
 int getPercentComplete()
          Returns the progress in percents from 0 to 100
 float getVerticalSpacing()
          Returns the spacing between two generations.
 void run()
          Starts the algorithm.
 void setDepth(float depth)
          Sets the spacing between two walls.
 void setHorizontalGap(int gap)
          Sets the gap between two nodes, if they have the same parents.
 void setHorizontalSpacing(float minimumX)
          Sets the gap between two nodes, if they have the same parents.
 void setMaxIterations(int maxIterations)
          Sets the maximal number of iterations.
 void setNodeSize(int nodeSize)
          Sets the size of a single node.
 void setVerticalSpacing(float height)
          Sets the spacing between two generations.
 void updateYPosition()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RubberBands

public RubberBands(LayoutedGraph graph)
Creates the RubberBands algorithm for the given Graph.

Parameters:
graph - the Graph object
Method Detail

run

public void run()
Description copied from interface: Algorithm
Starts the algorithm.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface Algorithm

getMessage

public java.lang.String getMessage()
Description copied from interface: Algorithm
Returns a short description of the algorithm.

Specified by:
getMessage in interface Algorithm
Returns:
a short description of the algorithm

getPercentComplete

public int getPercentComplete()
Description copied from interface: Algorithm
Returns the progress in percents from 0 to 100

Specified by:
getPercentComplete in interface Algorithm
Returns:
the progress in percents

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener changeListener)
Description copied from interface: Algorithm
Registers a ChangeListener. It will be notified about the progress of the algorithm.

Specified by:
addChangeListener in interface Algorithm
Parameters:
changeListener - Change

getDepth

public float getDepth()
Returns the spacing between two walls.

Returns:
spacing between two walls

setDepth

public void setDepth(float depth)
Sets the spacing between two walls.

Parameters:
depth - spacing between walls.

getHorizontalSpacing

public float getHorizontalSpacing()
Return the gap between two nodes, if they have the same parents.

Returns:
gap between two nodes

setHorizontalSpacing

public void setHorizontalSpacing(float minimumX)
Sets the gap between two nodes, if they have the same parents.

Parameters:
horizontalGap - gap between two nodes

getNodeSize

public int getNodeSize()
Returns the size of a single node.

Returns:
size of a single node

setNodeSize

public void setNodeSize(int nodeSize)
Sets the size of a single node.

Parameters:
nodeSize - size of a single node.

getVerticalSpacing

public float getVerticalSpacing()
Returns the spacing between two generations.

Returns:
pacing between two generations

setVerticalSpacing

public void setVerticalSpacing(float height)
Sets the spacing between two generations.

Parameters:
verticalSpacing -

getHorizontalGap

public int getHorizontalGap()
Return the gap between two nodes, if they have the same parents.

Returns:
gap between two nodes

setHorizontalGap

public void setHorizontalGap(int gap)
Sets the gap between two nodes, if they have the same parents.

Parameters:
horizontalGap - gap between two nodes

getMaxIterations

public int getMaxIterations()
Returns the maximal number of iterations.

Returns:
maximal number of iterations

setMaxIterations

public void setMaxIterations(int maxIterations)
Sets the maximal number of iterations.

Parameters:
maxIterations - maximal number of iterations

updateYPosition

public void updateYPosition()