Search this API

y.layout.hierarchic
Class AlignmentDrawer

java.lang.Object
  extended by y.layout.hierarchic.AlignmentDrawer
All Implemented Interfaces:
Drawer

public class AlignmentDrawer
extends Object
implements Drawer

This class can be used to simply wrap another Drawer implementation. It will rearrange nodes within each layer so that they are aligned with respect to a given alignment point, that is provided on a per node basis, which is provided by a registered DataProvider instance that may provide doubles that are interpreted as relative coordinates to the center of the node.


Nested Class Summary
static class AlignmentDrawer.BottomAlignmentDataProvider
          Simple utility class that can be registered with the graph to be laid out.
static class AlignmentDrawer.LeftAlignmentDataProvider
          Simple utility class that can be registered with the graph to be laid out.
static class AlignmentDrawer.RightAlignmentDataProvider
          Simple utility class that can be registered with the graph to be laid out.
static class AlignmentDrawer.TopAlignmentDataProvider
          Simple utility class that can be registered with the graph to be laid out.
 
Field Summary
static Object NODE_ALIGNMENT_POINT_DPKEY
          The DataProvider key used for the DataProvider instance that provides for each node a double depicting the center anchored offset to the alignment point.
 
Fields inherited from interface y.layout.hierarchic.Drawer
NODE_BORDER_BOTTOM, NODE_BORDER_LEFT, NODE_BORDER_RIGHT, NODE_BORDER_TOP, NODE_DISTANCE
 
Constructor Summary
AlignmentDrawer(Drawer inner)
          Creates a new AlignmentDrawer using the given drawer as the actual drawer
 
Method Summary
protected  void alignNodes(LayoutGraph graph, NodeList[] lists)
          Modifies the given drawing by modifying the y-coordinates only
 void assignCoordinates(LayoutGraph g, NodeList[] layerLists, DataProvider layerID)
          This method assigns the coordinates to the nodes.
 void setDummyMap(NodeMap dummy)
          Gives the drawer the opportunity to distinguish between dummy nodes and real ones. dummy stores the original edge for each dummy node or null for real nodes.
 void setMinimalEdgeDistance(double d)
          Sets the minimal distance between two edges in the same layer.
 void setMinimalLayerDistance(double d)
          Sets the minimal distance between two layers.
 void setMinimalMultiEdgeDistance(double d)
          Sets the minimal distance between two edges sharing source/target (aka multi-edges) in the same layer.
 void setMinimalNodeDistance(double d)
          Sets the minimal distance between two nodes in the same layer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE_ALIGNMENT_POINT_DPKEY

public static final Object NODE_ALIGNMENT_POINT_DPKEY
The DataProvider key used for the DataProvider instance that provides for each node a double depicting the center anchored offset to the alignment point.

Constructor Detail

AlignmentDrawer

public AlignmentDrawer(Drawer inner)
Creates a new AlignmentDrawer using the given drawer as the actual drawer

Method Detail

alignNodes

protected void alignNodes(LayoutGraph graph,
                          NodeList[] lists)
Modifies the given drawing by modifying the y-coordinates only


assignCoordinates

public void assignCoordinates(LayoutGraph g,
                              NodeList[] layerLists,
                              DataProvider layerID)
Description copied from interface: Drawer
This method assigns the coordinates to the nodes.

Specified by:
assignCoordinates in interface Drawer

setDummyMap

public void setDummyMap(NodeMap dummy)
Description copied from interface: Drawer
Gives the drawer the opportunity to distinguish between dummy nodes and real ones. dummy stores the original edge for each dummy node or null for real nodes.

Specified by:
setDummyMap in interface Drawer

setMinimalEdgeDistance

public void setMinimalEdgeDistance(double d)
Description copied from interface: Drawer
Sets the minimal distance between two edges in the same layer.

Specified by:
setMinimalEdgeDistance in interface Drawer

setMinimalLayerDistance

public void setMinimalLayerDistance(double d)
Description copied from interface: Drawer
Sets the minimal distance between two layers.

Specified by:
setMinimalLayerDistance in interface Drawer

setMinimalMultiEdgeDistance

public void setMinimalMultiEdgeDistance(double d)
Description copied from interface: Drawer
Sets the minimal distance between two edges sharing source/target (aka multi-edges) in the same layer.

Specified by:
setMinimalMultiEdgeDistance in interface Drawer

setMinimalNodeDistance

public void setMinimalNodeDistance(double d)
Description copied from interface: Drawer
Sets the minimal distance between two nodes in the same layer.

Specified by:
setMinimalNodeDistance in interface Drawer

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