suvi.api.alg
Class BasicGraphLayoutAlgProgressPolicy

java.lang.Object
  |
  +--suvi.api.alg.BasicGraphLayoutAlgProgressPolicy
All Implemented Interfaces:
GraphLayoutAlgProgressPolicy

public class BasicGraphLayoutAlgProgressPolicy
extends java.lang.Object
implements GraphLayoutAlgProgressPolicy

A default Null Object [PLOP3, Fowler1999] implementation that simply does nothing. This class is publicly available so that you can derive more specific progress policies and only override the methods that you need - you may not need or want to override all methods.

Note that it would not be generally safe to check for thread interrupts in a default implementation, because even though the graph layout algorithm is prepared for exceptions, the client of the layout algorithm may not be prepared.


Field Summary
 
Fields inherited from interface suvi.api.alg.GraphLayoutAlgProgressPolicy
NULL_PROGRESS_POLICY
 
Constructor Summary
BasicGraphLayoutAlgProgressPolicy()
           
 
Method Summary
 void layoutBegin()
          Called once just after the layout-method is entered before any layoutProgress calls are made.
 void layoutCancelled(java.lang.Throwable cause)
          Called once before layoutFinish if the layout computation was cancelled due to an exception.
 void layoutFinish()
          Called once just before the layout-method is about to return, either normally or as the result of an exception, and after all the layoutProgress calls have been made.
 void layoutProgress(double percentage)
          Called by the layout algorithm to report progress percentages, between 0.0 and 1.0 at appropriate moments in the computation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicGraphLayoutAlgProgressPolicy

public BasicGraphLayoutAlgProgressPolicy()
Method Detail

layoutBegin

public void layoutBegin()
Description copied from interface: GraphLayoutAlgProgressPolicy

Called once just after the layout-method is entered before any layoutProgress calls are made.

Specified by:
layoutBegin in interface GraphLayoutAlgProgressPolicy

layoutProgress

public void layoutProgress(double percentage)
Description copied from interface: GraphLayoutAlgProgressPolicy

Called by the layout algorithm to report progress percentages, between 0.0 and 1.0 at appropriate moments in the computation.

The percentages will not be highly accurate, but should be useful for a simple progress display.

Called first just after the layout-method is entered, with value 0.0, and last just before the layout-method is about to return, with value 1.0. Other call points are not specified and may vary depending on algorithm.

This method is always called from an environment that allows this method to throw any unchecked exception to effectively terminate the layout computation.

Specified by:
layoutProgress in interface GraphLayoutAlgProgressPolicy

layoutCancelled

public void layoutCancelled(java.lang.Throwable cause)
Description copied from interface: GraphLayoutAlgProgressPolicy

Called once before layoutFinish if the layout computation was cancelled due to an exception.

Specified by:
layoutCancelled in interface GraphLayoutAlgProgressPolicy

layoutFinish

public void layoutFinish()
Description copied from interface: GraphLayoutAlgProgressPolicy

Called once just before the layout-method is about to return, either normally or as the result of an exception, and after all the layoutProgress calls have been made.

Specified by:
layoutFinish in interface GraphLayoutAlgProgressPolicy