net.sourceforge.chart2d
Class LegendProperties

java.lang.Object
  |
  +--net.sourceforge.chart2d.Properties
        |
        +--net.sourceforge.chart2d.LegendProperties

public final class LegendProperties
extends net.sourceforge.chart2d.Properties

A data structure for holding the properties common to all legends. Pass this to any number of Chart2D objects.


Field Summary
static java.awt.Color LEGEND_BACKGROUND_COLOR_DEFAULT
          The default is Color.white.
static boolean LEGEND_BACKGROUND_EXISTENCE_DEFAULT
          The default is false.
static boolean LEGEND_BETWEEN_LABELS_AND_BULLETS_GAP_EXISTENCE_DEFAULT
          The default is true.
static int LEGEND_BETWEEN_LABELS_AND_BULLETS_GAP_THICKNESS_MODEL_DEFAULT
          The default is 3.
static boolean LEGEND_BETWEEN_LABELS_OR_BULLETS_GAP_EXISTENCE_DEFAULT
          The default is true.
static int LEGEND_BETWEEN_LABELS_OR_BULLETS_GAP_THICKNESS_MODEL_DEFAULT
          The default is 5.
static java.awt.Color LEGEND_BORDER_COLOR_DEFAULT
          The default is Color.gray.
static boolean LEGEND_BORDER_EXISTENCE_DEFAULT
          The default is true.
static int LEGEND_BORDER_THICKNESS_MODEL_DEFAULT
          The default is 2.
static java.awt.Color LEGEND_BULLETS_OUTLINE_COLOR_DEFAULT
          The default is Color.black.
static boolean LEGEND_BULLETS_OUTLINE_EXISTENCE_DEFAULT
          The default is true.
static java.awt.Dimension LEGEND_BULLETS_SIZE_MODEL_DEFAULT
          The default is the Dimension (9, 9).
static boolean LEGEND_EXISTENCE_DEFAULT
          The default is true.
static boolean LEGEND_GAP_EXISTENCE_DEFAULT
          The default is true.
static int LEGEND_GAP_THICKNESS_MODEL_DEFAULT
          The default is 3.
static java.awt.Color LEGEND_LABELS_FONT_COLOR_DEFAULT
          The default is Color.black.
static java.lang.String LEGEND_LABELS_FONT_NAME_DEFAULT
          The default is "SansSerif".
static int LEGEND_LABELS_FONT_POINT_MODEL_DEFAULT
          The default is 11.
static int LEGEND_LABELS_FONT_STYLE_DEFAULT
          The default is Font.PLAIN.
static java.lang.String[] LEGEND_LABELS_TEXTS_DEFAULT
          The default is String[0].
 
Constructor Summary
LegendProperties()
          Creates a LegendProperties object with the documented default values.
LegendProperties(net.sourceforge.chart2d.LegendProperties legendProps)
          Creates a LegendProperties object with property values copied from another object.
 
Method Summary
 java.awt.Color getLegendBackgroundColor()
          Gets the color of the legend's background.
 boolean getLegendBackgroundExistence()
          Gets whether the legend will have a painted background or not.
 boolean getLegendBetweenLabelsAndBulletsGapExistence()
          Gets whether the gap between the legend's bullets and labels exists in their horizontal placement.
 int getLegendBetweenLabelsAndBulletsGapThicknessModel()
          Gets the thickness of the gap between the legend's bullets and labels in their horizontal placement, for the chart's model size.
 boolean getLegendBetweenLabelsOrBulletsGapExistence()
          Gets whether a gap between the legend's bullets or labels exists in their vertical placement.
 int getLegendBetweenLabelsOrBulletsGapThicknessModel()
          Gets the thickness of the gap between the legend's bullets or labels exists in their vertical placement, for the chart's model size.
 java.awt.Color getLegendBorderColor()
          Gets the color of the border around the legend.
 boolean getLegendBorderExistence()
          Gets whether there will exist a border around the legend.
 int getLegendBorderThicknessModel()
          Gets the thickness of the border around the legend for the chart's model size.
 java.awt.Color getLegendBulletsOutlineColor()
          Gets the color of the legend's bullets outline.
 boolean getLegendBulletsOutlineExistence()
          Gets whether a thin line is painted around the legend's bullets.
 java.awt.Dimension getLegendBulletsSizeModel()
          Gets the size of the legend's bullets for the chart's model size.
 boolean getLegendExistence()
          Gets whether there will exist a legend on the chart.
 boolean getLegendGapExistence()
          Gets whether a gap between the legend's border or edge and the legend's inner components exists.
 int getLegendGapThicknessModel()
          Gets the thickness of the legend's gap for the chart's model size.
 java.awt.Color getLegendLabelsFontColor()
          Gets the color of the font of the legend's labels.
 java.lang.String getLegendLabelsFontName()
          Gets name of the font of the legend's labels.
 int getLegendLabelsFontPointModel()
          Gets the point of the font of the legend's labels for the chart's model size.
 int getLegendLabelsFontStyle()
          Gets the style of the font of the legend's labels.
 java.lang.String[] getLegendLabelsTexts()
          Gets the texts of the legend labels.
 boolean isFontNameExists(java.lang.String name)
          Returns true if the font name exists in the graphics enviornment.
 void setLegendBackgroundColor(java.awt.Color color)
          Sets the color of the legend's background.
 void setLegendBackgroundExistence(boolean existence)
          Sets whether the legend will have a painted background or not.
 void setLegendBetweenLabelsAndBulletsGapExistence(boolean existence)
          Sets whether the gap between the legend's bullets and labels exists in their horizontal placement.
 void setLegendBetweenLabelsAndBulletsGapThicknessModel(int thickness)
          Sets the thickness of the gap between the legend's bullets and labels in their horizontal placement, for the chart's model size.
 void setLegendBetweenLabelsOrBulletsGapExistence(boolean existence)
          Sets whether a gap between the legend's bullets or labels exists in their vertical placement.
 void setLegendBetweenLabelsOrBulletsGapThicknessModel(int thickness)
          Sets the thickness of the gap between the legend's bullets or labels exists in their vertical placement, for the chart's model size.
 void setLegendBorderColor(java.awt.Color color)
          Sets the color of the border around the legend.
 void setLegendBorderExistence(boolean existence)
          Sets whether there will exist a border around the legend.
 void setLegendBorderThicknessModel(int thickness)
          Sets the thickness of the border around the legend for the chart's model size.
 void setLegendBulletsOutlineColor(java.awt.Color color)
          Sets the color of the legend's bullets outline.
 void setLegendBulletsOutlineExistence(boolean existence)
          Sets whether a thin line is painted around the legend's bullets.
 void setLegendBulletsSizeModel(java.awt.Dimension size)
          Sets the size of the legend's bullets for the chart's model size.
 void setLegendExistence(boolean existence)
          Sets whether there will exist a legend on the chart.
 void setLegendGapExistence(boolean existence)
          Sets whether a gap between the legend's border or edge and the legend's inner components exists.
 void setLegendGapThicknessModel(int thickness)
          Sets the thickness of the legend's gap for the chart's model size.
 void setLegendLabelsFontColor(java.awt.Color color)
          Sets the color of the font of the legend's labels.
 void setLegendLabelsFontName(java.lang.String name)
          Sets name of the font of the legend's labels.
 void setLegendLabelsFontPointModel(int point)
          Sets the point of the font of the legend's labels for the chart's model size.
 void setLegendLabelsFontStyle(int style)
          Sets the style of the font of the legend's labels.
 void setLegendLabelsTexts(java.lang.String[] texts)
          Sets the texts of the legend labels.
 void setLegendProperties(net.sourceforge.chart2d.LegendProperties legendProps)
          Sets all properties to be the values of another LegendProperties object.
 void setLegendPropertiesToDefaults()
          Sets all properties to their default values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEGEND_EXISTENCE_DEFAULT

public static final boolean LEGEND_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

LEGEND_LABELS_TEXTS_DEFAULT

public static final java.lang.String[] LEGEND_LABELS_TEXTS_DEFAULT
The default is String[0].


LEGEND_BORDER_EXISTENCE_DEFAULT

public static final boolean LEGEND_BORDER_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

LEGEND_BORDER_THICKNESS_MODEL_DEFAULT

public static final int LEGEND_BORDER_THICKNESS_MODEL_DEFAULT
The default is 2.

See Also:
Constant Field Values

LEGEND_BORDER_COLOR_DEFAULT

public static final java.awt.Color LEGEND_BORDER_COLOR_DEFAULT
The default is Color.gray.


LEGEND_GAP_EXISTENCE_DEFAULT

public static final boolean LEGEND_GAP_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

LEGEND_GAP_THICKNESS_MODEL_DEFAULT

public static final int LEGEND_GAP_THICKNESS_MODEL_DEFAULT
The default is 3.

See Also:
Constant Field Values

LEGEND_BACKGROUND_EXISTENCE_DEFAULT

public static final boolean LEGEND_BACKGROUND_EXISTENCE_DEFAULT
The default is false.

See Also:
Constant Field Values

LEGEND_BACKGROUND_COLOR_DEFAULT

public static final java.awt.Color LEGEND_BACKGROUND_COLOR_DEFAULT
The default is Color.white.


LEGEND_LABELS_FONT_POINT_MODEL_DEFAULT

public static final int LEGEND_LABELS_FONT_POINT_MODEL_DEFAULT
The default is 11.

See Also:
Constant Field Values

LEGEND_LABELS_FONT_NAME_DEFAULT

public static final java.lang.String LEGEND_LABELS_FONT_NAME_DEFAULT
The default is "SansSerif".

See Also:
Constant Field Values

LEGEND_LABELS_FONT_COLOR_DEFAULT

public static final java.awt.Color LEGEND_LABELS_FONT_COLOR_DEFAULT
The default is Color.black.


LEGEND_LABELS_FONT_STYLE_DEFAULT

public static final int LEGEND_LABELS_FONT_STYLE_DEFAULT
The default is Font.PLAIN.

See Also:
Constant Field Values

LEGEND_BETWEEN_LABELS_OR_BULLETS_GAP_EXISTENCE_DEFAULT

public static final boolean LEGEND_BETWEEN_LABELS_OR_BULLETS_GAP_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

LEGEND_BETWEEN_LABELS_OR_BULLETS_GAP_THICKNESS_MODEL_DEFAULT

public static final int LEGEND_BETWEEN_LABELS_OR_BULLETS_GAP_THICKNESS_MODEL_DEFAULT
The default is 5.

See Also:
Constant Field Values

LEGEND_BETWEEN_LABELS_AND_BULLETS_GAP_EXISTENCE_DEFAULT

public static final boolean LEGEND_BETWEEN_LABELS_AND_BULLETS_GAP_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

LEGEND_BETWEEN_LABELS_AND_BULLETS_GAP_THICKNESS_MODEL_DEFAULT

public static final int LEGEND_BETWEEN_LABELS_AND_BULLETS_GAP_THICKNESS_MODEL_DEFAULT
The default is 3.

See Also:
Constant Field Values

LEGEND_BULLETS_OUTLINE_EXISTENCE_DEFAULT

public static final boolean LEGEND_BULLETS_OUTLINE_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

LEGEND_BULLETS_OUTLINE_COLOR_DEFAULT

public static final java.awt.Color LEGEND_BULLETS_OUTLINE_COLOR_DEFAULT
The default is Color.black.


LEGEND_BULLETS_SIZE_MODEL_DEFAULT

public static final java.awt.Dimension LEGEND_BULLETS_SIZE_MODEL_DEFAULT
The default is the Dimension (9, 9).

Constructor Detail

LegendProperties

public LegendProperties()
Creates a LegendProperties object with the documented default values.


LegendProperties

public LegendProperties(net.sourceforge.chart2d.LegendProperties legendProps)
Creates a LegendProperties object with property values copied from another object. The copying is a deep copy.

Parameters:
legendProps - The properties to copy.
Method Detail

setLegendPropertiesToDefaults

public final void setLegendPropertiesToDefaults()
Sets all properties to their default values.


setLegendProperties

public final void setLegendProperties(net.sourceforge.chart2d.LegendProperties legendProps)
Sets all properties to be the values of another LegendProperties object. The copying is a deep copy.

Parameters:
legendProps - The properties to copy.

setLegendExistence

public final void setLegendExistence(boolean existence)
Sets whether there will exist a legend on the chart.

Parameters:
existence - If true, there will be a legend for the chart.

setLegendLabelsTexts

public final void setLegendLabelsTexts(java.lang.String[] texts)
Sets the texts of the legend labels. The number of texts must be equal to the total number of data sets of this chart.

Parameters:
texts - The texts for the legend labels.

setLegendBorderExistence

public final void setLegendBorderExistence(boolean existence)
Sets whether there will exist a border around the legend.

Parameters:
existence - If true, there will be a border around the legend.

setLegendBorderThicknessModel

public final void setLegendBorderThicknessModel(int thickness)
Sets the thickness of the border around the legend for the chart's model size.

Parameters:
thickness - The model thicknes for the chart.

setLegendBorderColor

public final void setLegendBorderColor(java.awt.Color color)
Sets the color of the border around the legend.

Parameters:
color - The color of the legend's border.

setLegendGapExistence

public final void setLegendGapExistence(boolean existence)
Sets whether a gap between the legend's border or edge and the legend's inner components exists.

Parameters:
existence - If true, then a gap exists.

setLegendGapThicknessModel

public final void setLegendGapThicknessModel(int thickness)
Sets the thickness of the legend's gap for the chart's model size.

Parameters:
thickness - The model thickness of the legend's gap.

setLegendBackgroundExistence

public final void setLegendBackgroundExistence(boolean existence)
Sets whether the legend will have a painted background or not. If not whatever is behind the legend will show through the spaces of the legend.

Parameters:
existence - If true, the background of the legend will be painted.

setLegendBackgroundColor

public final void setLegendBackgroundColor(java.awt.Color color)
Sets the color of the legend's background.

Parameters:
color - The color of the legend's background.

setLegendLabelsFontPointModel

public final void setLegendLabelsFontPointModel(int point)
Sets the point of the font of the legend's labels for the chart's model size.

Parameters:
point - The model font point of the legend's labels.

setLegendLabelsFontName

public final void setLegendLabelsFontName(java.lang.String name)
Sets name of the font of the legend's labels. Accepts all values accepted by java.awt.Font.

Parameters:
name - The name of the font for the legend's labels.

setLegendLabelsFontColor

public final void setLegendLabelsFontColor(java.awt.Color color)
Sets the color of the font of the legend's labels.

Parameters:
color - The color of the font of the legend's labels.

setLegendLabelsFontStyle

public final void setLegendLabelsFontStyle(int style)
Sets the style of the font of the legend's labels. Accepts all values that java.awt.Font accepts.

Parameters:
style - The style of the font of the legend's labels.

setLegendBetweenLabelsOrBulletsGapExistence

public final void setLegendBetweenLabelsOrBulletsGapExistence(boolean existence)
Sets whether a gap between the legend's bullets or labels exists in their vertical placement.

Parameters:
existence - If true, a gap exists.

setLegendBetweenLabelsOrBulletsGapThicknessModel

public final void setLegendBetweenLabelsOrBulletsGapThicknessModel(int thickness)
Sets the thickness of the gap between the legend's bullets or labels exists in their vertical placement, for the chart's model size.

Parameters:
thickness - The model thickness of the gap.

setLegendBetweenLabelsAndBulletsGapExistence

public final void setLegendBetweenLabelsAndBulletsGapExistence(boolean existence)
Sets whether the gap between the legend's bullets and labels exists in their horizontal placement.

Parameters:
existence - If true, a gap exists.

setLegendBetweenLabelsAndBulletsGapThicknessModel

public final void setLegendBetweenLabelsAndBulletsGapThicknessModel(int thickness)
Sets the thickness of the gap between the legend's bullets and labels in their horizontal placement, for the chart's model size.

Parameters:
thickness - The model thickness of teh gap.

setLegendBulletsOutlineExistence

public final void setLegendBulletsOutlineExistence(boolean existence)
Sets whether a thin line is painted around the legend's bullets.

Parameters:
existence - If true, the legend's bullets will be outlined.

setLegendBulletsOutlineColor

public final void setLegendBulletsOutlineColor(java.awt.Color color)
Sets the color of the legend's bullets outline.

Parameters:
color - The color of the legend's bullets outline.

setLegendBulletsSizeModel

public final void setLegendBulletsSizeModel(java.awt.Dimension size)
Sets the size of the legend's bullets for the chart's model size.

Parameters:
size - The size of the legend's bullets.

getLegendExistence

public final boolean getLegendExistence()
Gets whether there will exist a legend on the chart.

Returns:
boolean If true, there will be a legend for the chart.

getLegendLabelsTexts

public final java.lang.String[] getLegendLabelsTexts()
Gets the texts of the legend labels. The number of texts must be equal to the total number of data sets of this chart.

Returns:
String[] The texts for the legend labels.

getLegendBorderExistence

public final boolean getLegendBorderExistence()
Gets whether there will exist a border around the legend.

Returns:
boolean If true, there will be a border around the legend.

getLegendBorderThicknessModel

public final int getLegendBorderThicknessModel()
Gets the thickness of the border around the legend for the chart's model size.

Returns:
int The model thicknes for the chart.

getLegendBorderColor

public final java.awt.Color getLegendBorderColor()
Gets the color of the border around the legend.

Returns:
Color The color of the legend's border.

getLegendGapExistence

public final boolean getLegendGapExistence()
Gets whether a gap between the legend's border or edge and the legend's inner components exists.

Returns:
boolean If true, then a gap exists.

getLegendGapThicknessModel

public final int getLegendGapThicknessModel()
Gets the thickness of the legend's gap for the chart's model size.

Returns:
int The model thickness of the legend's gap.

getLegendBackgroundExistence

public final boolean getLegendBackgroundExistence()
Gets whether the legend will have a painted background or not. If not whatever is behind the legend will show through the spaces of the legend.

Returns:
boolean If true, the background of the legend will be painted.

getLegendBackgroundColor

public final java.awt.Color getLegendBackgroundColor()
Gets the color of the legend's background.

Returns:
Color The color of the legend's background.

getLegendLabelsFontPointModel

public final int getLegendLabelsFontPointModel()
Gets the point of the font of the legend's labels for the chart's model size.

Returns:
int The model font point of the legend's labels.

getLegendLabelsFontName

public final java.lang.String getLegendLabelsFontName()
Gets name of the font of the legend's labels. Accepts all values accepted by java.awt.Font.

Returns:
String The name of the font for the legend's labels.

getLegendLabelsFontColor

public final java.awt.Color getLegendLabelsFontColor()
Gets the color of the font of the legend's labels.

Returns:
Color The color of the font of the legend's labels.

getLegendLabelsFontStyle

public final int getLegendLabelsFontStyle()
Gets the style of the font of the legend's labels. Accepts all values that java.awt.Font accepts.

Returns:
int The style of the font of the legend's labels.

getLegendBetweenLabelsOrBulletsGapExistence

public final boolean getLegendBetweenLabelsOrBulletsGapExistence()
Gets whether a gap between the legend's bullets or labels exists in their vertical placement.

Returns:
boolean If true, a gap exists.

getLegendBetweenLabelsOrBulletsGapThicknessModel

public final int getLegendBetweenLabelsOrBulletsGapThicknessModel()
Gets the thickness of the gap between the legend's bullets or labels exists in their vertical placement, for the chart's model size.

Returns:
int The model thickness of the gap.

getLegendBetweenLabelsAndBulletsGapExistence

public final boolean getLegendBetweenLabelsAndBulletsGapExistence()
Gets whether the gap between the legend's bullets and labels exists in their horizontal placement.

Returns:
boolean If true, a gap exists.

getLegendBetweenLabelsAndBulletsGapThicknessModel

public final int getLegendBetweenLabelsAndBulletsGapThicknessModel()
Gets the thickness of the gap between the legend's bullets and labels in their horizontal placement, for the chart's model size.

Returns:
int The model thickness of teh gap.

getLegendBulletsOutlineExistence

public final boolean getLegendBulletsOutlineExistence()
Gets whether a thin line is painted around the legend's bullets.

Returns:
boolean If true, the legend's bullets will be outlined.

getLegendBulletsOutlineColor

public final java.awt.Color getLegendBulletsOutlineColor()
Gets the color of the legend's bullets outline.

Returns:
Color The color of the legend's bullets outline.

getLegendBulletsSizeModel

public final java.awt.Dimension getLegendBulletsSizeModel()
Gets the size of the legend's bullets for the chart's model size.

Returns:
Dimension The size of the legend's bullets.

isFontNameExists

public final boolean isFontNameExists(java.lang.String name)
Returns true if the font name exists in the graphics enviornment.

Parameters:
name - The name of the font to determine the existence of.
Returns:
boolean If true, then the font name exists.