|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.quinncurtis.chart3djava.ChartObj
com.quinncurtis.chart3djava.GraphObj
com.quinncurtis.chart3djava.ChartPlot
com.quinncurtis.chart3djava.PieChartBase
public class PieChartBase
The PieChartBase class extends the Plot class and displays pie charts. The x-values of the simple dataset used for data storage specify the pie wedge values, the y-values of the dataset specify the "explode" percentage for each pie wedge.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
PieChartBase()
The default PieChartBase constructor. |
|
PieChartBase(PhysicalCoordinates transform,
SimpleDataset dataset,
java.lang.String[] spiestring1s,
ChartAttribute[] attribs,
int labelinout1,
int pielabelformat)
This constructor creates a new PieChartBase object and scales it to match the specified minimum and maximum values. |
|
| Method Summary | |
|---|---|
boolean |
calcNearestPoint(ChartPoint3D testpoint,
int nmode,
NearestPointData nearestpoint)
This method compares a test point against the pie wedges in a simple pie chart and calculates which wedge is nearest the test point. |
boolean |
checkIntersection(ChartPoint3D testpoint,
NearestPointData np)
Returns true if the test point is intersects one of the pie slices. |
java.lang.Object |
clone()
Returns an object that is a clone of this PieChartBase object. |
void |
copy(PieChartBase source)
Copies the source pie chart. |
void |
draw(java.awt.Graphics2D g2)
The draw method for this class. |
void |
drawPieChart(java.awt.Graphics2D g2)
The draw method for this class. |
int |
errorCheck(int nerror)
Checks the PieChartBase object for common errors. |
ChartDataset |
getDataset()
Returns a reference to the current SimpleDataset. |
int |
getLabelInOut(int index)
Returns the pie slice labeling mode associated with a specific pie slice. |
int |
getPieSliceLabelFormat()
Returns the pie slice labeling format associated with a specific pie slice. |
void |
getPieSlicePoints(int pieslice,
ChartPoint3D arcstart,
ChartPoint3D arcstop,
ChartPoint3D arcorigin)
Returns the starting, ending and arc origin for a specific pie slice in the pie chart. |
java.lang.String |
getPieSliceStrings(int index)
Returns the text string associated with a specific pie slice. |
double |
getPieTextRadiusPercentage()
Text placed in pie slices is justified against a position in the pie slice which is this percentage times the radius of the pie. |
double |
getStartPieSliceAngle()
Returns the start angle in degrees for the first pie slice in the pie chart. |
double |
getSumPieSlices()
Returns the sum of all pie slice values. |
void |
setDataset(SimpleDataset dataset)
Replaces the current SimpleDataset object with a new one. |
void |
setLabelInOut(int index,
int labelinout1)
Sets the pie slice labeling mode associated with a specific pie slice. |
void |
setPieSliceLabelFormat(int format)
Sets the pie slice labeling format associated with a specific pie slice. |
void |
setPieSliceStrings(int index,
java.lang.String piestring1)
Sets the text string associated with a specific pie slice. |
void |
setPieTextRadiusPercentage(double value)
Text placed in pie slices is justified against a position in the pie slice which is this percentage times the radius of the pie. |
void |
setStartPieSliceAngle(double angle)
Sets the start angle in degrees for the first pie slice in the pie chart. |
| Methods inherited from class com.quinncurtis.chart3djava.ChartObj |
|---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PieChartBase()
public PieChartBase(PhysicalCoordinates transform,
SimpleDataset dataset,
java.lang.String[] spiestring1s,
ChartAttribute[] attribs,
int labelinout1,
int pielabelformat)
transform - The pie chart is placed in the coordinate system defined by transform.dataset - The pie chart represents the values in this data set.spiestring1s - An array of strings, size dataset.getNumberDatapoints(), used as labels
for the pie slices.attribs - An array of ChartAttribute objects, size dataset.getNumberDatapoints() that
specify the attributes (out1line color and fill color) for each wedge of a pie chart.labelinout1 - An array of integer, size theDataset.getNumberDatapoints(), specifying
if a specific pie slice text label is drawn inside the pie slice, or outside of the pie slice. Use one of
the constants: PIELABEL_OUTSLICE or PIELABEL_INSLICE.pielabelformat - All pie slice labels share the same format. Use one of the pie slice
label format constants: PIELABEL_NONE Do not display and pie slice text PIELABEL_STRING Display only
the pie text strings, no numeric values PIELABEL_NUMVALUE Display the pie numeric value only, no pie text
strings. PIELABEL_STRINGNUMVAL Display the pie text string and numeric value.| Method Detail |
|---|
public int errorCheck(int nerror)
errorCheck in class ChartPlotnerror - Current error state.
public void copy(PieChartBase source)
source - The source pie chart object.public java.lang.Object clone()
clone in class GraphObj
public void getPieSlicePoints(int pieslice,
ChartPoint3D arcstart,
ChartPoint3D arcstop,
ChartPoint3D arcorigin)
pieslice - The index of the pie slice.arcstart - Returns the starting point of the pie slice in window device coordinatesarcstop - Returns the ending point of the pie slice in window device coordinates.arcorigin - Returns the arc origin of the pie slice in window device coordinates.public void drawPieChart(java.awt.Graphics2D g2)
g2 - The graphics context.
public boolean calcNearestPoint(ChartPoint3D testpoint,
int nmode,
NearestPointData nearestpoint)
calcNearestPoint in class ChartPlottestpoint - The test point for the nearness calculation.nmode - Ignored.nearestpoint - Returns the parameters of the nearest pie wedge.
public void setDataset(SimpleDataset dataset)
dataset - Specifies the new SimpleDataset object.public ChartDataset getDataset()
getDataset in class ChartPlotpublic void draw(java.awt.Graphics2D g2)
draw in class GraphObjg2 - The graphics context.
public boolean checkIntersection(ChartPoint3D testpoint,
NearestPointData np)
checkIntersection in class ChartPlottestpoint - The test pointnp - Nearest point information for data based objects.
public java.lang.String getPieSliceStrings(int index)
index - The index of the pie slice.
public void setPieSliceStrings(int index,
java.lang.String piestring1)
index - The index of the pie slice.piestring1 - Sets the text string associated with a specific pie slice.public int getLabelInOut(int index)
index - The index of the pie slice.
public void setLabelInOut(int index,
int labelinout1)
index - The index of the pie slice.labelinout1 - Sets the pie slice labeling mode associated with a specific pie slice.
Use one of the constants: PIELABEL_OUTSLICE or PIELABEL_INSLICE.public double getSumPieSlices()
public void setPieSliceLabelFormat(int format)
format - Sets the pie slice labeling format associated with a specific pie slice.
Use one of the pie slice label format constants: PIELABEL_NONE, PIELABEL_STRING, PIELABEL_NUMVALUE or
PIELABEL_STRINGNUMVAL.public int getPieSliceLabelFormat()
public double getStartPieSliceAngle()
public void setStartPieSliceAngle(double angle)
angle - The start angle of the first pie slice in the pie chart in degrees.public void setPieTextRadiusPercentage(double value)
value - The pie text radius percentage.public double getPieTextRadiusPercentage()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||