net.sourceforge.chart2d
Class PieChartArea

java.lang.Object
  |
  +--net.sourceforge.chart2d.Area
        |
        +--net.sourceforge.chart2d.FontArea
              |
              +--net.sourceforge.chart2d.TitledArea
                    |
                    +--net.sourceforge.chart2d.ChartArea
                          |
                          +--net.sourceforge.chart2d.PieChartArea

class PieChartArea
extends ChartArea

A titled pie chart with legend exactly like PieChart2D with one difference. This chart does not keep the title near to it, when auto min sizing is disabled. In this scenario, the title would be near the top of the max size and the chart would be centered within the left over space. This is not desireable. PieChart2D forces the title as near as possible to the chart under unless explicitly set not to. PieChart2D uses this class. It creates one of these charts with min sizing enabled. That produces a chart that is where the title is forced near the chart, and the chart is centered in the middle of the area. But really, if any settings of the chart need to be changed they are generally changed here, or in one of its components available through a get method.


Fields inherited from class net.sourceforge.chart2d.ChartArea
DEFAULT_FLOAT, MAX_FLOAT, MAX_INTEGER
 
Fields inherited from class net.sourceforge.chart2d.Area
BETWEEN, BOTTOM, CENTER, CENTERED, CONTINUOUS, DASHED, DOTTED, FLOAT, HEIGHT, HORIZONTAL, INTEGER, LABELSBOTTOM, LABELSLEFT, LEFT, LEFTBOTTOM, LEFTRIGHT, LEFTTOP, LESSER, MAX, MAXMODEL, MIN, RIGHT, RIGHTBOTTOM, RIGHTTOP, TOP, TOPBOTTOM, VERTICAL, WIDTH
 
Constructor Summary
(package private) PieChartArea()
          Creates a Pie Chart Area with default values.
 
Method Summary
(package private)  java.awt.Color getLabelsLineDotsColor()
          Returns the color of the dots on the lines between the pie sector labels and the pie sectors.
(package private)  boolean getLabelsLineDotsExistence()
          Returns the existence of the dots on the lines between the pie sector labels and the pie sectors.
(package private)  int getLabelsLineDotsThicknessModel()
          Returns the model thickness of the dots on the lines between the pie sector labels and the pie sectors.
(package private)  java.awt.Color getLabelsLinesColor()
          Returns the color of the lines between the pie sector labels and the pie sectors.
(package private)  int getLabelsLinesThicknessModel()
          Return the model thickness of the lines between the pie sector labels and the pie sectors.
(package private)  PieArea getPie()
          Returns the pie component of this chart in order to allow customization of it.
(package private)  boolean getPieChartAreaNeedsUpdate()
          Indicates whether some property of this class has changed.
(package private)  PieLabelsArea getPieLabels()
          Returns the pie labels component of this chart in order to allow customization of it.
(package private)  boolean getPieLabelsExistence()
          Returns whether the labels exist or not.
(package private)  java.awt.Dimension getPrefSize(java.awt.Graphics2D g2D)
          Returns the minimum size that the chart would need if it was to be redrawn, the "preferred" size.
(package private)  void paintComponent(java.awt.Graphics2D g2D)
          Paints pie chart area components.
(package private)  void resetPieChartAreaModel(boolean reset)
          Resets the model for this class.
(package private)  void setDataset(Dataset set)
          The Dataset to plot.
(package private)  void setLabelsLineDotsColor(java.awt.Color color)
          Sets the color of the dots on the lines between the pie sector labels and the pie sectors.
(package private)  void setLabelsLineDotsExistence(boolean existence)
          Sets the existence of the dots on the lines between the pie sector labels and the pie sectors.
(package private)  void setLabelsLineDotsThicknessModel(int thickness)
          Sets the model thickness of the dots on the lines between the pie sector labels and the pie sectors.
(package private)  void setLabelsLinesColor(java.awt.Color color)
          Sets the color of the lines between the pie sector labels and the pie sectors.
(package private)  void setLabelsLinesExistence(boolean existence)
          Sets the existence of the lines between the pie sector labels and the pie sectors.
(package private)  void setLabelsLinesThicknessModel(int thickness)
          Sets the model thickness of the lines between the pie sector labels and the pie sectors.
(package private)  void setPieLabelsExistence(boolean existence)
          Sets whether the labels exist or not.
(package private)  void setPieLabelsToHeightRatio(float ratio)
          Sets the height to be shared by all the labels, beyond the height of the pie.
(package private)  void setPieLabelsToWidthRatio(float ratio)
          Sets the width to be shared by all the labels, beyond the width of the pie.
(package private)  void setPieToHeightRatio(float ratio)
          Specifies how much of the maximum height less borders, gaps, and title to make availalble to the pie maximum size.
(package private)  void setPieToWidthRatio(float ratio)
          Specifies how much of the maximum width less borders and gaps to make availalble to the pie maximum size.
(package private)  void updatePieChartArea(java.awt.Graphics2D g2D)
          Updates this parent's variables, and this' variables.
 
Methods inherited from class net.sourceforge.chart2d.ChartArea
getAutoColor, getAutoSetLayoutRatios, getBetweenChartAndLegendGapExistence, getBetweenChartAndLegendGapThicknessModel, getChartAreaNeedsUpdate, getColorsType, getDataCategoryTotals, getDataSetColors, getDataSetColors, getDataSetTotal, getFloatToString, getLabelsPrecisionNum, getLegend, getLegendExistence, getLegendToHeightRatio, getLegendToWidthRatio, getPrecisionCeil, getPrecisionFloor, getPrecisionRound, getTitleSqueeze, resetChartAreaModel, setAutoColor, setAutoSetLayoutRatios, setBetweenChartAndLegendGapExistence, setBetweenChartAndLegendGapThicknessModel, setDataSetColors, setDataSetColorsType, setLabelsPrecisionNum, setLegendExistence, setLegendToHeightRatio, setLegendToWidthRatio, setNumDataSets, setTitleSqueeze, updateChartArea
 
Methods inherited from class net.sourceforge.chart2d.TitledArea
getBetweenTitleAndSpaceGapThickness, getBetweenTitleAndSpaceGapThicknessModel, getMaxEntitledSpaceBounds, getTitle, getTitleAutoLocate, getTitledAreaNeedsUpdate, getTitleExistence, getTitleJustifications, getTitleSize, getTitleText, resetTitledAreaModel, setBetweenTitleAndSpaceGapExistence, setBetweenTitleAndSpaceGapThicknessModel, setTitle, setTitleAutoLocate, setTitleExistence, setTitleJustifications, setTitleLocation, setTitleRotateLeft, updateTitledArea
 
Methods inherited from class net.sourceforge.chart2d.FontArea
getFont, getFontAreaNeedsUpdate, getFontColor, getFontName, getFontPointModel, getFontStyle, resetFontAreaModel, setFontColor, setFontName, setFontPointModel, setFontStyle, updateFontArea
 
Methods inherited from class net.sourceforge.chart2d.Area
applyRatio, getAreaNeedsUpdate, getAutoSize, getBackgroundColor, getBackgroundExistence, getBorderColor, getBorderColor, getBorderExistence, getBorderExistence, getBorderThickness, getBorderThickness, getBorderThicknessModel, getBorderThicknessModel, getGapThickness, getGapThicknessModel, getJustifications, getRatio, getResetAreaModel, getSize, getSizeLocation, getSpaceSize, getSpaceSizeLocation, resetAreaModel, setAutoJustifys, setAutoSizes, setBackgroundColor, setBackgroundExistence, setBorderAssociations, setBorderColor, setBorderColors, setBorderCornerAssociations, setBorderExistence, setBorderExistences, setBorderThicknessModel, setBorderThicknessModels, setCustomRatio, setGapAssociations, setGapExistence, setGapExistences, setGapThicknessModel, setGapThicknessModels, setJustifications, setLockRatios, setSize, setSizeLocation, setSpaceSize, setSpaceSizeLocation, updateArea
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PieChartArea

PieChartArea()
Creates a Pie Chart Area with default values.
Method Detail

setDataset

void setDataset(Dataset set)
The Dataset to plot.
Parameters:
set - The set of data.

setLabelsLineDotsExistence

void setLabelsLineDotsExistence(boolean existence)
Sets the existence of the dots on the lines between the pie sector labels and the pie sectors.
Parameters:
existence - If true, the dots will be painted.

getLabelsLineDotsExistence

boolean getLabelsLineDotsExistence()
Returns the existence of the dots on the lines between the pie sector labels and the pie sectors.
Returns:
If true, the dots will be painted.

setLabelsLineDotsThicknessModel

void setLabelsLineDotsThicknessModel(int thickness)
Sets the model thickness of the dots on the lines between the pie sector labels and the pie sectors.
Parameters:
thickness - The model thickness of the dots.

getLabelsLineDotsThicknessModel

int getLabelsLineDotsThicknessModel()
Returns the model thickness of the dots on the lines between the pie sector labels and the pie sectors.
Returns:
The model thickness of the dots.

setLabelsLineDotsColor

void setLabelsLineDotsColor(java.awt.Color color)
Sets the color of the dots on the lines between the pie sector labels and the pie sectors.
Parameters:
color - The color of the dots.

getLabelsLineDotsColor

java.awt.Color getLabelsLineDotsColor()
Returns the color of the dots on the lines between the pie sector labels and the pie sectors.
Returns:
The color of the dots.

setLabelsLinesExistence

void setLabelsLinesExistence(boolean existence)
Sets the existence of the lines between the pie sector labels and the pie sectors.
Parameters:
existence - If true, the lines will be painted.

setLabelsLinesThicknessModel

void setLabelsLinesThicknessModel(int thickness)
Sets the model thickness of the lines between the pie sector labels and the pie sectors.
Parameters:
thickness - The model thickness of the lines.

getLabelsLinesThicknessModel

int getLabelsLinesThicknessModel()
Return the model thickness of the lines between the pie sector labels and the pie sectors.
Returns:
The model thickness of the lines.

setLabelsLinesColor

void setLabelsLinesColor(java.awt.Color color)
Sets the color of the lines between the pie sector labels and the pie sectors.
Parameters:
color - The color of the lines.

getLabelsLinesColor

java.awt.Color getLabelsLinesColor()
Returns the color of the lines between the pie sector labels and the pie sectors.
Returns:
The color of the lines.

setPieLabelsExistence

void setPieLabelsExistence(boolean existence)
Sets whether the labels exist or not. If the labels do not exist, their space will be taken up by the pie.
Parameters:
existence - A boolean indicating whether the labels are painted.

getPieLabelsExistence

boolean getPieLabelsExistence()
Returns whether the labels exist or not. If the labels do not exist, their space will be taken up by the pie.
Returns:
A boolean indicating whether the labels are painted.

setPieLabelsToWidthRatio

void setPieLabelsToWidthRatio(float ratio)
Sets the width to be shared by all the labels, beyond the width of the pie. For instance, if there are labels on the left and the right of the pie, then their max widths will be equal and will each be half of the width indicated by applying the ratio to the max width of the chart.
Parameters:
ratio - The ratio for indicating the max widths of the labels.

setPieLabelsToHeightRatio

void setPieLabelsToHeightRatio(float ratio)
Sets the height to be shared by all the labels, beyond the height of the pie. For instance, if there are lables on the top and the bottom of the pie, then their max heights will be equal and will each be half of the height indicated by applying the ratio to the max width of the chart.
Parameters:
ratio - The ratio for indicating the max heights of the labels.

setPieToWidthRatio

void setPieToWidthRatio(float ratio)
Specifies how much of the maximum width less borders and gaps to make availalble to the pie maximum size.
Parameters:
ratio - The ratio to the width, to make available to the pie.

setPieToHeightRatio

void setPieToHeightRatio(float ratio)
Specifies how much of the maximum height less borders, gaps, and title to make availalble to the pie maximum size.
Parameters:
ratio - The ratio to the height, to make available to the pie.

getPrefSize

java.awt.Dimension getPrefSize(java.awt.Graphics2D g2D)
Returns the minimum size that the chart would need if it was to be redrawn, the "preferred" size. The preferred size is the minimum size which would need to be set as the maxmodel size of the chart, if the chart was to be redrawn (assuming magnification is disabled).
Parameters:
g2D - The graphics context for calculations and painting.
Returns:
The size of the minimum maxmodel for a redraw.

getPie

PieArea getPie()
Returns the pie component of this chart in order to allow customization of it.
Returns:
The pie area.

getPieLabels

PieLabelsArea getPieLabels()
Returns the pie labels component of this chart in order to allow customization of it.
Returns:
The pie labels area.

resetPieChartAreaModel

void resetPieChartAreaModel(boolean reset)
Resets the model for this class. The model is used for shrinking and growing of its components based on the maximum size of this class. If this method is called, then the next time the maximum size is set, this classes model maximum size will be made equal to the new maximum size. Effectively what this does is ensure that whenever this objects maximum size is equal to the one given, then all of the components will take on their default model sizes. Note: This is only useful when auto model max sizing is disabled.
Parameters:
reset - True causes the max model to be reset upon next max sizing.

getPieChartAreaNeedsUpdate

boolean getPieChartAreaNeedsUpdate()
Indicates whether some property of this class has changed.
Returns:
True if some property has changed.

updatePieChartArea

void updatePieChartArea(java.awt.Graphics2D g2D)
Updates this parent's variables, and this' variables.
Parameters:
g2D - The graphics context to use for calculations.

paintComponent

void paintComponent(java.awt.Graphics2D g2D)
Paints pie chart area components.
Overrides:
paintComponent in class ChartArea
Parameters:
g2D - The graphics context to use for calculations.