Example usage for org.jfree.chart.title Title setHorizontalAlignment

List of usage examples for org.jfree.chart.title Title setHorizontalAlignment

Introduction

In this page you can find the example usage for org.jfree.chart.title Title setHorizontalAlignment.

Prototype

public void setHorizontalAlignment(HorizontalAlignment alignment) 

Source Link

Document

Sets the horizontal alignment for the title and sends a TitleChangeEvent to all registered listeners.

Usage

From source file:org.operamasks.faces.render.graph.ChartRenderer.java

private void setTitlePosition(Title title, PositionType position) {
    switch (position) {
    case Top://  w ww. j a  v  a 2  s .  c  om
        title.setPosition(RectangleEdge.TOP);
        break;
    case Bottom:
        title.setPosition(RectangleEdge.BOTTOM);
        break;
    case Left:
        title.setPosition(RectangleEdge.LEFT);
        break;
    case Right:
        title.setPosition(RectangleEdge.RIGHT);
        break;
    case TopLeft:
        title.setPosition(RectangleEdge.TOP);
        title.setHorizontalAlignment(HorizontalAlignment.LEFT);
        break;
    case TopRight:
        title.setPosition(RectangleEdge.TOP);
        title.setHorizontalAlignment(HorizontalAlignment.RIGHT);
        break;
    case BottomLeft:
        title.setPosition(RectangleEdge.BOTTOM);
        title.setHorizontalAlignment(HorizontalAlignment.LEFT);
        break;
    case BottomRight:
        title.setPosition(RectangleEdge.BOTTOM);
        title.setHorizontalAlignment(HorizontalAlignment.RIGHT);
        break;
    case LeftTop:
        title.setPosition(RectangleEdge.LEFT);
        title.setVerticalAlignment(VerticalAlignment.TOP);
        break;
    case LeftBottom:
        title.setPosition(RectangleEdge.LEFT);
        title.setVerticalAlignment(VerticalAlignment.BOTTOM);
        break;
    case RightTop:
        title.setPosition(RectangleEdge.RIGHT);
        title.setVerticalAlignment(VerticalAlignment.TOP);
        break;
    case RightBottom:
        title.setPosition(RectangleEdge.RIGHT);
        title.setVerticalAlignment(VerticalAlignment.BOTTOM);
        break;
    }
}