Interface Configuration<TreeNode>

  • Type Parameters:
    TreeNode -

    Adapted from https://code.google.com/p/treelayout/ to be available to GWT clients

    All Known Implementing Classes:
    DefaultConfiguration

    public interface Configuration<TreeNode>
    Used to configure the tree layout algorithm.

    Also see this overview.

    • Method Detail

      • getRootLocation

        Configuration.Location getRootLocation()
        Returns the position of the root node in the diagram.

        By default the root of the tree is located at the top of the diagram. However one may also put it at the left, right or bottom of the diagram.

        Top (Default) Left Right Bottom
        Returns:
        the position of the root node in the diagram
      • getAlignmentInLevel

        Configuration.AlignmentInLevel getAlignmentInLevel()
        Returns the alignment of "smaller" nodes within a level.

        By default all nodes of one level are centered in the level. However one may also align them "towards the root" or "away from the root". When the root is located at the top this means the nodes are aligned "to the top of the level" or "to the bottom of the level".

        Center (Default) TowardsRoot ("top of level") AwayFromRoot ("bottom of level")

        Alignment in level when root is at the left:

        Center (Default) TowardsRoot ("left of level") AwayFromRoot
        ("right of level")

        Of cause the alignment also works when the root is at the bottom or at the right side.

        Returns:
        the alignment of "smaller" nodes within a level
      • getGapBetweenLevels

        double getGapBetweenLevels​(int nextLevel)
        Returns the size of the gap between subsequent levels.

        Parameters:
        nextLevel - [nextLevel > 0]
        Returns:
        the size of the gap between level (nextLevel-1) and nextLevel [result >= 0]
      • getGapBetweenNodes

        double getGapBetweenNodes​(TreeNode node1,
                                  TreeNode node2)
        Returns the size of the minimal gap of nodes within a level.

        In the layout there will be a gap of at least the returned size between both given nodes.

        node1 and node2 are at the same level and are placed next to each other.

        Parameters:
        node1 -
        node2 -
        Returns:
        the minimal size of the gap between node1 and node2 [result >= 0]