| java.lang.Object net.sourceforge.chart2d.Area net.sourceforge.chart2d.FontArea net.sourceforge.chart2d.PieInfoArea
PieInfoArea | final class PieInfoArea extends FontArea (Code) | | This class manages a set of labels that can be used to encircle a PieArea,
labeling its pie sectors. The way it works is that you must set the size of
the max size for the class and also the size that it is supposed to
encircle.
This provides three different labeling types.
The text of the label can be the data number of that sector, the text of
the label can be a percent of the total on the data number of that sector,
and the text of the label can be both.
The font properties can be set using the methods of this' parent class.
This class can return a point centered near each label so that lines can
be drawn from the labels to their corresponding pie sectors.
|
Field Summary | |
final static int | PERCENT Static variable for setLabelsType (int) method. | final static int | RAW Static variable for setLabelsType (int) method. |
Constructor Summary | |
| PieInfoArea() The general constructor for this class. |
PERCENT | final static int PERCENT(Code) | | Static variable for setLabelsType (int) method.
PERCENT indicates that the percent the number represented by the sector
makes of the whole should should be present.
|
RAW | final static int RAW(Code) | | Static variable for setLabelsType (int) method.
RAW indicates that the actual number represented by the sector should be
present.
|
PieInfoArea | PieInfoArea()(Code) | | The general constructor for this class.
|
getDataset | final float[] getDataset()(Code) | | Returns the raw numbers to represent by the pie.
The raw numbers to represent by the pie. |
getDatasetColors | final Color[] getDatasetColors()(Code) | | Returns this property.
The colors of the lines. |
getInteriorBounds | final Rectangle getInteriorBounds(Graphics2D g2D)(Code) | | Returns a bounding rectangle of the area the labels encircle.
The bounding rectangle of the interior. |
getLabelsPointsGapExistence | final boolean getLabelsPointsGapExistence()(Code) | | Returns whether the gaps between the labels and the points near each
label exist.
boolean If true, the gaps exist. |
getLabelsPointsGapThicknessModel | final int getLabelsPointsGapThicknessModel()(Code) | | Returns how far from the labels, the points on each label should be.
The points are returned by the getPointsNearLabels(...) method.
The model thickness of the gap between the label and the point. |
getLabelsType | final int getLabelsType()(Code) | | Indirectly returns the text of the labels. Possible values are RAW,
PERCENT,
and RAW + PERCENT. RAW causes the text of the label to be the actual data
numbers. PERCENT causes the text to be the percent of the whole of the
data. RAW + PERCENT causes the text of the label to be both, in the format
of "p% - d" were p is the percent and d is the data number.
What text occurrs in each label. |
getPieArea | final PieArea getPieArea()(Code) | | Gets in the PieArea to encircle with labels.
The PieArea. |
getPieInfoAreaNeedsUpdate | final boolean getPieInfoAreaNeedsUpdate()(Code) | | Indicates whether some property of this class has changed.
True if some property has changed. |
getPieLabelsExistence | final boolean getPieLabelsExistence()(Code) | | Returns whether the labels exist or not. If the labels do not exist, their
space will be taken up by the pie.
A boolean indicating whether the labels are painted. |
getPointsNearLabels | final Point[] getPointsNearLabels(Graphics2D g2D)(Code) | | Returns an array of points, one for each label, that are near the labels.
These points can be used for drawing lines from pie sectors to labels.
Point[] The array of points. |
getRawLabelsPrecision | final int getRawLabelsPrecision()(Code) | | Returns how many significant digits are wanted.
For example, if you want two decimal places, then pass -2.
If you want no decimal places, then pass 0.
For more information see ChartArea.getPrecisionRound(...).
The desired precision of the raw labels. |
paintComponent | final void paintComponent(Graphics2D g2D)(Code) | | Paints this class. Updates all variables, then paints its parent, since
this class itself doesn't have anything to paint.
Parameters: g2D - The graphics context for calculations and painting. |
resetPieInfoAreaModel | final void resetPieInfoAreaModel(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. |
setBetweenLabelsGapExistence | final void setBetweenLabelsGapExistence(boolean existence)(Code) | | Indicates whether a gap should exist between the labels.
This method overides setBetweenLabelsGapThicknessModel(...).
Parameters: existence - If true, the gaps will exist. |
setBetweenLabelsGapThicknessModel | final void setBetweenLabelsGapThicknessModel(int thickness)(Code) | | Indicates the model thickness of the gap between each label.
This thickness is actually the minimum model thickness. If there is
extra space that the labels don't need it is divided evenly between the
labels, but the gap will be at least what is specified here.
Parameters: thickness - The model minimum thickness of the gap. |
setCustomSize | final void setCustomSize(boolean customize, Dimension size)(Code) | | Indicates the final size of the area.
Everything is calculated using the non-custom properties. When laying
out the labels, the labels are mereley laid out wider than normal to the
point that their ends touch the edges of the custom size...
Hence, all extra space is added to the interior size.
Parameters: customize - If true, then the custom size will be used. Parameters: size - The custom size if used. |
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. |
setDatasetColors | final void setDatasetColors(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. |
setLabelsPointsGapExistence | final void setLabelsPointsGapExistence(boolean existence)(Code) | | Specifies whether the gaps between the labels and the points near each
label exist.
Parameters: existence - If true, the gaps exist. |
setLabelsPointsGapThicknessModel | final void setLabelsPointsGapThicknessModel(int thickness)(Code) | | Indicates how far from the labels, the points on each label should be.
The points are returned by the getPointsNearLabels(...) method.
Parameters: thickness - The model thickness of the gap between the label and thepoint. |
setLabelsType | final void setLabelsType(int type)(Code) | | Indirectly sets the text of the labels. Possible values are RAW, PERCENT,
and RAW + PERCENT. RAW causes the text of the label to be the actual data
numbers. PERCENT causes the text to be the percent of the whole of the
data. RAW + PERCENT causes the text of the label to be both, in the format
of "p% - d" were p is the percent and d is the data number.
Parameters: type - What text occurrs in each label. |
setPieLabelsExistence | final void setPieLabelsExistence(boolean existence)(Code) | | 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. |
setRawLabelsPrecision | final void setRawLabelsPrecision(int precision)(Code) | | Indicates how many significant digits are wanted.
For example, if you want two decimal places, then pass -2.
If you want no decimal places, then pass 0.
For more information see ChartArea.getPrecisionRound(...).
Parameters: The - desired precision of the raw labels. |
updatePieInfoArea | final void updatePieInfoArea(Graphics2D g2D)(Code) | | Updates all this classes variables. First updates it's parent class, then
then updates its own 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)
|
|
|