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

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

Introduction

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

Prototype

public void setPosition(RectangleEdge position) 

Source Link

Document

Sets the position 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:/*from  w w w. ja  v  a  2s .  co m*/
        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;
    }
}