Boolean titleVisibility = (Boolean)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.TITLE_VISIBLE);
if(titleVisibility != null && titleVisibility.booleanValue())
{
TextTitle title = jfreeChart.getTitle();
RectangleEdge titleEdge = null;
if(title != null)
{
JRFont titleFont = getChart().getTitleFont();
Font themeTitleFont = getFont((JRFont)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.TITLE_FONT), titleFont, baseFontSize);
title.setFont(themeTitleFont);
HorizontalAlignment defaultTitleHAlignment = (HorizontalAlignment)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.TITLE_HORIZONTAL_ALIGNMENT);
if(defaultTitleHAlignment != null)
title.setHorizontalAlignment(defaultTitleHAlignment);
VerticalAlignment defaultTitleVAlignment = (VerticalAlignment)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.TITLE_VERTICAL_ALIGNMENT);
if(defaultTitleVAlignment != null)
title.setVerticalAlignment(defaultTitleVAlignment);
RectangleInsets defaultTitlePadding = (RectangleInsets)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.TITLE_PADDING);
RectangleInsets titlePadding = title.getPadding() != null ? title.getPadding() : defaultTitlePadding;
if(titlePadding != null)
title.setPadding(titlePadding);
Color titleForecolor = getChart().getOwnTitleColor() != null ?
getChart().getOwnTitleColor() :
(getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.TITLE_FORECOLOR) != null ?
(Color)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.TITLE_FORECOLOR) :
getChart().getTitleColor());
if(titleForecolor != null)
title.setPaint(titleForecolor);
Color titleBackcolor = (Color)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.TITLE_BACKCOLOR);
if(titleBackcolor != null)
title.setBackgroundPaint(titleBackcolor);
RectangleEdge defaultTitlePosition = (RectangleEdge)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.TITLE_POSITION);
titleEdge = getEdge(getChart().getTitlePositionValue(), defaultTitlePosition);
if(titleEdge != null)
title.setPosition(titleEdge);
}
}