Example usage for org.jfree.chart.title TextTitle setURLText

List of usage examples for org.jfree.chart.title TextTitle setURLText

Introduction

In this page you can find the example usage for org.jfree.chart.title TextTitle setURLText.

Prototype

public void setURLText(String text) 

Source Link

Document

Sets the URL text to the specified text and sends a TitleChangeEvent to all registered listeners.

Usage

From source file:com.xpn.xwiki.plugin.charts.ChartCustomizer.java

public static void customizeTitle(TextTitle title, ChartParams params, String prefix) {
    if (params.get(prefix + ChartParams.TITLE_FONT_SUFFIX) != null) {
        title.setFont(params.getFont(prefix + ChartParams.TITLE_FONT_SUFFIX));
    } else {// w  w  w.  j  a  v  a2  s.c  o m
        title.setFont(JFreeChart.DEFAULT_TITLE_FONT);
    }

    if (params.get(prefix + ChartParams.TITLE_POSITION_SUFFIX) != null) {
        title.setPosition(params.getRectangleEdge(prefix + ChartParams.TITLE_POSITION_SUFFIX));
    }

    if (params.get(prefix + ChartParams.TITLE_HORIZONTAL_ALIGNMENT_SUFFIX) != null) {
        title.setHorizontalAlignment(
                params.getHorizontalAlignment(prefix + ChartParams.TITLE_HORIZONTAL_ALIGNMENT_SUFFIX));
    }

    if (params.get(prefix + ChartParams.TITLE_VERTICAL_ALIGNMENT_SUFFIX) != null) {
        title.setVerticalAlignment(
                params.getVerticalAlignment(prefix + ChartParams.TITLE_VERTICAL_ALIGNMENT_SUFFIX));
    }

    if (params.get(prefix + ChartParams.TITLE_COLOR_SUFFIX) != null) {
        title.setPaint(params.getColor(prefix + ChartParams.TITLE_COLOR_SUFFIX));
    }

    if (params.get(prefix + ChartParams.TITLE_BACKGROUND_COLOR_SUFFIX) != null) {
        title.setBackgroundPaint(params.getColor(prefix + ChartParams.TITLE_BACKGROUND_COLOR_SUFFIX));
    }

    if (params.get(prefix + ChartParams.TITLE_PADDING_SUFFIX) != null) {
        title.setPadding(params.getRectangleInsets(prefix + ChartParams.TITLE_PADDING_SUFFIX));
    }

    if (params.get(prefix + ChartParams.TITLE_URL_SUFFIX) != null) {
        title.setURLText(params.getString(prefix + ChartParams.TITLE_URL_SUFFIX));
    }
}