schmitzm.jfree.chart.style
Class ChartRendererStyle

java.lang.Object
  extended by schmitzm.jfree.chart.style.ChartRendererStyle

public class ChartRendererStyle
extends Object

This class defines the rendering style the charts series. The following properties are available:

Version:
1.0
Author:
Martin Schmitz

Nested Class Summary
protected  class ChartRendererStyle.LegendLabelGenerator
          This class implements a label generator based on the legend label definitions of this style, which can be used also for AbstractCategoryItemRenderer and AbstractXYItemRenderer.
protected  class ChartRendererStyle.LegendTooltipGenerator
          This class implements a label generator based on the legend tooltip definitions of this style, which can be used also for AbstractCategoryItemRenderer and AbstractXYItemRenderer.
 
Field Summary
protected  CategorySeriesLabelGenerator LABELGEN_CAT
          Standard label generator used for Category-Charts.
protected  XYSeriesLabelGenerator LABELGEN_XY
          Standard label generator used for XY-Charts.
protected  ChartRendererStyle.LegendLabelGenerator legendLabelGenerator
          Label generator bases on the legend label definitions of this style.
protected  ChartRendererStyle.LegendTooltipGenerator legendTooltipGenerator
          Label generator bases on the legend tooltip definitions of this style.
protected  Category LOGGER
          Logger for this class
protected  double margin
          Holds the (percentage) margin for the bars.
protected  int maxSeriesIdx
          Holds the maximum series index for which a series is specified.
protected  Map<Integer,Boolean> seriesItemLabelsVisible
          Holds whether the item labels are visible for a series.
protected  Map<Integer,ChartLabelStyle> seriesLegendLabel
          Holds the label shown in the legend for the series.
protected  Map<Integer,ChartLabelStyle> seriesLegendTooltip
          Holds the tooltip shown in the legend for the series.
protected  Map<Integer,Boolean> seriesLegendVisible
          Holds whether the series is visible in the legend.
protected  Map<Integer,Color> seriesPaint
          Holds the color a series is painted with.
protected  Map<Integer,Boolean> seriesShapesVisible
          Holds whether the shape of a series is visible.
 
Constructor Summary
ChartRendererStyle()
          Creates a new style with default values.
 
Method Summary
protected  void applyToBarRenderer(XYBarRenderer renderer)
          Applies style properties which can only be applied to XYBarRenderer.
protected  void applyToCategoryItemRenderer(AbstractCategoryItemRenderer renderer)
          Applies style properties which can only be applied to AbstractCategoryItemRenderer.
 void applyToRenderer(AbstractRenderer renderer)
          Applies the style to a specific renderer.
protected  void applyToXYItemRenderer(AbstractXYItemRenderer renderer)
          Applies style properties which can only be applied to AbstractXYItemRenderer.
 ChartRendererStyle.LegendLabelGenerator getLegendLabelGenerator()
          Returns a label generator based on the legend label definitions of this style.
 ChartRendererStyle.LegendTooltipGenerator getLegendTooltipGenerator()
          Returns a label generator based on the legend tooltip definitions of this style.
 Double getMargin()
          Returns the margin (percentage) between the chart bars.
 int getSeriesCount()
          Returns the count of series the style is defined for.
 ChartLabelStyle getSeriesLegendLabel(int series)
          Returns the style of the series label in the legend.
 ChartLabelStyle getSeriesLegendTooltip(int series)
          Returns the style of the series tooltip in the legend.
 Color getSeriesPaint(int series)
          Returns the color, a series is painted with.
 Boolean isSeriesItemLabelsVisible(int series)
          Returns whether the item labels of a series are visible.
 Boolean isSeriesLegendVisible(int series)
          Returns whether the series is shown in the legend.
 Boolean isSeriesShapesVisible(int series)
          Returns whether the shapes of a series are visible.
 void setMargin(Double margin)
          Sets the margin (percentage) between the chart bars.
 void setSeriesItemLabelsVisible(int series, Boolean visible)
          Sets whether the item labels of a series are visible.
 void setSeriesLegendLabel(int series, ChartLabelStyle labelStyle)
          Sets the style of the series label in the legend.
 void setSeriesLegendTooltip(int series, ChartLabelStyle tooltipStyle)
          Sets the style of the series tooltip in the legend.
 void setSeriesLegendVisible(int series, Boolean visible)
          Sets whether the series is shown in the legend.
 void setSeriesPaint(int series, Color color)
          Sets the color, a series is painted with.
 void setSeriesShapesVisible(int series, Boolean visible)
          Sets whether the shapes of a series are visible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected final Category LOGGER
Logger for this class


LABELGEN_XY

protected XYSeriesLabelGenerator LABELGEN_XY
Standard label generator used for XY-Charts.


LABELGEN_CAT

protected CategorySeriesLabelGenerator LABELGEN_CAT
Standard label generator used for Category-Charts.


seriesItemLabelsVisible

protected Map<Integer,Boolean> seriesItemLabelsVisible
Holds whether the item labels are visible for a series.


seriesPaint

protected Map<Integer,Color> seriesPaint
Holds the color a series is painted with.


seriesShapesVisible

protected Map<Integer,Boolean> seriesShapesVisible
Holds whether the shape of a series is visible.


seriesLegendVisible

protected Map<Integer,Boolean> seriesLegendVisible
Holds whether the series is visible in the legend.


seriesLegendLabel

protected Map<Integer,ChartLabelStyle> seriesLegendLabel
Holds the label shown in the legend for the series.


seriesLegendTooltip

protected Map<Integer,ChartLabelStyle> seriesLegendTooltip
Holds the tooltip shown in the legend for the series.


maxSeriesIdx

protected int maxSeriesIdx
Holds the maximum series index for which a series is specified.


margin

protected double margin
Holds the (percentage) margin for the bars. Only applicable for XYBarRenderer.


legendLabelGenerator

protected ChartRendererStyle.LegendLabelGenerator legendLabelGenerator
Label generator bases on the legend label definitions of this style.


legendTooltipGenerator

protected ChartRendererStyle.LegendTooltipGenerator legendTooltipGenerator
Label generator bases on the legend tooltip definitions of this style.

Constructor Detail

ChartRendererStyle

public ChartRendererStyle()
Creates a new style with default values.

Method Detail

getMargin

public Double getMargin()
Returns the margin (percentage) between the chart bars. The margin is only applicable on bar charts.


setMargin

public void setMargin(Double margin)
Sets the margin (percentage) between the chart bars. The margin is only applicable on bar charts.


getSeriesCount

public int getSeriesCount()
Returns the count of series the style is defined for.


getSeriesPaint

public Color getSeriesPaint(int series)
Returns the color, a series is painted with.

Parameters:
series - series index
Returns:
null if no specific color is set for the series

setSeriesPaint

public void setSeriesPaint(int series,
                           Color color)
Sets the color, a series is painted with.

Parameters:
series - series index
color - color for the series (can be null to reset to a non-specific color)

isSeriesItemLabelsVisible

public Boolean isSeriesItemLabelsVisible(int series)
Returns whether the item labels of a series are visible.

Parameters:
series - series index
Returns:
null if property is not set for the series

setSeriesItemLabelsVisible

public void setSeriesItemLabelsVisible(int series,
                                       Boolean visible)
Sets whether the item labels of a series are visible.

Parameters:
series - series index
visible - indicates the visibility of the series (can be null to reset to a non-specific property)

isSeriesShapesVisible

public Boolean isSeriesShapesVisible(int series)
Returns whether the shapes of a series are visible.

Parameters:
series - series index
Returns:
null if property is not set for the series

setSeriesShapesVisible

public void setSeriesShapesVisible(int series,
                                   Boolean visible)
Sets whether the shapes of a series are visible.

Parameters:
series - series index
visible - indicates the visibility of the series (can be null to reset to a non-specific property)

isSeriesLegendVisible

public Boolean isSeriesLegendVisible(int series)
Returns whether the series is shown in the legend.

Parameters:
series - series index
Returns:
null if property is not set for the series

setSeriesLegendVisible

public void setSeriesLegendVisible(int series,
                                   Boolean visible)
Sets whether the series is shown in the legend.

Parameters:
series - series index
visible - indicates the visibility of the series legend item (can be null to reset to a non-specific property)

getSeriesLegendLabel

public ChartLabelStyle getSeriesLegendLabel(int series)
Returns the style of the series label in the legend.

Parameters:
series - series index
Returns:
null if property is not set for the series

setSeriesLegendLabel

public void setSeriesLegendLabel(int series,
                                 ChartLabelStyle labelStyle)
Sets the style of the series label in the legend.

Parameters:
series - series index
labelStyle - the style for the series label in the legend (can be null to reset to a non-specific property)

getSeriesLegendTooltip

public ChartLabelStyle getSeriesLegendTooltip(int series)
Returns the style of the series tooltip in the legend.

Parameters:
series - series index
Returns:
null if property is not set for the series

setSeriesLegendTooltip

public void setSeriesLegendTooltip(int series,
                                   ChartLabelStyle tooltipStyle)
Sets the style of the series tooltip in the legend.

Parameters:
series - series index
labelStyle - the style for the series tooltip in the legend (can be null to reset to a non-specific property)

getLegendLabelGenerator

public ChartRendererStyle.LegendLabelGenerator getLegendLabelGenerator()
Returns a label generator based on the legend label definitions of this style.


getLegendTooltipGenerator

public ChartRendererStyle.LegendTooltipGenerator getLegendTooltipGenerator()
Returns a label generator based on the legend tooltip definitions of this style.


applyToRenderer

public void applyToRenderer(AbstractRenderer renderer)
Applies the style to a specific renderer.
Note:

Parameters:
renderer - a renderer

applyToBarRenderer

protected void applyToBarRenderer(XYBarRenderer renderer)
Applies style properties which can only be applied to XYBarRenderer.
Called by applyToRenderer(AbstractRenderer).

Parameters:
renderer - a XYBarRenderer

applyToXYItemRenderer

protected void applyToXYItemRenderer(AbstractXYItemRenderer renderer)
Applies style properties which can only be applied to AbstractXYItemRenderer.
Called by applyToRenderer(AbstractRenderer).

Parameters:
renderer - a AbstractXYItemRenderer

applyToCategoryItemRenderer

protected void applyToCategoryItemRenderer(AbstractCategoryItemRenderer renderer)
Applies style properties which can only be applied to AbstractCategoryItemRenderer.
Called by applyToRenderer(AbstractRenderer).

Parameters:
renderer - a AbstractCategoryItemRenderer