JIDE 3.5.15

com.jidesoft.treemap
Class AbstractAlgorithm

java.lang.Object
  extended by com.jidesoft.treemap.AbstractAlgorithm
All Implemented Interfaces:
Algorithm

public abstract class AbstractAlgorithm
extends Object
implements Algorithm

This class provides a skeletal implementation of the Algorithm interface to minimize the effort required to implement this interface.


Constructor Summary
AbstractAlgorithm()
           
 
Method Summary
<N> void
finishLayout(Rectangle2D bounds, TreeMapModel<N> model, N root)
          Do nothing by default.
<N> Iterable<N>
iterator(TreeMapModel<N> model, N root)
          Breadth first traversal by default.
<N> void
startLayout(Rectangle2D bounds, TreeMapModel<N> model, N root, TreeMapWorker worker)
          Do nothing by default.
protected static double sum(TreeMapNode[] children, int start, int end)
          Sums up the sizes of the given nodes according to the start and end indices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jidesoft.treemap.Algorithm
doLayout
 

Constructor Detail

AbstractAlgorithm

public AbstractAlgorithm()
Method Detail

iterator

public <N> Iterable<N> iterator(TreeMapModel<N> model,
                                N root)
Breadth first traversal by default.

Specified by:
iterator in interface Algorithm
Parameters:
model - the model
root - the root node
Returns:
an iterator to traverse the tree in the specified order

startLayout

public <N> void startLayout(Rectangle2D bounds,
                            TreeMapModel<N> model,
                            N root,
                            TreeMapWorker worker)
Do nothing by default.

Specified by:
startLayout in interface Algorithm
Parameters:
bounds - the bounds of the view
model - the model
root - the root node
worker -

finishLayout

public <N> void finishLayout(Rectangle2D bounds,
                             TreeMapModel<N> model,
                             N root)
Do nothing by default.

Specified by:
finishLayout in interface Algorithm
Parameters:
bounds - the bounds of the view
model - the model
root - the root node

sum

protected static final double sum(TreeMapNode[] children,
                                  int start,
                                  int end)
Sums up the sizes of the given nodes according to the start and end indices.

Parameters:
children - the nodes
start - start index
end - end index
Returns:
the sum of the sizes

JIDE 3.5.15