/** * Constructs a new (empty) legend for the specified source. * * @param source the source. */ public LegendTitle(LegendItemSource source) { this(source, new FlowArrangement(), new ColumnArrangement()); }
/** * Calculates and sets the bounds of all the items in the specified * container, subject to the given constraint. The {@code Graphics2D} * can be used by some items (particularly items containing text) to * calculate sizing parameters. * * @param container the container whose items are being arranged. * @param g2 the graphics device. * @param constraint the size constraint. * * @return The container size after the arrangement. */ protected Size2D arrangeFF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) { // TODO: implement properly return arrangeNF(container, g2, constraint); }
/** * Arranges the blocks in the container using a fixed height and a * range for the width. * * @param container the container. * @param g2 the graphics device. * @param constraint the constraint. * * @return The size of the container after arrangement. */ protected Size2D arrangeRF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) { Size2D s = arrangeNF(container, g2, constraint); if (constraint.getWidthRange().contains(s.width)) { return s; } else { RectangleConstraint c = constraint.toFixedWidth( constraint.getWidthRange().constrain(s.getWidth()) ); return arrangeFF(container, g2, c); } }
/** * Arranges a container with range constraints for both the horizontal * and vertical. * * @param container the container. * @param g2 the graphics device. * @param constraint the constraint. * * @return The size of the container. */ protected Size2D arrangeRR(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) { // first arrange without constraints, and see if this fits within // the required ranges... Size2D s1 = arrangeNN(container, g2); if (constraint.getHeightRange().contains(s1.height)) { return s1; // TODO: we didn't check the width yet } else { RectangleConstraint c = constraint.toFixedHeight( constraint.getHeightRange().getUpperBound() ); return arrangeRF(container, g2, c); } }
/** * Arranges the blocks in the container using a fixed height and a * range for the width. * * @param container the container. * @param g2 the graphics device. * @param constraint the constraint. * * @return The size of the container after arrangement. */ protected Size2D arrangeRF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) { Size2D s = arrangeNF(container, g2, constraint); if (constraint.getWidthRange().contains(s.width)) { return s; } else { RectangleConstraint c = constraint.toFixedWidth( constraint.getWidthRange().constrain(s.getWidth()) ); return arrangeFF(container, g2, c); } }
/** * Arranges a container with range constraints for both the horizontal * and vertical. * * @param container the container. * @param g2 the graphics device. * @param constraint the constraint. * * @return The size of the container. */ protected Size2D arrangeRR(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) { // first arrange without constraints, and see if this fits within // the required ranges... Size2D s1 = arrangeNN(container, g2); if (constraint.getHeightRange().contains(s1.height)) { return s1; // TODO: we didn't check the width yet } else { RectangleConstraint c = constraint.toFixedHeight( constraint.getHeightRange().getUpperBound() ); return arrangeRF(container, g2, c); } }
/** * Constructs a new (empty) legend for the specified source. * * @param source the source. */ public LegendTitle(LegendItemSource source) { this(source, new FlowArrangement(), new ColumnArrangement()); }
/** * Calculates and sets the bounds of all the items in the specified * container, subject to the given constraint. The <code>Graphics2D</code> * can be used by some items (particularly items containing text) to * calculate sizing parameters. * * @param container the container whose items are being arranged. * @param g2 the graphics device. * @param constraint the size constraint. * * @return The container size after the arrangement. */ protected Size2D arrangeFF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) { // TODO: implement properly return arrangeNF(container, g2, constraint); }