afreechart/src/main/java/org/afree/chart/title/TextTitle.java
/**
     * Draws a the title vertically within the specified area. This method will
     * be called from the {@link #draw(Graphics2D, RectShape) draw} method.
     * 
     * @param canvas
     *            the graphics device.
     * @param area
     *            the area for the title.
     */
Draws a the title vertically within the specified area. This method will
be called from the  #draw(Graphics2D, RectShape) draw method.

@param canvas
the graphics device.
@param area
the area for the title.
Draws a the title vertically within the specified area . This method will be called from the #draw ( Graphics2D RectShape ) draw method . @param canvas the graphics device . @param area the area for the title .
protected void drawVertical(Canvas canvas, RectShape area) {
        RectShape titleArea = (RectShape) area.clone();
        TextBlockAnchor anchor = null;
        float y = 0.0f;
        VerticalAlignment verticalAlignment = getVerticalAlignment();
        if (verticalAlignment == VerticalAlignment.TOP) {
            y = (float) titleArea.getY();
            anchor = TextBlockAnchor.TOP_RIGHT;
        } else if (verticalAlignment == VerticalAlignment.BOTTOM) {
            y = (float) titleArea.getMaxY();
            anchor = TextBlockAnchor.TOP_LEFT;
        } else if (verticalAlignment == VerticalAlignment.CENTER) {
            y = (float) titleArea.getCenterY();
            anchor = TextBlockAnchor.TOP_CENTER;
        }
        float x = 0.0f;
        RectangleEdge position = getPosition();
        if (position == RectangleEdge.LEFT) {
            x = (float) titleArea.getX();
        } else if (position == RectangleEdge.RIGHT) {
            x = (float) titleArea.getMaxX();
            if (verticalAlignment == VerticalAlignment.TOP) {
                anchor = TextBlockAnchor.BOTTOM_RIGHT;
            } else if (verticalAlignment == VerticalAlignment.CENTER) {
                anchor = TextBlockAnchor.BOTTOM_CENTER;
            } else if (verticalAlignment == VerticalAlignment.BOTTOM) {
                anchor = TextBlockAnchor.BOTTOM_LEFT;
            }
        }
        this.content.draw(canvas, x, y, anchor, x, y, -Math.PI / 2.0);
    }
protected void drawVertical ( Canvas canvas , RectShape area ) { RectShape titleArea = ( RectShape ) area . clone ( ) ; TextBlockAnchor anchor = null ; float y = 0.0f ; VerticalAlignment verticalAlignment = getVerticalAlignment ( ) ; if ( verticalAlignment == VerticalAlignment . TOP ) { y = ( float ) titleArea . getY ( ) ; anchor = TextBlockAnchor . TOP_RIGHT ; } else if ( verticalAlignment == VerticalAlignment . BOTTOM ) { y = ( float ) titleArea . getMaxY ( ) ; anchor = TextBlockAnchor . TOP_LEFT ; } else if ( verticalAlignment == VerticalAlignment . CENTER ) { y = ( float ) titleArea . getCenterY ( ) ; anchor = TextBlockAnchor . TOP_CENTER ; } float x = 0.0f ; RectangleEdge position = getPosition ( ) ; if ( position == RectangleEdge . LEFT ) { x = ( float ) titleArea . getX ( ) ; } else if ( position == RectangleEdge . RIGHT ) { x = ( float ) titleArea . getMaxX ( ) ; if ( verticalAlignment == VerticalAlignment . TOP ) { anchor = TextBlockAnchor . BOTTOM_RIGHT ; } else if ( verticalAlignment == VerticalAlignment . CENTER ) { anchor = TextBlockAnchor . BOTTOM_CENTER ; } else if ( verticalAlignment == VerticalAlignment . BOTTOM ) { anchor = TextBlockAnchor . BOTTOM_LEFT ; } } this . content . draw ( canvas , x , y , anchor , x , y , - Math . PI / 2.0 ) ; }
Draws a the title vertically within the specified area.
Draws a the title vertically within the specified area .
// canvas.setFont(this.font); // canvas.setPaint(this.paint);