JIDE 3.5.15

com.jidesoft.treemap
Interface Algorithm

All Known Implementing Classes:
AbstractAlgorithm

public interface Algorithm

The interface for all treemap layout algorithms. If you write your own algorithm, it should conform to this interface.


Method Summary
 boolean doLayout(Shape shape, MutableTreeMapNode parent, MutableTreeMapNode[] children, double sumSizes, TreeMapWorker worker)
          Arrange the items in the given array to fill the given rectangle.
<N> void
finishLayout(Rectangle2D bounds, TreeMapModel<N> model, N root)
          Finish the layout after doLayout has completed.
<N> Iterable
iterator(TreeMapModel<N> model, N root)
          Controls the order by which the tree should be traversed.
<N> void
startLayout(Rectangle2D bounds, TreeMapModel<N> model, N root, TreeMapWorker worker)
          Start the layout before doLayout is initiated.
 

Method Detail

iterator

<N> Iterable iterator(TreeMapModel<N> model,
                      N root)
Controls the order by which the tree should be traversed.

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

startLayout

<N> void startLayout(Rectangle2D bounds,
                     TreeMapModel<N> model,
                     N root,
                     TreeMapWorker worker)
Start the layout before doLayout is initiated.

Parameters:
bounds - the bounds of the view
model - the model
root - the root node
worker -

doLayout

boolean doLayout(Shape shape,
                 MutableTreeMapNode parent,
                 MutableTreeMapNode[] children,
                 double sumSizes,
                 TreeMapWorker worker)
Arrange the items in the given array to fill the given rectangle.

Parameters:
shape - the current rectangle being divided.
parent - the parent node.
children - the items to map.
sumSizes - the size of the parent.
worker - the worker thread
Returns:
true if the layout has been cancelled, false otherwise

finishLayout

<N> void finishLayout(Rectangle2D bounds,
                      TreeMapModel<N> model,
                      N root)
Finish the layout after doLayout has completed.

Parameters:
bounds - the bounds of the view
model - the model
root - the root node

JIDE 3.5.15