Package net.sourceforge.chart2d
Class PieChart2DProperties
java.lang.Object
net.sourceforge.chart2d.PieChart2DProperties
A data structure for holding the properties common to all PieChart2D charts.
A PieChart2D object is an enclosed are with a title, pie sectors, pie labels, and a legend.
Pass this to any number of PieChart2D objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSignifies bottom.static final booleanThe default is true.static final intThe default is 6.static final intSignifies left.static final intSignifies none.static final intIndicates the pie numbers labels should have percent ratios.static final booleanThe default is true.static final intThe default is 3.static final booleanThe default is true.static final ColorThe default is Color.black.static final StringThe default is "SansSerif".static final intThe default is 10.static final intThe default is Font.PLAIN.static final ColorThe default is Color.black.static final ColorThe default is Color.black.static final booleanThe default is false.static final intThe default is 2.static final booleanThe default is true.static final intThe default is 1.static final floatThe default is .25f.static final booleanThe default is true.static final floatThe default is .50f.static final floatThe default is .125f.static final intThe default is RAW + PERCENT.static final intThe default is 30.static final intThe default is TOP.static final ColorThe default is Color.black.static final booleanThe default is false.static final intIndicates the pie numbers labels should have raw numbers.static final intSignifies right.static final intSignifies top. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a PieChart2DProperties object with the documented default values.PieChart2DProperties(PieChart2DProperties pieChart2DProps) Creates a PieChart2DProperties object with property values copied from another object. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanReturns whether the gap between each pie label and the pie exists.final intReturns the thickness of the gap between each pie label and the pie for the chart's model size.final booleanReturns whether a gap between each pie sector label exists.final intReturns the thickness of the gap between each pie label for the chart's model size.final booleanReturns whether the pie sectors of the pie chart will be labeled.final ColorGets the color of the font of the pie labels.final StringGets name of the font of the pie labels.final intGets the point of the font of the pie labels for the chart's model size.final intGets the style of the font of the pie labels.final ColorReturns the color of the lines relating each pie sector with its particular label.final ColorReturns the color of the dots that exist at the beginning and ending of the lines relating each pie sector with its particular label.final booleanReturns whether dots exist at the beginning and ending of the lines relating each pie sector with its particular label.final intReturns the thickness (ie diameter) of the dots that exist at the beginning and ending of the lines releating each pie sector with its particular label for the chart's model size.final booleanReturns whether lines relating each pie sector with its particular label exists.final intReturns the thickness of the lines relating each pie sector with its particular label for the model size of the chart.final floatReturns the depth within each gap between each pie sector and label, from each pie, of the point at which a line coming from a label and a line coming from a pie, meet.final booleanReturns whether the gap between each pie label and a point from which a line may be drawn and/or on which a dot may be placed to relate each label with a particular pie sector exists.final floatGets the ratio on the gap between the pie and the labels, for the gap between the labels and the labels point.final floatReturns the depth within each pie sector a point is placed from which a line may be drawn and/or on which a dot may be placed to relate each label with a particular pie sector for the chart's model size.final intReturns the type of pie sector labels of the pie chart.final intReturns the preffered size of the pie in the pie chart.final intGets from which direction the light is coming for shading of the pie sectors.final ColorReturns the color of the outline of the pie sectors.final booleanReturns whether the sectors of the pie should have a thin outline.final booleanisFontNameExists(String name) Returns true if the font name exists in the graphics enviornment.final voidsetChartBetweenPieLabelsAndPieGapExistence(boolean existence) Specifies whether the gap between each pie label and the pie exists.final voidsetChartBetweenPieLabelsAndPieGapThicknessModel(int thickness) Specifies the thickness of the gap between each pie label and the pie for the chart's model size.final voidsetPieChart2DProperties(PieChart2DProperties pieChart2DProps) Sets all the properties to be the values of another PieChart2DProperties object.final voidSets all properties to their default values.final voidsetPieLabelsBetweenLabelsGapExistence(boolean existence) Specifies whether a gap between each pie sector label exists.final voidsetPieLabelsBetweenLabelsGapThicknessModel(int thickness) Specifies the thickness of the gap between each pie label for the chart's model size.final voidsetPieLabelsExistence(boolean existence) Specifies whether the pie sectors of the pie chart will be labeled.final voidsetPieLabelsFontColor(Color color) Sets the color of the font of the pie labels.final voidsetPieLabelsFontName(String name) Sets name of the font of the pie labels.final voidsetPieLabelsFontPointModel(int point) Sets the point of the font of the pie labels for the chart's model size.final voidsetPieLabelsFontStyle(int style) Sets the style of the font of the pie labels.final voidsetPieLabelsLinesColor(Color color) Specifies the color of the lines relating each pie sector with its particular label.final voidsetPieLabelsLinesDotsColor(Color color) Specifies the color of the dots that exist at the beginning and ending of the lines relating each pie sector with its particular label.final voidsetPieLabelsLinesDotsExistence(boolean existence) Specifies whether dots exist at the beginning and ending of the lines relating each pie sector with its particular label.final voidsetPieLabelsLinesDotsThicknessModel(int thickness) Specifies the thickness (ie diameter) of the dots that exist at the beginning and ending of the lines releating each pie sector with its particular label for the chart's model size.final voidsetPieLabelsLinesExistence(boolean existence) Specifies whether lines relating each pie sector with its particular label exists.final voidsetPieLabelsLinesThicknessModel(int thickness) Specifies the thickness of the lines relating each pie sector with its particular label for the model size of the chart.final voidsetPieLabelsPointsBetweenPieAndLabelGapsDepthRatio(float ratio) Specifies the depth within each gap between each pie sector and label, from each pie, of the point at which a line coming from a label and a line coming from a pie, meet.final voidsetPieLabelsPointsGapOffsetExistence(boolean existence) Specifies whether the gap between each pie label and a point from which a line may be drawn and/or on which a dot may be placed to relate each label with a particular pie sector exists.final voidsetPieLabelsPointsGapOffsetModelRatio(float ratio) Specifies the ratio on the gap between the pie and the labels, for the gap between the labels and the labels point.final voidsetPieLabelsPointsPieSectorsDepthRatio(float ratio) Specifies the depth within each pie sector a point is placed from which a line may be drawn and/or on which a dot may be placed to relate each label with a particular pie sector for the chart's model size.final voidsetPieLabelsType(int type) Specifies the type of pie sector labels of the pie chart.final voidsetPiePreferredSize(int size) Specifies the preffered size of the pie in the pie chart.final voidsetPieSectorsOutlineColor(Color color) Specifies the color of the outline of the pie sectors.final voidsetPieSectorsOutlineExistence(boolean existence) Specifies whether the sectors of the pie should have a thin outline.
-
Field Details
-
RAW
public static final int RAWIndicates the pie numbers labels should have raw numbers.- See Also:
-
PERCENT
public static final int PERCENTIndicates the pie numbers labels should have percent ratios.- See Also:
-
LEFT
public static final int LEFTSignifies left.- See Also:
-
RIGHT
public static final int RIGHTSignifies right.- See Also:
-
TOP
public static final int TOPSignifies top.- See Also:
-
BOTTOM
public static final int BOTTOMSignifies bottom.- See Also:
-
NONE
public static final int NONESignifies none.- See Also:
-
CHART_BETWEEN_PIE_LABELS_AND_PIE_GAP_EXISTENCE_DEFAULT
public static final boolean CHART_BETWEEN_PIE_LABELS_AND_PIE_GAP_EXISTENCE_DEFAULTThe default is true.- See Also:
-
CHART_BETWEEN_PIE_LABELS_AND_PIE_GAP_THICKNESS_MODEL_DEFAULT
public static final int CHART_BETWEEN_PIE_LABELS_AND_PIE_GAP_THICKNESS_MODEL_DEFAULTThe default is 6.- See Also:
-
PIE_PREFERRED_SIZE_DEFAULT
public static final int PIE_PREFERRED_SIZE_DEFAULTThe default is 30.- See Also:
-
PIE_SECTORS_OUTLINE_EXISTENCE_DEFAULT
public static final boolean PIE_SECTORS_OUTLINE_EXISTENCE_DEFAULTThe default is false.- See Also:
-
PIE_SECTORS_OUTLINE_COLOR_DEFAULT
The default is Color.black. -
PIE_LABELS_EXISTENCE_DEFAULT
public static final boolean PIE_LABELS_EXISTENCE_DEFAULTThe default is true.- See Also:
-
PIE_LABELS_TYPE_DEFAULT
public static final int PIE_LABELS_TYPE_DEFAULTThe default is RAW + PERCENT.- See Also:
-
PIE_LABELS_BETWEEN_LABELS_GAP_EXISTENCE_DEFAULT
public static final boolean PIE_LABELS_BETWEEN_LABELS_GAP_EXISTENCE_DEFAULTThe default is true.- See Also:
-
PIE_LABELS_BETWEEN_LABELS_GAP_THICKNESS_MODEL_DEFAULT
public static final int PIE_LABELS_BETWEEN_LABELS_GAP_THICKNESS_MODEL_DEFAULTThe default is 3.- See Also:
-
PIE_LABELS_POINTS_GAP_OFFSET_EXISTENCE_DEFAULT
public static final boolean PIE_LABELS_POINTS_GAP_OFFSET_EXISTENCE_DEFAULTThe default is true.- See Also:
-
PIE_LABELS_POINTS_GAP_OFFSET_MODEL_RATIO_DEFAULT
public static final float PIE_LABELS_POINTS_GAP_OFFSET_MODEL_RATIO_DEFAULTThe default is .50f.- See Also:
-
PIE_LABELS_POINTS_PIE_SECTORS_DEPTH_RATIO_DEFAULT
public static final float PIE_LABELS_POINTS_PIE_SECTORS_DEPTH_RATIO_DEFAULTThe default is .125f.- See Also:
-
PIE_LABELS_POINTS_BETWEEN_PIE_AND_LABEL_GAPS_DEPTH_RATIO_DEFAULT
public static final float PIE_LABELS_POINTS_BETWEEN_PIE_AND_LABEL_GAPS_DEPTH_RATIO_DEFAULTThe default is .25f.- See Also:
-
PIE_LABELS_LINES_EXISTENCE_DEFAULT
public static final boolean PIE_LABELS_LINES_EXISTENCE_DEFAULTThe default is true.- See Also:
-
PIE_LABELS_LINES_THICKNESS_MODEL_DEFAULT
public static final int PIE_LABELS_LINES_THICKNESS_MODEL_DEFAULTThe default is 1.- See Also:
-
PIE_LABELS_LINES_COLOR_DEFAULT
The default is Color.black. -
PIE_LABELS_LINES_DOTS_EXISTENCE_DEFAULT
public static final boolean PIE_LABELS_LINES_DOTS_EXISTENCE_DEFAULTThe default is false.- See Also:
-
PIE_LABELS_LINES_DOTS_THICKNESS_MODEL_DEFAULT
public static final int PIE_LABELS_LINES_DOTS_THICKNESS_MODEL_DEFAULTThe default is 2.- See Also:
-
PIE_LABELS_LINES_DOTS_COLOR_DEFAULT
The default is Color.black. -
PIE_SECTOR_LIGHT_SOURCE_DEFAULT
public static final int PIE_SECTOR_LIGHT_SOURCE_DEFAULTThe default is TOP.- See Also:
-
PIE_LABELS_FONT_POINT_MODEL_DEFAULT
public static final int PIE_LABELS_FONT_POINT_MODEL_DEFAULTThe default is 10.- See Also:
-
PIE_LABELS_FONT_NAME_DEFAULT
The default is "SansSerif".- See Also:
-
PIE_LABELS_FONT_COLOR_DEFAULT
The default is Color.black. -
PIE_LABELS_FONT_STYLE_DEFAULT
public static final int PIE_LABELS_FONT_STYLE_DEFAULTThe default is Font.PLAIN.- See Also:
-
-
Constructor Details
-
PieChart2DProperties
public PieChart2DProperties()Creates a PieChart2DProperties object with the documented default values. -
PieChart2DProperties
Creates a PieChart2DProperties object with property values copied from another object. The copying is a deep copy.- Parameters:
pieChart2DProps- The properties to copy.
-
-
Method Details
-
setPieChart2DPropertiesToDefaults
public final void setPieChart2DPropertiesToDefaults()Sets all properties to their default values. -
setPieChart2DProperties
Sets all the properties to be the values of another PieChart2DProperties object. The copying is a deep copy.- Parameters:
pieChart2DProps- The properties to copy.
-
setChartBetweenPieLabelsAndPieGapExistence
public final void setChartBetweenPieLabelsAndPieGapExistence(boolean existence) Specifies whether the gap between each pie label and the pie exists.- Parameters:
existence- If true, the gap exists.
-
setChartBetweenPieLabelsAndPieGapThicknessModel
public final void setChartBetweenPieLabelsAndPieGapThicknessModel(int thickness) Specifies the thickness of the gap between each pie label and the pie for the chart's model size.- Parameters:
int- The model thickness of the gap.
-
setPiePreferredSize
public final void setPiePreferredSize(int size) Specifies the preffered size of the pie in the pie chart. A pie does not have a calculable preferred size so one must be explicitly provided in this method. The size indicates the length of the diameter of the pie. This length must be >= 10.- Parameters:
size- The preferred size of the pie.
-
setPieSectorsOutlineExistence
public final void setPieSectorsOutlineExistence(boolean existence) Specifies whether the sectors of the pie should have a thin outline.- Parameters:
existence- If true, then the pie will have a thin outline.
-
setPieSectorsOutlineColor
Specifies the color of the outline of the pie sectors.- Parameters:
color- The color of the outline of the pie sectors.
-
setPieLabelsExistence
public final void setPieLabelsExistence(boolean existence) Specifies whether the pie sectors of the pie chart will be labeled. The labels can be raw numbers or percents. They encircle the pie. Methods that specify properties of these labels are setPieLabelsType (int) and Chart2DProperties.setChartDataLabelsPrecision (int).- Parameters:
existence- If true, the pie sectors will be labeled.
-
setPieLabelsType
public final void setPieLabelsType(int type) Specifies the type of pie sector labels of the pie chart. The possible types are RAW, PERCENT, and RAW+PERCENT. The format for RAW+PERCENT is v (p%) where v is a data value and p is a percent value.- Parameters:
type- The type of the pie labels.
-
setPieLabelsBetweenLabelsGapExistence
public final void setPieLabelsBetweenLabelsGapExistence(boolean existence) Specifies whether a gap between each pie sector label exists. The gap is applied both vertically and horizontally.- Parameters:
existence- If true, then the gap exists.
-
setPieLabelsBetweenLabelsGapThicknessModel
public final void setPieLabelsBetweenLabelsGapThicknessModel(int thickness) Specifies the thickness of the gap between each pie label for the chart's model size.- Parameters:
thickness- The thickness of the gap.
-
setPieLabelsPointsGapOffsetExistence
public final void setPieLabelsPointsGapOffsetExistence(boolean existence) Specifies whether the gap between each pie label and a point from which a line may be drawn and/or on which a dot may be placed to relate each label with a particular pie sector exists.- Parameters:
existence- If true, the gap exists.
-
setPieLabelsPointsGapOffsetModelRatio
public final void setPieLabelsPointsGapOffsetModelRatio(float ratio) Specifies the ratio on the gap between the pie and the labels, for the gap between the labels and the labels point.- Parameters:
ratio- The ratio.
-
setPieLabelsPointsPieSectorsDepthRatio
public final void setPieLabelsPointsPieSectorsDepthRatio(float ratio) Specifies the depth within each pie sector a point is placed from which a line may be drawn and/or on which a dot may be placed to relate each label with a particular pie sector for the chart's model size.- Parameters:
ratio- The depth into the pie sector to the pie sector depth for the point's placement.
-
setPieLabelsPointsBetweenPieAndLabelGapsDepthRatio
public final void setPieLabelsPointsBetweenPieAndLabelGapsDepthRatio(float ratio) Specifies the depth within each gap between each pie sector and label, from each pie, of the point at which a line coming from a label and a line coming from a pie, meet.- Parameters:
ratio- The depth into the gap where the lines labeling lines meet.
-
setPieLabelsLinesExistence
public final void setPieLabelsLinesExistence(boolean existence) Specifies whether lines relating each pie sector with its particular label exists.- Parameters:
existence- If true, then the pie labels lines exist.
-
setPieLabelsLinesThicknessModel
public final void setPieLabelsLinesThicknessModel(int thickness) Specifies the thickness of the lines relating each pie sector with its particular label for the model size of the chart.- Parameters:
thickness- The thickness of the line.
-
setPieLabelsLinesColor
Specifies the color of the lines relating each pie sector with its particular label.- Parameters:
color- The color of the lines.
-
setPieLabelsLinesDotsExistence
public final void setPieLabelsLinesDotsExistence(boolean existence) Specifies whether dots exist at the beginning and ending of the lines relating each pie sector with its particular label.- Parameters:
existence- If true, then two dots per line will exist.
-
setPieLabelsLinesDotsThicknessModel
public final void setPieLabelsLinesDotsThicknessModel(int thickness) Specifies the thickness (ie diameter) of the dots that exist at the beginning and ending of the lines releating each pie sector with its particular label for the chart's model size.- Parameters:
thickness- The thickness of the dots.
-
setPieLabelsLinesDotsColor
Specifies the color of the dots that exist at the beginning and ending of the lines relating each pie sector with its particular label.- Parameters:
color- The color of the dots.
-
setPieLabelsFontPointModel
public final void setPieLabelsFontPointModel(int point) Sets the point of the font of the pie labels for the chart's model size.- Parameters:
point- The model font point of the pie labels.
-
setPieLabelsFontName
Sets name of the font of the pie labels. Accepts all values accepted by java.awt.Font.- Parameters:
name- The name of the font for the pie labels.
-
setPieLabelsFontColor
Sets the color of the font of the pie labels.- Parameters:
color- The color of the font of the pie labels.
-
setPieLabelsFontStyle
public final void setPieLabelsFontStyle(int style) Sets the style of the font of the pie labels. Accepts all values that java.awt.Font accepts.- Parameters:
style- The style of the font of the pie labels.
-
getChartBetweenPieLabelsAndPieGapExistence
public final boolean getChartBetweenPieLabelsAndPieGapExistence()Returns whether the gap between each pie label and the pie exists.- Returns:
- If true, the gap exists.
-
getChartBetweenPieLabelsAndPieGapThicknessModel
public final int getChartBetweenPieLabelsAndPieGapThicknessModel()Returns the thickness of the gap between each pie label and the pie for the chart's model size.- Returns:
- The model thickness of the gap.
-
getPiePreferredSize
public final int getPiePreferredSize()Returns the preffered size of the pie in the pie chart. A pie does not have a calculable preferred size so one must be explicitly provided in this method. The size indicates the length of the diameter of the pie. This length must be >= 10.- Returns:
- The preferred size of the pie.
-
getPieSectorsOutlineExistence
public final boolean getPieSectorsOutlineExistence()Returns whether the sectors of the pie should have a thin outline.- Returns:
- If true, then the pie will have a thin outline.
-
getPieSectorsOutlineColor
Returns the color of the outline of the pie sectors.- Returns:
- The color of the outline of the pie sectors.
-
getPieLabelsExistence
public final boolean getPieLabelsExistence()Returns whether the pie sectors of the pie chart will be labeled. The labels can be raw numbers or percents. They encircle the pie. Methods that specify properties of these labels are setPieLabelsType (int) and Chart2DProperties.setChartDataLabelsPrecision (int).- Returns:
- If true, the pie sectors will be labeled.
-
getPieLabelsType
public final int getPieLabelsType()Returns the type of pie sector labels of the pie chart. The possible types are RAW, PERCENT, and RAW+PERCENT. The format for RAW+PERCENT is v (p%) where v is a data value and p is a percent value.- Returns:
- The type of the pie labels.
-
getPieLabelsBetweenLabelsGapExistence
public final boolean getPieLabelsBetweenLabelsGapExistence()Returns whether a gap between each pie sector label exists. The gap is applied both vertically and horizontally.- Returns:
- If true, then the gap exists.
-
getPieLabelsBetweenLabelsGapThicknessModel
public final int getPieLabelsBetweenLabelsGapThicknessModel()Returns the thickness of the gap between each pie label for the chart's model size.- Returns:
- The thickness of the gap.
-
getPieLabelsPointsGapOffsetExistence
public final boolean getPieLabelsPointsGapOffsetExistence()Returns whether the gap between each pie label and a point from which a line may be drawn and/or on which a dot may be placed to relate each label with a particular pie sector exists.- Returns:
- If true, the gap exists.
-
getPieLabelsPointsGapOffsetModelRatio
public final float getPieLabelsPointsGapOffsetModelRatio()Gets the ratio on the gap between the pie and the labels, for the gap between the labels and the labels point.- Returns:
- The ratio.
-
getPieLabelsPointsPieSectorsDepthRatio
public final float getPieLabelsPointsPieSectorsDepthRatio()Returns the depth within each pie sector a point is placed from which a line may be drawn and/or on which a dot may be placed to relate each label with a particular pie sector for the chart's model size.- Returns:
- The depth into the pie sector to the pie sector depth for the point's placement.
-
getPieLabelsPointsBetweenPieAndLabelGapsDepthRatio
public final float getPieLabelsPointsBetweenPieAndLabelGapsDepthRatio()Returns the depth within each gap between each pie sector and label, from each pie, of the point at which a line coming from a label and a line coming from a pie, meet.- Returns:
- The depth into the gap where the lines labeling lines meet.
-
getPieLabelsLinesExistence
public final boolean getPieLabelsLinesExistence()Returns whether lines relating each pie sector with its particular label exists.- Returns:
- If true, then the pie labels lines exist.
-
getPieLabelsLinesThicknessModel
public final int getPieLabelsLinesThicknessModel()Returns the thickness of the lines relating each pie sector with its particular label for the model size of the chart.- Returns:
- The thickness of the line.
-
getPieLabelsLinesColor
Returns the color of the lines relating each pie sector with its particular label.- Returns:
- The color of the lines.
-
getPieLabelsLinesDotsExistence
public final boolean getPieLabelsLinesDotsExistence()Returns whether dots exist at the beginning and ending of the lines relating each pie sector with its particular label.- Returns:
- If true, then two dots per line will exist.
-
getPieLabelsLinesDotsThicknessModel
public final int getPieLabelsLinesDotsThicknessModel()Returns the thickness (ie diameter) of the dots that exist at the beginning and ending of the lines releating each pie sector with its particular label for the chart's model size.- Returns:
- The thickness of the dots.
-
getPieLabelsLinesDotsColor
Returns the color of the dots that exist at the beginning and ending of the lines relating each pie sector with its particular label.- Returns:
- The color of the dots.
-
getPieSectorLightSource
public final int getPieSectorLightSource()Gets from which direction the light is coming for shading of the pie sectors. Uses fields TOP, BOTTOM, LEFT, RIGHT, and NONE.- Returns:
- The direction of the light.
-
getPieLabelsFontPointModel
public final int getPieLabelsFontPointModel()Gets the point of the font of the pie labels for the chart's model size.- Returns:
- int The model font point of the pie labels.
-
getPieLabelsFontName
Gets name of the font of the pie labels. Accepts all values accepted by java.awt.Font.- Returns:
- String The name of the font for the pie labels.
-
getPieLabelsFontColor
Gets the color of the font of the pie labels.- Returns:
- Color The color of the font of the pie labels.
-
getPieLabelsFontStyle
public final int getPieLabelsFontStyle()Gets the style of the font of the pie labels. Accepts all values that java.awt.Font accepts.- Returns:
- int The style of the font of the pie labels.
-
isFontNameExists
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.
-