| java.lang.Object net.sourceforge.chart2d.Area net.sourceforge.chart2d.PieArea
PieArea | final class PieArea extends Area (Code) | | A container for many variables and components relating to a pie area.
A pie area is the area that contains only the pie of a pie chart. It doesn't
have a legend.
Features:
Allows for charting both floats and int values. Works fine even if all
values are zero. Does not accept negative values. Outputs center points
of sectors so that labels can be drawn into the sectors, touching these
points. Outpouts how many sectors are in each quarter of the pie, so that
appropriate placement of labels can be decided. The first datum in the
data set will be the first sector beginning from the angle of 135 degrees and
ending somewhere clockwise to it It will have the first color in the
colors set. The remaining sectors are laid out similarly, clockwise.
|
Constructor Summary | |
| PieArea() Creates a pie area with the default values. |
Method Summary | |
final Color[] | getColors() Returns this property. | final float[] | getDataset() Returns the raw numbers to represent by the pie. | final int | getLightSource() Gets from which direction the light is coming for shading of the pie sectors. | final int | getNumSectors() Returns this property. | final int[] | getNumSectorsInQuarters() Returns this property. | final boolean | getOutlineSectors() Returns whether the sectors should have a thin outline. | final Color | getOutlineSectorsColor() Returns the color of the sectors outline if it exists. | final boolean | getPieAreaNeedsUpdate() Indicates whether some property of this class has changed. | final Point[] | getPointsInSectors() Returns a point in each sector at the depth specified by
setSectorsPointDepthRatio(float). | final Point[] | getPointsOutSectors() Returns a point in out of each sector at the location indicated by
setSectorsPointExternalRatio(float). | final float | getSectorPointDepthRatio() Returns how far into the sector the depth of the points from the
getPointsInSectors() method are. | final void | paintComponent(Graphics2D g2D) Paints all the components of this class. | final void | resetPieAreaModel(boolean reset) Resets the model for this class. | final void | setColors(Color[] colors) For input of the color of each sector that represents a datum of the data
set. | final void | setCustomSpaceSize(boolean customize, Dimension size) Sets the "minimum" size of the pie directly. | final void | setDataset(float[] values) For input of the raw numbers to represent by the pie. | final void | setLightSource(int source) Sets from which direction the light is coming for shading of the pie sectors. | final void | setOutlineSectors(boolean outline) Indicates whether the sectors should have a thin outline. | final void | setOutlineSectorsColor(Color color) Indicates the color of the sectors outline if it exists. | final void | setPiePrefSizeModel(int size) Sets the model size of the pie. | final void | setSectorGapPointRatio(float ratio) Determines how far out of the sector the points from the
getPointsOutSectors() method are. | final void | setSectorPointDepthRatio(float ratio) Determines how far into the sector the depth of the points from the
getPointsInSectors() method are. | final void | updatePieArea() Updates this parent's variables, and this' variables. |
PieArea | PieArea()(Code) | | Creates a pie area with the default values.
|
getColors | final Color[] getColors()(Code) | | Returns this property.
The colors of the lines. |
getDataset | final float[] getDataset()(Code) | | Returns the raw numbers to represent by the pie.
The raw numbers to represent by the pie. |
getLightSource | final int getLightSource()(Code) | | Gets from which direction the light is coming for shading of the pie sectors.
The direction of the light. |
getNumSectors | final int getNumSectors()(Code) | | Returns this property.
The number of sectors in this pie. |
getNumSectorsInQuarters | final int[] getNumSectorsInQuarters()(Code) | | Returns this property. This property allows figuring out where to place
labels if one wants to label this pie, more than is provided by the legend
in PieChartArea. One can use a
HorizontalTextListArea for the TOP and BOTTOM labels; and a
VerticalTextListArea for the LEFT and RIGHT labels.
This information helps them figure out how many and which labels belong in
each text list.
The number of sectors in the quarters. Actually, the number ofcenter points of sectors in this quarter. Quarters are defined as follows:TOP = 135 to 45, LEFT = 45 to 315, BOTTOM = 315 to 225, RIGHT = 225 to 135. |
getOutlineSectors | final boolean getOutlineSectors()(Code) | | Returns whether the sectors should have a thin outline.
outline If true, then the outline exists. |
getOutlineSectorsColor | final Color getOutlineSectorsColor()(Code) | | Returns the color of the sectors outline if it exists.
color The color for the outline. |
getPieAreaNeedsUpdate | final boolean getPieAreaNeedsUpdate()(Code) | | Indicates whether some property of this class has changed.
True if some property has changed. |
getPointsInSectors | final Point[] getPointsInSectors()(Code) | | Returns a point in each sector at the depth specified by
setSectorsPointDepthRatio(float).
Point[] The points inside the sectors. |
getPointsOutSectors | final Point[] getPointsOutSectors()(Code) | | Returns a point in out of each sector at the location indicated by
setSectorsPointExternalRatio(float).
Point[] The points outside the sectors. |
getSectorPointDepthRatio | final float getSectorPointDepthRatio()(Code) | | Returns how far into the sector the depth of the points from the
getPointsInSectors() method are.
The ratio on the radius of the circle. |
paintComponent | final void paintComponent(Graphics2D g2D)(Code) | | Paints all the components of this class. First all variables are updated.
Parameters: g2D - The graphics context for calculations and painting. |
resetPieAreaModel | final void resetPieAreaModel(boolean reset)(Code) | | 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 size to be set upon the next maxsizing. |
setColors | final void setColors(Color[] colors)(Code) | | For input of the color of each sector that represents a datum of the data
set. Array element i is sector i, clockise from degree 135.
Parameters: colors - The colors of the sectors. |
setCustomSpaceSize | final void setCustomSpaceSize(boolean customize, Dimension size)(Code) | | Sets the "minimum" size of the pie directly. If the minimum is too
large, then the size will be the pie's maximum size.
Parameters: size - The number to multiply to get the minimum size. |
setDataset | final void setDataset(float[] values)(Code) | | For input of the raw numbers to represent by the pie. Array element i
is sector i, clockwise from degree 135.
Parameters: values - The raw numbers to represent by the pie. |
setLightSource | final void setLightSource(int source)(Code) | | Sets from which direction the light is coming for shading of the pie sectors.
Parameters: source - The direction of the light. |
setOutlineSectors | final void setOutlineSectors(boolean outline)(Code) | | Indicates whether the sectors should have a thin outline.
Parameters: outline - If true, then the outline exists. |
setOutlineSectorsColor | final void setOutlineSectorsColor(Color color)(Code) | | Indicates the color of the sectors outline if it exists.
Parameters: color - The color for the outline. |
setPiePrefSizeModel | final void setPiePrefSizeModel(int size)(Code) | | Sets the model size of the pie. When initially drawn, the pie will be
at least this size, if this size is less than the max space size of this
area. After that and if magnificying, the pie size will be applied to the
size ratios.
Parameters: size - The model size of the pie. |
setSectorGapPointRatio | final void setSectorGapPointRatio(float ratio)(Code) | | Determines how far out of the sector the points from the
getPointsOutSectors() method are.
Parameters: ratio - The ratio on the radius of the circle. |
setSectorPointDepthRatio | final void setSectorPointDepthRatio(float ratio)(Code) | | Determines how far into the sector the depth of the points from the
getPointsInSectors() method are.
Parameters: ratio - The ratio on the radius of the circle. |
updatePieArea | final void updatePieArea()(Code) | | Updates this parent's variables, and this' variables.
|
Methods inherited from net.sourceforge.chart2d.Area | final int applyRatio(int model, float ratio)(Code)(Java Doc) final boolean getAreaNeedsUpdate()(Code)(Java Doc) final boolean getAutoSize(int which)(Code)(Java Doc) final Color getBackgroundColor()(Code)(Java Doc) final boolean getBackgroundExistence()(Code)(Java Doc) final Color getBorderColor()(Code)(Java Doc) final Color getBorderColor(int which)(Code)(Java Doc) final boolean getBorderExistence()(Code)(Java Doc) final boolean getBorderExistence(int which)(Code)(Java Doc) final int getBorderThickness(int which)(Code)(Java Doc) final int getBorderThickness()(Code)(Java Doc) final int getBorderThicknessModel()(Code)(Java Doc) final int getBorderThicknessModel(int which)(Code)(Java Doc) final boolean getGapExistence()(Code)(Java Doc) final boolean getGapExistence(int which)(Code)(Java Doc) final int getGapThickness()(Code)(Java Doc) final int getGapThickness(int which)(Code)(Java Doc) final int getGapThicknessModel()(Code)(Java Doc) final int getJustifications(int which)(Code)(Java Doc) int getLightSource()(Code)(Java Doc) final int getOffsetThickness()(Code)(Java Doc) final float getRatio(int which)(Code)(Java Doc) final boolean getResetAreaModel()(Code)(Java Doc) final Dimension getSize(int which)(Code)(Java Doc) final Point getSizeLocation(int which)(Code)(Java Doc) final Dimension getSpaceSize(int which)(Code)(Java Doc) final Point getSpaceSizeLocation(int which)(Code)(Java Doc) void paintComponent(Graphics2D g2D)(Code)(Java Doc) final void resetAreaModel(boolean reset)(Code)(Java Doc) final void setAutoJustifys(boolean horizontal, boolean vertical)(Code)(Java Doc) final void setAutoSizes(boolean maxModel, boolean min)(Code)(Java Doc) final void setBackgroundColor(Color color)(Code)(Java Doc) final void setBackgroundExistence(boolean existence)(Code)(Java Doc) final void setBorderAssociations(boolean leftRight, boolean leftTop, boolean leftBottom, boolean rightTop, boolean rightBottom, boolean topBottom)(Code)(Java Doc) final void setBorderColor(Color color)(Code)(Java Doc) final void setBorderColors(Color left, Color right, Color top, Color bottom)(Code)(Java Doc) final void setBorderCornerAssociations(int leftTop, int leftBottom, int rightTop, int rightBottom)(Code)(Java Doc) final void setBorderExistence(boolean existences)(Code)(Java Doc) final void setBorderExistences(boolean left, boolean right, boolean top, boolean bottom)(Code)(Java Doc) final void setBorderThicknessModel(int thickness)(Code)(Java Doc) final void setBorderThicknessModels(int left, int right, int top, int bottom)(Code)(Java Doc) final void setCustomRatio(int which, boolean customize, float ratio)(Code)(Java Doc) final void setGapAssociations(boolean leftRight, boolean leftTop, boolean leftBottom, boolean rightTop, boolean rightBottom, boolean topBottom)(Code)(Java Doc) final void setGapExistence(boolean existence)(Code)(Java Doc) final void setGapExistences(boolean left, boolean right, boolean top, boolean bottom)(Code)(Java Doc) final void setGapThicknessModel(int thickness)(Code)(Java Doc) final void setGapThicknessModels(int left, int right, int top, int bottom)(Code)(Java Doc) final void setJustifications(int horizontal, int vertical)(Code)(Java Doc) void setLightSource(int source)(Code)(Java Doc) final void setLockRatios(boolean lock)(Code)(Java Doc) final void setSize(int which, Dimension size)(Code)(Java Doc) final void setSizeLocation(int which, Point location)(Code)(Java Doc) final void setSpaceSize(int which, Dimension size)(Code)(Java Doc) final void setSpaceSizeLocation(int which, Point location)(Code)(Java Doc) final void updateArea()(Code)(Java Doc)
|
|
|