Class JustifyTreeNodeDecorator
- java.lang.Object
-
- hu.webarticum.treeprinter.decorator.AbstractTreeNodeDecorator
-
- hu.webarticum.treeprinter.decorator.JustifyTreeNodeDecorator
-
- All Implemented Interfaces:
TreeNode
public class JustifyTreeNodeDecorator extends AbstractTreeNodeDecorator
TreeNodedecorator 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
minimumHeightto6,minimumWidthto20,verticalAligntoMIDDLE,horizontalAligntoRIGHTandbackgroundto~, the following content will be produced:~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~Hello, Node! ~~~~~~~~~~~~~~Line 2 ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJustifyTreeNodeDecorator.Builder
-
Field Summary
-
Fields inherited from class hu.webarticum.treeprinter.decorator.AbstractTreeNodeDecorator
baseNode, decorable, inherit
-
-
Constructor Summary
Constructors Constructor Description JustifyTreeNodeDecorator(TreeNode decoratedNode)JustifyTreeNodeDecorator(TreeNode decoratedNode, HorizontalAlign textAlign)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JustifyTreeNodeDecorator.Builderbuilder()protected java.lang.StringdecoratedContent()protected TreeNodewrapChild(TreeNode childNode, int index)-
Methods inherited from class hu.webarticum.treeprinter.decorator.AbstractTreeNodeDecorator
children, content, getDecoratedNode, insets, isDecorable, isPlaceholder, originalNode
-
-
-
-
Constructor Detail
-
JustifyTreeNodeDecorator
public JustifyTreeNodeDecorator(TreeNode decoratedNode)
-
JustifyTreeNodeDecorator
public JustifyTreeNodeDecorator(TreeNode decoratedNode, HorizontalAlign textAlign)
-
-
Method Detail
-
builder
public static JustifyTreeNodeDecorator.Builder builder()
-
decoratedContent
protected java.lang.String decoratedContent()
- Specified by:
decoratedContentin classAbstractTreeNodeDecorator
-
wrapChild
protected TreeNode wrapChild(TreeNode childNode, int index)
- Specified by:
wrapChildin classAbstractTreeNodeDecorator
-
-