List of usage examples for org.jfree.chart.title TextTitle setBorder
public void setBorder(BlockBorder border)
From source file:com.naryx.tagfusion.cfm.tag.awt.cfCHART.java
private void setTitle(JFreeChart chart, String title, Font titleFont, Color foregroundColor, List<cfCHARTTITLEData> titles) throws cfmRunTimeException { if (titles.size() > 0) { // One or more CFCHARTTITLE tags were specified so use them to configure // the chart titles for (int i = 0; i < titles.size(); i++) { cfCHARTTITLEData data = titles.get(i); Font font = getFont(data.getFont(), data.getFontBold(), data.getFontItalic(), data.getFontSize()); TextTitle textTitle = new TextTitle(data.getTitle(), font); textTitle.setPaint(convertStringToColor(data.getLabelColor())); textTitle.setBackgroundPaint(convertStringToColor(data.getBackgroundColor())); String pos = data.getPosition(); if (pos.equals("top")) textTitle.setPosition(RectangleEdge.TOP); else if (pos.equals("bottom")) textTitle.setPosition(RectangleEdge.BOTTOM); else if (pos.equals("left")) textTitle.setPosition(RectangleEdge.LEFT); else if (pos.equals("right")) textTitle.setPosition(RectangleEdge.RIGHT); if (!data.getShowBorder()) textTitle.setBorder(BlockBorder.NONE); else/*from w ww . jav a 2s . co m*/ textTitle.setBorder(new BlockBorder()); textTitle.setPadding(data.getPadding(), data.getPadding(), data.getPadding(), data.getPadding()); textTitle.setMargin(data.getMargin(), data.getMargin(), data.getMargin(), data.getMargin()); chart.addSubtitle(textTitle); } } else { // A CFCHARTTITLE tag was NOT specified so use the CFCHART attributes to // configure the chart title if (title == null) return; TextTitle textTitle = new TextTitle(title, titleFont); textTitle.setPaint(foregroundColor); // Add a border around the title to match CFMX 7 textTitle.setBorder(new BlockBorder()); textTitle.setPadding(10, 10, 10, 10); textTitle.setMargin(5, 5, 5, 5); chart.setTitle(textTitle); } }