Class JustifyTreeNodeDecorator

  • All Implemented Interfaces:
    TreeNode

    public class JustifyTreeNodeDecorator
    extends AbstractTreeNodeDecorator
    TreeNode decorator implementation with justifying functionality.

    You can set a minimum width and height, vertical and horizontal align, and the character that fills background area.

    This decorator ensures that the generated content will have a rectangle shape.

    Given the following content:

     Hello, Node!
     Line 2
     

    By setting minimumHeight to 6, minimumWidth to 20, verticalAlign to MIDDLE, horizontalAlign to RIGHT and background to ~, the following content will be produced:

     ~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~Hello, Node!
     ~~~~~~~~~~~~~~Line 2
     ~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~