schmitzm.jfree.chart.style
Class ChartLabelStyle

java.lang.Object
  extended by schmitzm.jfree.chart.style.ChartLabelStyle
Direct Known Subclasses:
ChartAxisStyle

public class ChartLabelStyle
extends Object

This class is a general super class for a design style of text displayed in a chart. This can be an localized text according to Translation or a simple (unlocalized) String. The setLabel(String) method will try to decode the string for multiple languages. If this is not possible the core string is taken as label.

Version:
1.0
Author:
Martin Schmitz

Field Summary
protected  Translation label
          Holds the label text.
protected  Category LOGGER
          Logger for this class
protected  Color paint
          Holds the text color of the label.
 
Constructor Summary
ChartLabelStyle()
          Creates a new style with default values (empty label, color undefined).
ChartLabelStyle(String label)
          Creates a new style (color undefined).
ChartLabelStyle(String label, Color color)
          Creates a new style.
ChartLabelStyle(Translation label, Color color)
          Creates a new style.
 
Method Summary
 String getLabel()
          Returns the label text in the default localization.
 Translation getLabelTranslation()
          Returns the label text for all localizations.
 Color getPaint()
          Returns the color for the label text.
 void setLabel(String label)
          Sets the label text.
 void setLabelTranslation(Translation label)
          Sets the label text.
 void setPaint(Color color)
          Sets the color for the label text.
 
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


label

protected Translation label
Holds the label text.


paint

protected Color paint
Holds the text color of the label.

Constructor Detail

ChartLabelStyle

public ChartLabelStyle()
Creates a new style with default values (empty label, color undefined).


ChartLabelStyle

public ChartLabelStyle(String label)
Creates a new style (color undefined).

Parameters:
label - label text (localized or static label is provided)

ChartLabelStyle

public ChartLabelStyle(String label,
                       Color color)
Creates a new style.

Parameters:
label - label text (localized or static label is provided)
color - text color

ChartLabelStyle

public ChartLabelStyle(Translation label,
                       Color color)
Creates a new style.

Parameters:
label - label text (static
color - text color
Method Detail

getLabel

public String getLabel()
Returns the label text in the default localization.

See Also:
Locale.getDefault()

setLabel

public void setLabel(String label)
Sets the label text.

Parameters:
label - the text for the label (localized or static label is provided)

getLabelTranslation

public Translation getLabelTranslation()
Returns the label text for all localizations.


setLabelTranslation

public void setLabelTranslation(Translation label)
Sets the label text.

Parameters:
label - the text for the label

getPaint

public Color getPaint()
Returns the color for the label text.


setPaint

public void setPaint(Color color)
Sets the color for the label text.

Parameters:
color - Color for the label text