org.graffiti.plugin.algorithm
Interface Algorithm

All Superinterfaces:
Parametrizable
All Known Subinterfaces:
CalculatingAlgorithm, EditorAlgorithm
All Known Implementing Classes:
AbstractAlgorithm, AbstractEditorAlgorithm, AbstractThreadSaveLayoutAlgorithm, ThreadSafeAlgorithm

public interface Algorithm
extends Parametrizable

An Algorithm has to provide a function that returns an array of Parameters it needs, in order to give user interfaces the possibility to provide the Algorithm with apropriate parameters.

Version:
$Revision: 5767 $

Method Summary
 void attach(Graph g)
          Attaches the given graph to this algorithm.
 void check()
          Checks whether all preconditions of the current graph are satisfied.
 void execute()
          Executes the whole algorithm.
 Animation getAnimation()
          Returns an animation for this algorithm if it supports animation.
 void reset()
          Resets the internal state of the algorithm.
 boolean supportsAnimation()
          Returns true if this algorithm supports animation; i.e.
 
Methods inherited from interface org.graffiti.plugin.Parametrizable
getDefaultParameters, getName, getParameters, setParameters
 

Method Detail

attach

void attach(Graph g)
Attaches the given graph to this algorithm.

Parameters:
g - the graph to attach.

check

void check()
           throws PreconditionException
Checks whether all preconditions of the current graph are satisfied.

Throws:
PreconditionException - if the preconditions of the current graph are not satisfied.

execute

void execute()
Executes the whole algorithm.


reset

void reset()
Resets the internal state of the algorithm.


supportsAnimation

boolean supportsAnimation()
Returns true if this algorithm supports animation; i.e. getAnimation will not throw an UnsupportedOperationException.

Returns:
true if this algorithm supports animation.
See Also:
getAnimation()

getAnimation

Animation getAnimation()
Returns an animation for this algorithm if it supports animation. An algorithm supports animation if supportsAnimation returns true. Throws UnsupportedOperationException otherwise.

Returns:
an animation for this algorithm.
Throws:
UnsupportedOperationException - if this algorithm does not support animation.
See Also:
supportsAnimation()


Generated at 2012-05-30 11:00:36 PM CEST