Search this API

y.layout.tree
Interface Processor


public interface Processor

A Processor provides the possibility for each NodePlacer to prepare (and clean up) the graph for the children of the local root.

It is created by NodePlacer.createProcessor(GenericTreeLayouter,y.layout.LayoutGraph,y.base.Node) and called by the GenericTreeLayouter before and after the actual arrangement of the nodes.

A Processor may change values within the DataMaps for its children. It can also temporarily change the graph by hiding nodes or adding dummy nodes.

 

Method Summary
 void postProcess()
          This method is called by the GenericTreeLayouter after the layout has finished.
 void preProcess(DataMap nodePlacerDataProvider, DataMap portAssignmentDataProvider, DataMap childComparatorProvider)
          Performs preparations for the actual tree layout in a pre-processing step.
 

Method Detail

preProcess

void preProcess(DataMap nodePlacerDataProvider,
                DataMap portAssignmentDataProvider,
                DataMap childComparatorProvider)
Performs preparations for the actual tree layout in a pre-processing step. This method is called by GenericTreeLayouter before the NodePlacers are called recursively. A Processor may change some settings within this method. This can be used for specifying values for the children of the local root, manipulate the graph structure or do anything else that needs to be done.

 
Only changes regarding the descendants of the current root node are allowed.
Parameters:
nodePlacerDataProvider - the map that stores a NodePlacer instance for each node
portAssignmentDataProvider - The map that stores a PortAssignment instance for each node
childComparatorProvider - the map that stores a Comparator instance for each node

postProcess

void postProcess()
This method is called by the GenericTreeLayouter after the layout has finished. It can be used for cleanup tasks.

Changes on the graph structure that have been made in preProcess(DataMap, DataMap, DataMap) can be undone here.


© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.