net.sourceforge.chart2d
Class Chart2DProperties

java.lang.Object
  |
  +--net.sourceforge.chart2d.Chart2DProperties

public class Chart2DProperties
extends java.lang.Object

A data structure for holding the properties common to all Chart2D charts. Pass this to any number of GraphChart2DProperties or PieChart2DProperties classes.


Field Summary
static java.awt.Color CHART_BACKGROUND_COLOR_DEFAULT
          The default is Color.white.
static boolean CHART_BACKGROUND_EXISTENCE_DEFAULT
          The default is true.
static boolean CHART_BETWEEN_CHART_AND_LEGEND_GAP_EXISTENCE_DEFAULT
          The default is true.
static int CHART_BETWEEN_CHART_AND_LEGEND_GAP_THICKNESS_MODEL_DEFAULT
          The default is 5.
static java.awt.Color CHART_BORDER_COLOR_DEFAULT
          The default is Color.black.
static boolean CHART_BORDER_EXISTENCE_DEFAULT
          The default is true.
static int CHART_BORDER_THICKNESS_MODEL_DEFAULT
          The default is 2.
static int CHART_DATA_LABELS_PRECISION_DEFAULT
          The default is MAX_INTEGER.
static boolean CHART_DATASET_AUTO_COLOR_DEFAULT
          The default is true.
static int CHART_DATASET_AUTO_COLOR_TYPE_DEFAULT
          The default is NATURAL.
static boolean CHART_GAP_EXISTENCE_DEFAULT
          The default is true.
static int CHART_GAP_THICKNESS_MODEL_DEFAULT
          The default is 5.
static boolean CHART_MAGNIFY_WHEN_RESIZE_DEFAULT
          The default is true.
static boolean CHART_STRETCH_WHEN_RESIZE_DEFAULT
          The default is true.
static boolean CHART_TITLE_BETWEEN_REST_GAP_EXISTENCE_DEFAULT
          The default is true.
static int CHART_TITLE_BETWEEN_REST_GAP_THICKNESS_MODEL_DEFAULT
          The default is 5.
static boolean CHART_TITLE_EXISTENCE_DEFAULT
          The default is true.
static java.awt.Color CHART_TITLE_FONT_COLOR_DEFAULT
          The default is Color.black.
static java.lang.String CHART_TITLE_FONT_NAME_DEFAULT
          The default is "SansSerif".
static int CHART_TITLE_FONT_POINT_MODEL_DEFAULT
          The default is 16.
static int CHART_TITLE_FONT_STYLE_DEFAULT
          The default is Font.PLAIN.
static java.lang.String CHART_TITLE_TEXT_DEFAULT
          The default is "".
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 5.
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.black.
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 5.
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 12.
static int LEGEND_LABELS_FONT_STYLE_DEFAULT
          The default is Font.PLAIN.
static int MAX_FLOAT
          Used by setChartDatasetLabelsPrecision (int).
static int MAX_INTEGER
          Used by setChartDatasetLabelsPrecision (int).
static int NATURAL
          For use with setChartDatasetAutoColorsType (int).
static int PASTEL
          For use with setChartDatasetAutoColorsType (int).
static boolean VALIDATE_ON_UPDATE_DEFAULT
          The default is true.
 
Constructor Summary
Chart2DProperties()
          Creates a Chart2DProperties object with the documented default values.
Chart2DProperties(Chart2DProperties chart2DProps)
          Creates a Chart2DProperties object with copied properties of another Chart2DProperties object.
 
Method Summary
(package private)  void addChart2D(Chart2D chart2D)
          Adds a Chart2D to the set of objects using these properties.
(package private)  boolean getChart2DNeedsUpdate(Chart2D chart2D)
          True if a property has been changed and this Chart2D has not yet been updated.
 java.util.Vector getChart2DVector()
          Returns the vector of Chart2D objects that are using this object.
 java.awt.Color getChartBackgroundColor()
          Returns the color of the background for the chart.
 boolean getChartBackgroundExistence()
          Returns whether the chart will have a painted background or not.
 boolean getChartBetweenChartAndLegendGapExistence()
          Returns whether the gap between the chart and the legend exists.
 int getChartBetweenChartAndLegendGapThicknessModel()
          Returns the thickness of the gap between the chart and the legend for the chart's model size.
 java.awt.Color getChartBorderColor()
          Returns the color of the chart's border.
 boolean getChartBorderExistence()
          Returns whether a border around the chart will exist.
 int getChartBorderThicknessModel()
          Returns the thickness of the border for the model size of the chart.
 int getChartDataLabelsPrecision()
          Returns the look of labels that are supposed to describe the value of the data.
 boolean getChartDatasetAutoColor()
          Returns whether the colors for the chart's data sets [the colors of the legend's bullets and/or the colors of the data representation components [bars, lines, dots, and/or pie sectors]], will be selected automatically by the Chart2D package or not.
 int getChartDatasetAutoColorType()
          Returns whether the colors automatically selected will be NATURAL or PASTEL colors.
 boolean getChartGapExistence()
          Returns whether a gap between the border or edge of the chart and the chart's interior components exists.
 int getChartGapThicknessModel()
          Returns the thickness of the chart's gap for the model size of the chart.
 boolean getChartMagnifyWhenResize()
          Returns whether a chart's components will grow or shrink as the size of the space allocated to the chart grows or shrinks.
 boolean getChartStretchWhenResize()
          Returns whether a chart will take up all the space allocated to it, or will center itself within the space, only taking the space it needs.
 boolean getChartTitleBetweenRestGapExistence()
          Returns whether a gap below the title and the rest of the chart's components exists.
 int getChartTitleBetweenRestGapThicknessModel()
          Returns the thickness of the gap below the title and the rest of the chart's components for the chart's model size.
 boolean getChartTitleExistence()
          Returns whether the chart is to have a title.
 java.awt.Color getChartTitleFontColor()
          Returns the color of the font for the chart's title.
 java.lang.String getChartTitleFontName()
          Returns the name of the font for the chart's title.
 int getChartTitleFontPointModel()
          Returns the point of the font of the title for the chart at its model size.
 int getChartTitleFontStyle()
          Returns the style of the font for the chart's title.
 java.lang.String getChartTitleText()
          Returns the text for the chart's title.
 java.util.Vector getFontNamesVector()
          Returns a vector of strings with all the font names available in the graphics environment.
 java.awt.Color getLegendBackgroundColor()
          Returns the color of the legend's background.
 boolean getLegendBackgroundExistence()
          Returns whether the legend will have a painted background or not.
 boolean getLegendBetweenLabelsAndBulletsGapExistence()
          Returns whether the gap between the legend's bullets and labels exists in their horizontal placement.
 int getLegendBetweenLabelsAndBulletsGapThicknessModel()
          Returns the thickness of the gap between the legend's bullets and labels in their horizontal placement, for the chart's model size.
 boolean getLegendBetweenLabelsOrBulletsGapExistence()
          Returns whether a gap between the legend's bullets or labels exists in their vertical placement.
 int getLegendBetweenLabelsOrBulletsGapThicknessModel()
          Returns 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()
          Returns the color of the border around the legend.
 boolean getLegendBorderExistence()
          Returns whether there will exist a border around the legend.
 int getLegendBorderThicknessModel()
          Returns the thickness of the border around the legend for the chart's model size.
 java.awt.Color getLegendBulletsOutlineColor()
          Returns the color of the legend's bullets outline.
 boolean getLegendBulletsOutlineExistence()
          Returns whether a thin line is painted around the legend's bullets.
 java.awt.Dimension getLegendBulletsSizeModel()
          Returns the size of the legend's bullets for the chart's model size.
 boolean getLegendExistence()
          Returns whether there will exist a legend on the chart.
 boolean getLegendGapExistence()
          Returns whether a gap between the legend's border or edge and the legend's inner components exists.
 int getLegendGapThicknessModel()
          Returns the thickness of the legend's gap for the chart's model size.
 java.awt.Color getLegendLabelsFontColor()
          Returns the color of the font of the legend's labels.
 java.lang.String getLegendLabelsFontName()
          Returns name of the font of the legend's labels.
 int getLegendLabelsFontPointModel()
          Returns the point of the font of the legend's labels for the chart's model size.
 int getLegendLabelsFontStyle()
          Returns the style of the font of the legend's labels.
 boolean getValidateOnUpdate()
          Returns whether the properties should be validated whenever a chart is to be updated with a changed property.
 boolean isFontNameExists(java.lang.String name)
          Returns true if the font name exists in the graphics enviornment.
(package private)  void removeChart2D(Chart2D chart2D)
          Removes a Chart2D to the set of objects using these properties.
 void setChart2DProperties(Chart2DProperties chart2DProps)
          Specifies all of the properties by copying them from another Chart2DProperties class.
 void setChart2DPropertiesToDefaults()
          Sets all properties to their default values.
 void setChartBackgroundColor(java.awt.Color color)
          Specifies the color of the background for the chart.
 void setChartBackgroundExistence(boolean existence)
          Specifies whether the chart will have a painted background or not.
 void setChartBetweenChartAndLegendGapExistence(boolean existence)
          Specifies whether the gap between the chart and the legend exists.
 void setChartBetweenChartAndLegendGapThicknessModel(int thickness)
          Specifies the thickness of the gap between the chart and the legend for the chart's model size.
 void setChartBorderColor(java.awt.Color color)
          Specifies the color of the chart's border.
 void setChartBorderExistence(boolean existence)
          Specifies whether a border around the chart will exist.
 void setChartBorderThicknessModel(int thickness)
          Specifies the thickness of the border for the model size of the chart.
 void setChartDataLabelsPrecision(int precision)
          Specifies the look of labels that are supposed to describe the value of the data.
 void setChartDatasetAutoColor(boolean auto)
          Specifies whether the colors for the chart's data sets [the colors of the legend's bullets and/or the colors of the data representation components [bars, lines, dots, and/or pie sectors]], will be selected automatically by the Chart2D package or not.
 void setChartDatasetAutoColorType(int type)
          Specifies whether the colors automatically selected will be NATURAL or PASTEL colors.
 void setChartGapExistence(boolean existence)
          Specifies whether a gap between the border or edge of the chart and the chart's interior components exists.
 void setChartGapThicknessModel(int thickness)
          Specifies the thickness of the chart's gap for the model size of the chart.
 void setChartMagnifyWhenResize(boolean magnify)
          Specifies whether a chart's components will grow or shrink as the size of the space allocated to the chart grows or shrinks.
 void setChartStretchWhenResize(boolean stretch)
          Specifies whether a chart will take up all the space allocated to it, or will center itself within the space, only taking the space it needs.
 void setChartTitleBetweenRestGapExistence(boolean existence)
          Specifies whether a gap below the title and the rest of the chart's components exists.
 void setChartTitleBetweenRestGapThicknessModel(int thickness)
          Specifies the thickness of the gap below the title and the rest of the chart's components for the chart's model size.
 void setChartTitleExistence(boolean existence)
          Specifies whether the chart is to have a title.
 void setChartTitleFontColor(java.awt.Color color)
          Specifies the color of the font for the chart's title.
 void setChartTitleFontName(java.lang.String name)
          Specifies the name of the font for the chart's title.
 void setChartTitleFontPointModel(int point)
          Specifies the point of the font of the title for the chart at its model size.
 void setChartTitleFontStyle(int style)
          Specifies the style of the font for the chart's title.
 void setChartTitleText(java.lang.String text)
          Specifies the text for the chart's title.
 void setLegendBackgroundColor(java.awt.Color color)
          Specifies the color of the legend's background.
 void setLegendBackgroundExistence(boolean existence)
          Specifies whether the legend will have a painted background or not.
 void setLegendBetweenLabelsAndBulletsGapExistence(boolean existence)
          Specifies whether the gap between the legend's bullets and labels exists in their horizontal placement.
 void setLegendBetweenLabelsAndBulletsGapThicknessModel(int thickness)
          Specifies 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)
          Specifies whether a gap between the legend's bullets or labels exists in their vertical placement.
 void setLegendBetweenLabelsOrBulletsGapThicknessModel(int thickness)
          Specifies 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)
          Specifies the color of the border around the legend.
 void setLegendBorderExistence(boolean existence)
          Specifies whether there will exist a border around the legend.
 void setLegendBorderThicknessModel(int thickness)
          Specifies the thickness of the border around the legend for the chart's model size.
 void setLegendBulletsOutlineColor(java.awt.Color color)
          Specifies the color of the legend's bullets outline.
 void setLegendBulletsOutlineExistence(boolean existence)
          Specifies whether a thin line is painted around the legend's bullets.
 void setLegendBulletsSizeModel(java.awt.Dimension size)
          Specifies the size of the legend's bullets for the chart's model size.
 void setLegendExistence(boolean existence)
          Specifies whether there will exist a legend on the chart.
 void setLegendGapExistence(boolean existence)
          Specifies whether a gap between the legend's border or edge and the legend's inner components exists.
 void setLegendGapThicknessModel(int thickness)
          Specifies the thickness of the legend's gap for the chart's model size.
 void setLegendLabelsFontColor(java.awt.Color color)
          Specifies the color of the font of the legend's labels.
 void setLegendLabelsFontName(java.lang.String name)
          Specifies name of the font of the legend's labels.
 void setLegendLabelsFontPointModel(int point)
          Specifies the point of the font of the legend's labels for the chart's model size.
 void setLegendLabelsFontStyle(int style)
          Specifies the style of the font of the legend's labels.
 void setValidateOnUpdate(boolean validate)
          Specifies whether the properties should be validated whenever a chart is to be updated with a changed property.
(package private)  void updateChart2D(Chart2D chart2D)
          Updates the properties of this Chart2D with these Chart2D properties.
 boolean validate(boolean debug)
          Returns true if the properties are valid.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NATURAL

public static final int NATURAL
For use with setChartDatasetAutoColorsType (int). NATURAL colors are more pure than PASTEL colors. For example, a red color will be pure red, no green or blue will be added.

PASTEL

public static final int PASTEL
For use with setChartDatasetAutoColorsType (int). PASTEL colors have other colors besides their primary ones added to them. For example, a red color may appear pink or orange instead of red.

MAX_INTEGER

public static final int MAX_INTEGER
Used by setChartDatasetLabelsPrecision (int). The number is 8. This makes the labels have as many zeroes to the left of the decimal as possible. The labels will not have decimals in them.

MAX_FLOAT

public static final int MAX_FLOAT
Used by setChartDatasetLabelsPrecision (int). The number is -8. This makes the float labels have as many digits to the right of the decimal as possible. The labels will have decimals in them.

CHART_MAGNIFY_WHEN_RESIZE_DEFAULT

public static final boolean CHART_MAGNIFY_WHEN_RESIZE_DEFAULT
The default is true.

CHART_STRETCH_WHEN_RESIZE_DEFAULT

public static final boolean CHART_STRETCH_WHEN_RESIZE_DEFAULT
The default is true.

CHART_BORDER_EXISTENCE_DEFAULT

public static final boolean CHART_BORDER_EXISTENCE_DEFAULT
The default is true.

CHART_BORDER_THICKNESS_MODEL_DEFAULT

public static final int CHART_BORDER_THICKNESS_MODEL_DEFAULT
The default is 2.

CHART_BORDER_COLOR_DEFAULT

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

CHART_GAP_EXISTENCE_DEFAULT

public static final boolean CHART_GAP_EXISTENCE_DEFAULT
The default is true.

CHART_GAP_THICKNESS_MODEL_DEFAULT

public static final int CHART_GAP_THICKNESS_MODEL_DEFAULT
The default is 5.

CHART_BACKGROUND_EXISTENCE_DEFAULT

public static final boolean CHART_BACKGROUND_EXISTENCE_DEFAULT
The default is true.

CHART_BACKGROUND_COLOR_DEFAULT

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

CHART_TITLE_EXISTENCE_DEFAULT

public static final boolean CHART_TITLE_EXISTENCE_DEFAULT
The default is true.

CHART_TITLE_TEXT_DEFAULT

public static final java.lang.String CHART_TITLE_TEXT_DEFAULT
The default is "".

CHART_TITLE_FONT_POINT_MODEL_DEFAULT

public static final int CHART_TITLE_FONT_POINT_MODEL_DEFAULT
The default is 16.

CHART_TITLE_FONT_NAME_DEFAULT

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

CHART_TITLE_FONT_COLOR_DEFAULT

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

CHART_TITLE_FONT_STYLE_DEFAULT

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

CHART_TITLE_BETWEEN_REST_GAP_EXISTENCE_DEFAULT

public static final boolean CHART_TITLE_BETWEEN_REST_GAP_EXISTENCE_DEFAULT
The default is true.

CHART_TITLE_BETWEEN_REST_GAP_THICKNESS_MODEL_DEFAULT

public static final int CHART_TITLE_BETWEEN_REST_GAP_THICKNESS_MODEL_DEFAULT
The default is 5.

CHART_DATASET_AUTO_COLOR_DEFAULT

public static final boolean CHART_DATASET_AUTO_COLOR_DEFAULT
The default is true.

CHART_DATASET_AUTO_COLOR_TYPE_DEFAULT

public static final int CHART_DATASET_AUTO_COLOR_TYPE_DEFAULT
The default is NATURAL.

CHART_DATA_LABELS_PRECISION_DEFAULT

public static final int CHART_DATA_LABELS_PRECISION_DEFAULT
The default is MAX_INTEGER.

CHART_BETWEEN_CHART_AND_LEGEND_GAP_EXISTENCE_DEFAULT

public static final boolean CHART_BETWEEN_CHART_AND_LEGEND_GAP_EXISTENCE_DEFAULT
The default is true.

CHART_BETWEEN_CHART_AND_LEGEND_GAP_THICKNESS_MODEL_DEFAULT

public static final int CHART_BETWEEN_CHART_AND_LEGEND_GAP_THICKNESS_MODEL_DEFAULT
The default is 5.

LEGEND_EXISTENCE_DEFAULT

public static final boolean LEGEND_EXISTENCE_DEFAULT
The default is true.

LEGEND_BORDER_EXISTENCE_DEFAULT

public static final boolean LEGEND_BORDER_EXISTENCE_DEFAULT
The default is true.

LEGEND_BORDER_THICKNESS_MODEL_DEFAULT

public static final int LEGEND_BORDER_THICKNESS_MODEL_DEFAULT
The default is 2.

LEGEND_BORDER_COLOR_DEFAULT

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

LEGEND_GAP_EXISTENCE_DEFAULT

public static final boolean LEGEND_GAP_EXISTENCE_DEFAULT
The default is true.

LEGEND_GAP_THICKNESS_MODEL_DEFAULT

public static final int LEGEND_GAP_THICKNESS_MODEL_DEFAULT
The default is 5.

LEGEND_BACKGROUND_EXISTENCE_DEFAULT

public static final boolean LEGEND_BACKGROUND_EXISTENCE_DEFAULT
The default is false.

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 12.

LEGEND_LABELS_FONT_NAME_DEFAULT

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

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.

LEGEND_BETWEEN_LABELS_OR_BULLETS_GAP_EXISTENCE_DEFAULT

public static final boolean LEGEND_BETWEEN_LABELS_OR_BULLETS_GAP_EXISTENCE_DEFAULT
The default is true.

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.

LEGEND_BETWEEN_LABELS_AND_BULLETS_GAP_EXISTENCE_DEFAULT

public static final boolean LEGEND_BETWEEN_LABELS_AND_BULLETS_GAP_EXISTENCE_DEFAULT
The default is true.

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 5.

LEGEND_BULLETS_OUTLINE_EXISTENCE_DEFAULT

public static final boolean LEGEND_BULLETS_OUTLINE_EXISTENCE_DEFAULT
The default is true.

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).

VALIDATE_ON_UPDATE_DEFAULT

public static final boolean VALIDATE_ON_UPDATE_DEFAULT
The default is true.
Constructor Detail

Chart2DProperties

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

Chart2DProperties

public Chart2DProperties(Chart2DProperties chart2DProps)
Creates a Chart2DProperties object with copied properties of another Chart2DProperties object. The copying is a deep copy.
Parameters:
chart2DProps - The properties to copy.
Method Detail

setChart2DPropertiesToDefaults

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

setChart2DProperties

public void setChart2DProperties(Chart2DProperties chart2DProps)
Specifies all of the properties by copying them from another Chart2DProperties class. The copying is a deep copy.
Parameters:
chart2DProps - The properties to copy.

setChartMagnifyWhenResize

public void setChartMagnifyWhenResize(boolean magnify)
Specifies whether a chart's components will grow or shrink as the size of the space allocated to the chart grows or shrinks. All Chart2D charts have a model size [see the *Chart2D classes for information about the model size]. When the size allocated to the chart grows or shrinks, a ratio defined as the new size divided by the model size is computed and applied to each of the component sizing settings (ex. the border thickness model of the chart).
Parameters:
magnify - If true, the chart will be magnified on resize.

setChartStretchWhenResize

public void setChartStretchWhenResize(boolean stretch)
Specifies whether a chart will take up all the space allocated to it, or will center itself within the space, only taking the space it needs. Generally, for applications where charts are added to a GUI, the charts will stretch to fit the size allocated to them by the the layout manager; for applications where a BufferedImage of the chart is all that is desired, the chart will not stretch.
Parameters:
stretch - If true, then the chart will stretch.

setChartBorderExistence

public void setChartBorderExistence(boolean existence)
Specifies whether a border around the chart will exist.
Parameters:
existence - If true, then a chart border exists.

setChartBorderThicknessModel

public void setChartBorderThicknessModel(int thickness)
Specifies the thickness of the border for the model size of the chart.
Parameters:
thickness - The model thickness of the chart's border.

setChartBorderColor

public void setChartBorderColor(java.awt.Color color)
Specifies the color of the chart's border.
Parameters:
color - The color of the border.

setChartGapExistence

public void setChartGapExistence(boolean existence)
Specifies whether a gap between the border or edge of the chart and the chart's interior components exists.
Parameters:
existence - If true, then a gap exists.

setChartGapThicknessModel

public void setChartGapThicknessModel(int thickness)
Specifies the thickness of the chart's gap for the model size of the chart.
Parameters:
thickness - The model thickness of the chart's gap.

setChartBackgroundExistence

public void setChartBackgroundExistence(boolean existence)
Specifies whether the chart will have a painted background or not. If not, then the background of the content pane to which the chart was added will show through which by default is gray, or if the chart was not added to a content pane but only a BufferedImage of the chart is obtained, then the background will be the default background of BufferedImage which is black.
Parameters:
existence - If true, a bacground for the chart will be painted.

setChartBackgroundColor

public void setChartBackgroundColor(java.awt.Color color)
Specifies the color of the background for the chart.
Parameters:
color - The color of the chart's background.

setChartTitleExistence

public void setChartTitleExistence(boolean existence)
Specifies whether the chart is to have a title.
Parameters:
existence - If true, then the chart will have a title.

setChartTitleText

public void setChartTitleText(java.lang.String text)
Specifies the text for the chart's title.
Parameters:
text - The text for the chart's title.

setChartTitleFontPointModel

public void setChartTitleFontPointModel(int point)
Specifies the point of the font of the title for the chart at its model size.
Parameters:
point - The model font point for the chart's title.

setChartTitleFontName

public void setChartTitleFontName(java.lang.String name)
Specifies the name of the font for the chart's title. Accepts all values accepted by java.awt.Font.
Parameters:
name - The name of the font for the chart's title.

setChartTitleFontColor

public void setChartTitleFontColor(java.awt.Color color)
Specifies the color of the font for the chart's title.
Parameters:
color - The color of the font for the chart's title.

setChartTitleFontStyle

public void setChartTitleFontStyle(int style)
Specifies the style of the font for the chart's title. Accepts all values that java.awt.Font accepts.
Parameters:
style - The style of the font for the chart's title.

setChartTitleBetweenRestGapExistence

public void setChartTitleBetweenRestGapExistence(boolean existence)
Specifies whether a gap below the title and the rest of the chart's components exists.
Parameters:
existence - If true, then a gap exists.

setChartTitleBetweenRestGapThicknessModel

public void setChartTitleBetweenRestGapThicknessModel(int thickness)
Specifies the thickness of the gap below the title and the rest of the chart's components for the chart's model size.
Parameters:
thickness - The model thickness of the gap.

setChartDatasetAutoColor

public void setChartDatasetAutoColor(boolean auto)
Specifies whether the colors for the chart's data sets [the colors of the legend's bullets and/or the colors of the data representation components [bars, lines, dots, and/or pie sectors]], will be selected automatically by the Chart2D package or not. If so, then the colors can be adjusted through the setChartDatasetAutoColorType method. If not, then an array of colors must be passed through the setChartDatasetColors method.
Parameters:
auto - If true, then the colors will be selected automatically.

setChartDatasetAutoColorType

public void setChartDatasetAutoColorType(int type)
Specifies whether the colors automatically selected will be NATURAL or PASTEL colors. For the paramter, type, use either NATURAL or PASTEL.
Parameters:
type - The type of the colors.

setChartDataLabelsPrecision

public void setChartDataLabelsPrecision(int precision)
Specifies the look of labels that are supposed to describe the value of the data. For example, for pie charts this method will influence the labels that surround the chart, and for charts with axes this method will influence the labels on the numbers axis. The specific labels are first determined from the greatest and least value in the data set and other factors. This method then lets you adjust whether you want integer or floating point labels and how exact you want those labels to be. You do this using the precision parameter, and passing values between 38 and -38. Nonnegative ints indicate the labels will not contain a decimal (ie will be integer labels), and the specific nonnegative number indicates how many zeroes will be to the left of the decimal if it were there (ex. for the number 1976, a precision of 0 would return 1976, a precision of 1 would return 1980, a precision of 3 would return 2000, and a precision greater than 3 would also return 2000). If the number of desired zeroes is greater than the label, then the number of zeroes is automatically scaled back to be 1 less than the number of digits. Negative ints for precision indicate the labels will contain a decimal, and the specific negative number indicates how many digits to the right of the decimal are wanted (ex. for the number 1.935, a precision of -1 would return 1.9, a precision of -2 would return 1.94, a precision of -4 would return 1.9350). If the number of desired decimal places is larger than the number of places present in the number, then zeroes are added to form as many places as are desired up to -38. MAX_INTEGER or MAX_FLOAT will always indicate the maximum number of zeroes and the maximum number of decimal places possible by Chart2D's algorithm for adjusting these labels.
Parameters:
precision - The adjustement of the precision of numbers labels.

setChartBetweenChartAndLegendGapExistence

public void setChartBetweenChartAndLegendGapExistence(boolean existence)
Specifies whether the gap between the chart and the legend exists. If the legend doesn't exist, this gap will automatically not exist.
Parameters:
existence - If true, the gap exists.

setChartBetweenChartAndLegendGapThicknessModel

public void setChartBetweenChartAndLegendGapThicknessModel(int thickness)
Specifies the thickness of the gap between the chart and the legend for the chart's model size.
Parameters:
thickness - The model thickness of the gap.

setLegendExistence

public void setLegendExistence(boolean existence)
Specifies whether there will exist a legend on the chart.
Parameters:
existence - If true, there will be a legend for the chart.

setLegendBorderExistence

public void setLegendBorderExistence(boolean existence)
Specifies whether there will exist a border around the legend.
Parameters:
existence - If true, there will be a border around the legend.

setLegendBorderThicknessModel

public void setLegendBorderThicknessModel(int thickness)
Specifies the thickness of the border around the legend for the chart's model size.
Parameters:
thickness - The model thicknes for the chart.

setLegendBorderColor

public void setLegendBorderColor(java.awt.Color color)
Specifies the color of the border around the legend.
Parameters:
color - The color of the legend's border.

setLegendGapExistence

public void setLegendGapExistence(boolean existence)
Specifies 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 void setLegendGapThicknessModel(int thickness)
Specifies 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 void setLegendBackgroundExistence(boolean existence)
Specifies 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 void setLegendBackgroundColor(java.awt.Color color)
Specifies the color of the legend's background.
Parameters:
color - The color of the legend's background.

setLegendLabelsFontPointModel

public void setLegendLabelsFontPointModel(int point)
Specifies 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 void setLegendLabelsFontName(java.lang.String name)
Specifies 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 void setLegendLabelsFontColor(java.awt.Color color)
Specifies the color of the font of the legend's labels.
Parameters:
color - The color of the font of the legend's labels.

setLegendLabelsFontStyle

public void setLegendLabelsFontStyle(int style)
Specifies 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 void setLegendBetweenLabelsOrBulletsGapExistence(boolean existence)
Specifies whether a gap between the legend's bullets or labels exists in their vertical placement.
Parameters:
existence - If true, a gap exists.

setLegendBetweenLabelsOrBulletsGapThicknessModel

public void setLegendBetweenLabelsOrBulletsGapThicknessModel(int thickness)
Specifies 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 void setLegendBetweenLabelsAndBulletsGapExistence(boolean existence)
Specifies whether the gap between the legend's bullets and labels exists in their horizontal placement.
Parameters:
existence - If true, a gap exists.

setLegendBetweenLabelsAndBulletsGapThicknessModel

public void setLegendBetweenLabelsAndBulletsGapThicknessModel(int thickness)
Specifies 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 void setLegendBulletsOutlineExistence(boolean existence)
Specifies whether a thin line is painted around the legend's bullets.
Parameters:
existence - If true, the legend's bullets will be outlined.

setLegendBulletsOutlineColor

public void setLegendBulletsOutlineColor(java.awt.Color color)
Specifies the color of the legend's bullets outline.
Parameters:
color - The color of the legend's bullets outline.

setLegendBulletsSizeModel

public void setLegendBulletsSizeModel(java.awt.Dimension size)
Specifies the size of the legend's bullets for the chart's model size.
Parameters:
size - The size of the legend's bullets.

setValidateOnUpdate

public void setValidateOnUpdate(boolean validate)
Specifies whether the properties should be validated whenever a chart is to be updated with a changed property.
Parameters:
validate - If true, then the properties will be validated every time they are used to update a chart.

getChart2DVector

public java.util.Vector getChart2DVector()
Returns the vector of Chart2D objects that are using this object.
Returns:
Vector The associated Chart2D objects.

getChartMagnifyWhenResize

public boolean getChartMagnifyWhenResize()
Returns whether a chart's components will grow or shrink as the size of the space allocated to the chart grows or shrinks. All Chart2D charts have a model size [see the *Chart2D classes for information about the model size]. When the size allocated to the chart grows or shrinks, a ratio defined as the new size divided by the model size is computed and applied to each of the component sizing settings (ex. the border thickness model of the chart).
Returns:
boolean If true, the chart will be magnified on resize.

getChartStretchWhenResize

public boolean getChartStretchWhenResize()
Returns whether a chart will take up all the space allocated to it, or will center itself within the space, only taking the space it needs. Generally, for applications where charts are added to a GUI, the charts will stretch to fit the size allocated to them by the the layout manager; for applications where a BufferedImage of the chart is all that is desired, the chart will not stretch.
Returns:
boolean If true, then the chart will stretch.

getChartBorderExistence

public boolean getChartBorderExistence()
Returns whether a border around the chart will exist.
Returns:
boolean If true, then a chart border exists.

getChartBorderThicknessModel

public int getChartBorderThicknessModel()
Returns the thickness of the border for the model size of the chart.
Returns:
int The model thickness of the chart's border.

getChartBorderColor

public java.awt.Color getChartBorderColor()
Returns the color of the chart's border.
Returns:
Color The color of the border.

getChartGapExistence

public boolean getChartGapExistence()
Returns whether a gap between the border or edge of the chart and the chart's interior components exists.
Returns:
boolean If true, then a gap exists.

getChartGapThicknessModel

public int getChartGapThicknessModel()
Returns the thickness of the chart's gap for the model size of the chart.
Returns:
int The model thickness of the chart's gap.

getChartBackgroundExistence

public boolean getChartBackgroundExistence()
Returns whether the chart will have a painted background or not. If not, then the background of the content pane to which the chart was added will show through which by default is gray, or if the chart was not added to a content pane but only a BufferedImage of the chart is obtained, then the background will be the default background of BufferedImage which is black.
Returns:
boolean If true, a bacground for the chart will be painted.

getChartBackgroundColor

public java.awt.Color getChartBackgroundColor()
Returns the color of the background for the chart.
Returns:
Color The color of the chart's background.

getChartTitleExistence

public boolean getChartTitleExistence()
Returns whether the chart is to have a title.
Returns:
boolean If true, then the chart will have a title.

getChartTitleText

public java.lang.String getChartTitleText()
Returns the text for the chart's title.
Returns:
String The text for the chart's title.

getChartTitleFontPointModel

public int getChartTitleFontPointModel()
Returns the point of the font of the title for the chart at its model size.
Returns:
point The model font point for the chart's title.

getChartTitleFontName

public java.lang.String getChartTitleFontName()
Returns the name of the font for the chart's title. Accepts all values accepted by java.awt.Font.
Returns:
String The name of the font for the chart's title.

getChartTitleFontColor

public java.awt.Color getChartTitleFontColor()
Returns the color of the font for the chart's title.
Returns:
Color The color of the font for the chart's title.

getChartTitleFontStyle

public int getChartTitleFontStyle()
Returns the style of the font for the chart's title. Accepts all values that java.awt.Font accepts.
Returns:
int The style of the font for the chart's title.

getChartTitleBetweenRestGapExistence

public boolean getChartTitleBetweenRestGapExistence()
Returns whether a gap below the title and the rest of the chart's components exists.
Returns:
boolean If true, then a gap exists.

getChartTitleBetweenRestGapThicknessModel

public int getChartTitleBetweenRestGapThicknessModel()
Returns the thickness of the gap below the title and the rest of the chart's components for the chart's model size.
Returns:
int The model thickness of the gap.

getChartDatasetAutoColor

public boolean getChartDatasetAutoColor()
Returns whether the colors for the chart's data sets [the colors of the legend's bullets and/or the colors of the data representation components [bars, lines, dots, and/or pie sectors]], will be selected automatically by the Chart2D package or not. If so, then the colors can be adjusted through the setChartDatasetAutoColorType method. If not, then an array of colors must be passed through the setChartDatasetColors method.
Returns:
boolean If true, then the colors will be selected automatically.

getChartDatasetAutoColorType

public int getChartDatasetAutoColorType()
Returns whether the colors automatically selected will be NATURAL or PASTEL colors. For the returnter, type, use either NATURAL or PASTEL.
Returns:
int The type of the colors.

getChartDataLabelsPrecision

public int getChartDataLabelsPrecision()
Returns the look of labels that are supposed to describe the value of the data. For example, for pie charts this method will influence the labels that surround the chart, and for charts with axes this method will influence the labels on the numbers axis. The specific labels are first determined from the greatest and least value in the data set and other factors. This method then lets you adjust whether you want integer or floating point labels and how exact you want those labels to be. You do this using the precision parameter, and passing values between 8 and -8. Nonnegative ints indicate the labels will not contain a decimal (ie will be integer labels), and the specific nonnegative number indicates how many zeroes will be to the left of the decimal if it were there (ex. for the number 1976, a precision of 0 would return 1976, a precision of 1 would return 1980, a precision of 3 would return 2000, and a precision greater than 3 would also return 2000). If the number of desired zeroes is greater than the label, then the number of zeroes is automatically scaled back to be 1 less than the number of digits. Negative ints for precision indicate the labels will contain a decimal, and the specific negative number indicates how many digits to the right of the decimal are wanted (ex. for the number 1.935, a precision of -1 would return 1.9, a precision of -2 would return 1.94, a precision of -4 would return 1.9350). If the number of desired decimal places is larger than the number of places present in the number, then zeroes are added to form as many places as are desired up to -8. MAX_INTEGER or MAX_FLOAT will always indicate the maximum number of zeroes and the maximum number of decimal places possible by Chart2D's algorithm for adjusting these labels.
Returns:
int The adjustement of the precision of numbers labels.

getChartBetweenChartAndLegendGapExistence

public boolean getChartBetweenChartAndLegendGapExistence()
Returns whether the gap between the chart and the legend exists. If the legend doesn't exist, this gap will automatically not exist.
Returns:
boolean If true, the gap exists.

getChartBetweenChartAndLegendGapThicknessModel

public int getChartBetweenChartAndLegendGapThicknessModel()
Returns the thickness of the gap between the chart and the legend for the chart's model size.
Returns:
int The model thickness of the gap.

getLegendExistence

public boolean getLegendExistence()
Returns whether there will exist a legend on the chart.
Returns:
boolean If true, there will be a legend for the chart.

getLegendBorderExistence

public boolean getLegendBorderExistence()
Returns whether there will exist a border around the legend.
Returns:
boolean If true, there will be a border around the legend.

getLegendBorderThicknessModel

public int getLegendBorderThicknessModel()
Returns the thickness of the border around the legend for the chart's model size.
Returns:
int The model thicknes for the chart.

getLegendBorderColor

public java.awt.Color getLegendBorderColor()
Returns the color of the border around the legend.
Returns:
Color The color of the legend's border.

getLegendGapExistence

public boolean getLegendGapExistence()
Returns 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 int getLegendGapThicknessModel()
Returns 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 boolean getLegendBackgroundExistence()
Returns 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 java.awt.Color getLegendBackgroundColor()
Returns the color of the legend's background.
Returns:
Color The color of the legend's background.

getLegendLabelsFontPointModel

public int getLegendLabelsFontPointModel()
Returns 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 java.lang.String getLegendLabelsFontName()
Returns 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 java.awt.Color getLegendLabelsFontColor()
Returns the color of the font of the legend's labels.
Returns:
Color The color of the font of the legend's labels.

getLegendLabelsFontStyle

public int getLegendLabelsFontStyle()
Returns 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 boolean getLegendBetweenLabelsOrBulletsGapExistence()
Returns whether a gap between the legend's bullets or labels exists in their vertical placement.
Returns:
boolean If true, a gap exists.

getLegendBetweenLabelsOrBulletsGapThicknessModel

public int getLegendBetweenLabelsOrBulletsGapThicknessModel()
Returns 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 boolean getLegendBetweenLabelsAndBulletsGapExistence()
Returns whether the gap between the legend's bullets and labels exists in their horizontal placement.
Returns:
boolean If true, a gap exists.

getLegendBetweenLabelsAndBulletsGapThicknessModel

public int getLegendBetweenLabelsAndBulletsGapThicknessModel()
Returns 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 boolean getLegendBulletsOutlineExistence()
Returns whether a thin line is painted around the legend's bullets.
Returns:
boolean If true, the legend's bullets will be outlined.

getLegendBulletsOutlineColor

public java.awt.Color getLegendBulletsOutlineColor()
Returns the color of the legend's bullets outline.
Returns:
Color The color of the legend's bullets outline.

getLegendBulletsSizeModel

public java.awt.Dimension getLegendBulletsSizeModel()
Returns the size of the legend's bullets for the chart's model size.
Returns:
Dimension The size of the legend's bullets.

getValidateOnUpdate

public boolean getValidateOnUpdate()
Returns whether the properties should be validated whenever a chart is to be updated with a changed property.
Returns:
boolean If true, then the properties will be validated every time they are used to update a chart.

validate

public boolean validate(boolean debug)
Returns true if the properties are valid. For example if a negative number is passed as a model thickness, this method will return false. If the parameter, debug, is true then a message will be printed trying to indicate which properties if any are invalid and why. If a property is invalid, then the property is set to its default.
Parameters:
debug - If true, then debug messages will be printed.
Returns:
boolean If true, then the properties are valid.

getFontNamesVector

public final java.util.Vector getFontNamesVector()
Returns a vector of strings with all the font names available in the graphics environment.
Returns:
Vector The vector of strings of font names.

isFontNameExists

public 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.

getChart2DNeedsUpdate

boolean getChart2DNeedsUpdate(Chart2D chart2D)
True if a property has been changed and this Chart2D has not yet been updated.
Returns:
boolean If true, then a property has changed for this Chart2D.

updateChart2D

void updateChart2D(Chart2D chart2D)
Updates the properties of this Chart2D with these Chart2D properties.
Parameters:
chart2D - The Chart2D to update the properties of.

addChart2D

void addChart2D(Chart2D chart2D)
Adds a Chart2D to the set of objects using these properties.
Parameters:
chart2D - The Chart2D to add.

removeChart2D

void removeChart2D(Chart2D chart2D)
Removes a Chart2D to the set of objects using these properties.
Parameters:
chart2D - The Chart2D to remove.