If the unconstrained width of a block exceeds the available width in a single row of FlowLayout or ColumnLayout, it will show up in a truncated form. It is not attempted to arrange the block again with a width constrained to the available width, though such a layout is easily possible for LegendTitles and TextTitles.
Additionally, TextTitles in a CompositeTitle placed at the right or left edge of the chart might cover the entire chart width and squeeze the plot itself to essentially zero size.
The patch addresses these issues in the following way:
- additional fields double maxWidth, UnitType maxWidthUnitType, boolean useMaxWidth in the AbstractBlock class. Using these parameters, any subclass of AbstactBlock (such as Title) can be configured to request at most an absolute width (UnitType.ABSOLUTE, in pixels) or at most a given fraction of the available width (between 0 and 1.0, UnitType.RELATIVE).
- changes to FlowArrangement and ColumnArrangement. Most importantly, both arrangements will now lay out a block again with a constrained width if the unconstrained width of the block is larger than the available width.
- A Change to JFreeChart: it will now check the useMaxWidth flag of the title and shrink the width used to create the RectangledConstraint according to the maxWidthUnitType and the maxWidth.
- In order to make it easier to introduce further changes that might affect both arrangement classes, a new class AbstractArrangement has been created, and FlowArrangement and ColumnArrangement now extend AbstractArrangement. AbstractArrangement implements alls methods by the Arrangement interface and also provides default implementations for the different arrange[FNR][FNR] methods (it simply throws a RuntimeException "Not implemented").