if you don't like how the formatter laid out your code, you may need to introduce new functions/variables the formatter is not as clever as humans are, so it can sometimes produce less readable code ...
The TreeLayout creates tree layouts for arbitrary trees. It is not restricted to a specific output or format, but can be used for any kind of two dimensional diagram. Examples are Swing based ...