samples.preview_new_graphdraw.iter
Class IterableLayout

java.lang.Object
  extended by samples.preview_new_graphdraw.iter.IterableLayout
All Implemented Interfaces:
LayoutEmitter
Direct Known Subclasses:
InterpolatingIterableLayout, KKLayout, UpdatableIterableLayout, WrappedIterableLayout

public abstract class IterableLayout
extends Object
implements LayoutEmitter

An IterableLayout

Author:
Danyel Fisher

Field Summary
protected  EmittedLayout currentLayout
           
protected  EmittedLayout returnableLayout
           
 
Constructor Summary
IterableLayout()
           
 
Method Summary
 void advance()
          Copies the current layout into the retunrable layout, then moves the visualization one step forward (by calling calculate).
protected abstract  void calculate()
          Transforms currentLayout according to current layout algorithm.
 EmittedLayout emit()
          Creates some sort of layout that has all the same vertex and edge locations.
protected  Dimension getScreenSize()
           
protected  VisEdge getVisEdge(Edge e)
           
protected  VisVertex getVisVertex(Vertex v)
           
 void initializeLocationsFromLayout(EmittedLayout inputLayout)
          Starts up this layout based on a previous layout.
abstract  boolean isFinite()
          Says whether this algorthms' iterations will ever end.
abstract  boolean iterationsAreDone()
          Gives the outlining algorithm a sense of how long to run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentLayout

protected EmittedLayout currentLayout

returnableLayout

protected EmittedLayout returnableLayout
Constructor Detail

IterableLayout

public IterableLayout()
Method Detail

advance

public void advance()
Copies the current layout into the retunrable layout, then moves the visualization one step forward (by calling calculate). This method should probably not be overridden in most cases.


iterationsAreDone

public abstract boolean iterationsAreDone()
Gives the outlining algorithm a sense of how long to run. The algorithm is responsible for setting its own thresholds. Note that this should return a meaningful value (probably "false") even before initialize has been called.


isFinite

public abstract boolean isFinite()
Says whether this algorthms' iterations will ever end. (If not, there's no real use to waiting.)


calculate

protected abstract void calculate()
Transforms currentLayout according to current layout algorithm. This may change the state of the currentLayout object.


emit

public EmittedLayout emit()
Creates some sort of layout that has all the same vertex and edge locations. This copy can be visualized while the main thread moves forward. [It's not necessary that this use clone!]

Specified by:
emit in interface LayoutEmitter

initializeLocationsFromLayout

public void initializeLocationsFromLayout(EmittedLayout inputLayout)
Starts up this layout based on a previous layout. It is reasonable to assume that this method will be called only once. After this method is complete, a CURRENT LAYOUT should be defined with the current states of the vertices, and a RETURNABLE LAYOUT should be defined for emit() to return. In general, emit() will just return this copy of the layout stored in returnableLayout, so this method and advance() are both respon sible for advancing correctly.

Parameters:
sla -

getVisVertex

protected VisVertex getVisVertex(Vertex v)
Parameters:
v -

getVisEdge

protected VisEdge getVisEdge(Edge e)

getScreenSize

protected Dimension getScreenSize()