afreechart/src/main/java/org/afree/chart/title/TextTitle.java
/**
     * Draws the block within the specified area.
     * 
     * @param canvas
     *            the graphics device.
     * @param area
     *            the area.
     * @param params
     *            if this is an instance of {@link EntityBlockParams} it is used
     *            to determine whether or not an {@link EntityCollection} is
     *            returned by this method.
     * 
     * @return An {@link EntityCollection} containing a chart entity for the
     *         title, or <code>null</code>.
     */
Draws the block within the specified area.

@param canvas
the graphics device.
@param area
the area.
@param params
if this is an instance of  EntityBlockParams it is used
to determine whether or not an  EntityCollection is
returned by this method.

@return An  EntityCollection containing a chart entity for the
title, or null.
Draws the block within the specified area . @param canvas the graphics device . @param area the area . @param params if this is an instance of EntityBlockParams it is used to determine whether or not an EntityCollection is returned by this method . @return An EntityCollection containing a chart entity for the title or null .
public Object draw(Canvas canvas, RectShape area, Object params) {
        if (this.content == null) {
            return null;
        }
        area = trimMargin(area);
        drawBorder(canvas, area);
        if (this.text.equals("")) {
            return null;
        }
        ChartEntity entity = null;
        if (params instanceof EntityBlockParams) {
            EntityBlockParams p = (EntityBlockParams) params;
            if (p.getGenerateEntities()) {
                entity = new TitleEntity(area, this, this.toolTipText,
                        this.urlText);
            }
        }
        area = trimBorder(area);
        if (this.backgroundPaint != null) {
            area.fill(canvas, this.backgroundPaint);
        }
        area = trimPadding(area);
        RectangleEdge position = getPosition();
        if (position == RectangleEdge.TOP || position == RectangleEdge.BOTTOM) {
            drawHorizontal(canvas, area);
        } else if (position == RectangleEdge.LEFT
                || position == RectangleEdge.RIGHT) {
            drawVertical(canvas, area);
        }
        BlockResult result = new BlockResult();
        if (entity != null) {
            StandardEntityCollection sec = new StandardEntityCollection();
            sec.add(entity);
            result.setEntityCollection(sec);
        }
        return result;
    }
public Object draw ( Canvas canvas , RectShape area , Object params ) { if ( this . content == null ) { return null ; } area = trimMargin ( area ) ; drawBorder ( canvas , area ) ; if ( this . text . equals ( "" ) ) { return null ; } ChartEntity entity = null ; if ( params instanceof EntityBlockParams ) { EntityBlockParams p = ( EntityBlockParams ) params ; if ( p . getGenerateEntities ( ) ) { entity = new TitleEntity ( area , this , this . toolTipText , this . urlText ) ; } } area = trimBorder ( area ) ; if ( this . backgroundPaint != null ) { area . fill ( canvas , this . backgroundPaint ) ; } area = trimPadding ( area ) ; RectangleEdge position = getPosition ( ) ; if ( position == RectangleEdge . TOP || position == RectangleEdge . BOTTOM ) { drawHorizontal ( canvas , area ) ; } else if ( position == RectangleEdge . LEFT || position == RectangleEdge . RIGHT ) { drawVertical ( canvas , area ) ; } BlockResult result = new BlockResult ( ) ; if ( entity != null ) { StandardEntityCollection sec = new StandardEntityCollection ( ) ; sec . add ( entity ) ; result . setEntityCollection ( sec ) ; } return result ; }
Draws the block within the specified area.
Draws the block within the specified area .
// canvas.setPaint(this.backgroundPaint); // canvas.fill(area);