Search this API

y.layout.tree
Class LeafPlacer

java.lang.Object
  extended by y.layout.tree.LeafPlacer
All Implemented Interfaces:
NodePlacer

public class LeafPlacer
extends java.lang.Object
implements NodePlacer

A LeafPlacer creates a SubtreeShape for a leaf node and routes its incoming edge at the target side.

 
Your browser does not support SVG content.

Field Summary
 
Fields inherited from interface y.layout.tree.NodePlacer
DIRECTION_ANY, DIRECTION_EAST, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_WEST
 
Constructor Summary
LeafPlacer()
          Creates a new LeafPlacer instance with default settings.
 
Method Summary
 Processor createProcessor(GenericTreeLayouter layouter, LayoutGraph graph, Node currentRoot)
          Creates an optional Processor for pre- and post-processing.
 void determineChildConnectors(Node localRoot, DataMap connectorMap)
          Does nothing because leaf nodes don't have children so there are no child connectors.
 GenericTreeLayouter.SubtreeShape placeSubtree(DataProvider nodeShapeProvider, DataProvider subtreeShapeProvider, LayoutGraph graph, Node localRoot, byte parentConnectorDirection)
          Creates a GenericTreeLayouter.SubtreeShape for the local root node (a leaf node in this case) and adds target points to the incoming edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeafPlacer

public LeafPlacer()
Creates a new LeafPlacer instance with default settings.

Method Detail

createProcessor

public Processor createProcessor(GenericTreeLayouter layouter,
                                 LayoutGraph graph,
                                 Node currentRoot)
Creates an optional Processor for pre- and post-processing.

This implementation returns null. Hence, no pre- or post-processing is done.

Specified by:
createProcessor in interface NodePlacer
Parameters:
layouter - the current GenericTreeLayouter instance
graph - the input graph
currentRoot - the root node handled by this NodePlacer
Returns:
null

determineChildConnectors

public void determineChildConnectors(Node localRoot,
                                     DataMap connectorMap)
Does nothing because leaf nodes don't have children so there are no child connectors.

Specified by:
determineChildConnectors in interface NodePlacer
Parameters:
localRoot - the local root node
connectorMap - the map that must be used for storing the direction specifiers of the child nodes

placeSubtree

public GenericTreeLayouter.SubtreeShape placeSubtree(DataProvider nodeShapeProvider,
                                                     DataProvider subtreeShapeProvider,
                                                     LayoutGraph graph,
                                                     Node localRoot,
                                                     byte parentConnectorDirection)
Creates a GenericTreeLayouter.SubtreeShape for the local root node (a leaf node in this case) and adds target points to the incoming edge.

The incoming edge is routed according to possibly assigned PortConstraints.

Specified by:
placeSubtree in interface NodePlacer
Parameters:
nodeShapeProvider - the DataProvider for obtaining an initial shape of the root node
subtreeShapeProvider - the DataProvider for accessing the pre-calculated shapes of the subtrees
graph - the input graph
localRoot - the root of the subtree that should be arranged by this method
parentConnectorDirection - the direction specifier for the connector of the local root node to its parent node
Returns:
the GenericTreeLayouter.SubtreeShape of the leaf node including the connector

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