List of usage examples for org.jfree.chart.title LegendTitle getHorizontalAlignment
public HorizontalAlignment getHorizontalAlignment()
From source file:org.logisticPlanning.utils.graphics.chart.impl.jfree._JFCLineChart2D.java
/** * paint a legend/*ww w . j a v a 2 s . com*/ * * @param legend * the legend * @param graphics * the graphics * @param bounds * the bounds */ private static final void __paintLegend(final LegendTitle legend, final Graphics2D graphics, final Rectangle2D bounds) { final Rectangle2D titleArea; final BlockParams p; final double ww, hh; final RectangleConstraint constraint; final Size2D size; p = new BlockParams(); p.setGenerateEntities(false); ww = bounds.getWidth(); if (ww <= 0.0d) { return; } hh = bounds.getHeight(); if (hh <= 0.0d) { return; } constraint = new RectangleConstraint(ww, new Range(0.0, ww), LengthConstraintType.RANGE, hh, new Range(0.0, hh), LengthConstraintType.RANGE); size = legend.arrange(graphics, constraint); titleArea = _JFCLineChart2D.__createAlignedRectangle2D(size, bounds, legend.getHorizontalAlignment(), VerticalAlignment.TOP); legend.setMargin(_JFCLineChart2D.LEGEND_MARGIN); legend.setPadding(_JFCLineChart2D.CHART_INSETS); legend.draw(graphics, titleArea, p); }