|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.chart2D.series.PieStrategy<ChartProjector>
public class PieStrategy<ChartProjector extends Projector> extends java.lang.Object implements java.io.Serializable
Pie series drawing strategy.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
dirty
True, if dirty, otherwise -false |
protected LegendEntry[] |
entries
|
protected boolean |
explodeAndShrink
|
protected double |
innerRadius
|
protected int |
labelAreaMultiplier
Specifies label area multiplier (used for pie resize and leave label area, pie size is resized by multiplier * series label font size) |
protected PieLabelFormat |
labelFormat
|
protected java.lang.String |
labelFormatPattern
|
protected double |
labelMargin
|
protected PieLegendFormat |
legendFormat
|
protected java.lang.String |
legendFormatPattern
|
protected java.util.Locale |
locale
|
protected PlaneMapper |
mapper
Plane mapper |
protected double |
maxExplodeRadius
|
protected MetaDataModel |
metaModel
Meta data model |
protected double |
minExplodeRadius
|
protected java.util.Map<DataColumnType,MinMaxValues> |
minMaxValues
Minimum and Maximum values |
protected ArrayDataModel |
model
Series data model |
protected Point2D |
np
|
protected int |
numbersLabelPrecision
Specifies number precision for series labels |
protected int |
numbersLegendPrecision
Specifies number precision for series labels |
protected double |
overallAngle
|
protected double |
overallRadius
|
protected Point2D |
p1
|
protected Point2D |
p2
|
protected PaintMode |
paintMode
Paint mode of the series |
protected java.lang.Double[] |
percentages
|
protected Point2D |
planePoint
Template point for mapping plane |
protected Projector |
projector
Point projector |
protected double |
shrinkRadius
|
protected java.util.ArrayList<ChartElementEntity> |
sliceElements
|
protected double |
startAngle
|
protected Style |
style
Style of series |
protected GeneralPoint |
tempPoint
Template point for projecting points |
protected java.lang.Double[] |
values
|
| Constructor and Description |
|---|
PieStrategy()
Pie strategy constructor |
| Modifier and Type | Method and Description |
|---|---|
protected double |
calculateShrink()
|
void |
calculateValuesAndPercentages(ArrayDataModel model)
Calculating values and percentages values of pie |
protected java.lang.String |
convertToString(java.lang.Double value,
int precision,
java.util.Locale local)
|
LegendEntry[] |
createLegendEntries(ArrayDataModel model,
MetaDataModel metaModel,
Style style)
Create legend entries list |
void |
dispose()
|
void |
draw(AbstractGraphics g,
ChartProjector projector,
PlaneMapper mapper,
HotSpotMap hotMap,
Style style,
PieSeries series)
|
protected void |
drawLabels(AbstractGraphics g,
ChartProjector projector,
HotSpotMap hotMap,
Style style,
PieSeries series)
|
protected void |
drawPie(AbstractGraphics g,
ChartProjector projector,
PlaneMapper mapper,
HotSpotMap hotMap,
Style style,
PieSeries series)
|
protected void |
finalize()
|
protected void |
fixStyles()
|
Point2D |
getCenterPoint()
Returns the center of pie |
double |
getInnerRadius()
Returns the Doughnut inner radius. |
int |
getLabelAreaMultiplier()
Returns label area multiplier (used for pie resize and leave label area, pie size is resized by multiplier * series label font size) |
PieLabelFormat |
getLabelFormat()
Return label format |
java.lang.String |
getLabelFormatPattern()
Return label format |
protected java.lang.String |
getLabelText(double value,
double percent,
java.lang.String sliceTitle)
Return slices label text |
PieLegendFormat |
getLegendFormat()
Return legend format |
java.lang.String |
getLegendFormatPattern()
Returns legend format pattern |
protected java.lang.String |
getLegendText(double value,
double percent,
java.lang.String sliceTitle)
Return slices legend text |
java.util.Locale |
getLocale()
Return locale of charts |
java.util.Map<DataColumnType,MinMaxValues> |
getMinMaxValues()
Gets the minMaxValues value |
int |
getNumbersLabelPrecision()
Gets precision of labels values floating point numbers. |
int |
getNumbersLegendPrecision()
Gets precision of legend values floating point numbers. |
double |
getOverallAngle()
Returns the pie angle, how much angle the pie should occupy |
double |
getRadius()
Returns pie series radius. |
Point2D |
getSliceHalfPoint(int index,
double radius)
Calculate point half angle of slice |
double |
getStartAngle()
Returns slice start angle of pie chart segment |
protected void |
initMinMaxValues()
Initializes minimum and maximum values |
protected Point2D |
projectPoint(Projector projector,
GeneralPoint ptt,
Point2D planePoint,
double x,
double y)
Projects the point |
void |
setCenterPoint(GeneralPoint centerPoint)
Set center of pie chart |
void |
setExplodeAndShrink(boolean flag)
Set explode and shrink |
void |
setInnerRadius(double radius)
Sets the Doughnut inner radius. |
void |
setLabelAreaMultiplier(int labelAreaMultiplier)
Specifies label area multiplier (used for pie resize and leave label area, pie size is resized by multiplier * series label font size) |
void |
setLabelFormat(PieLabelFormat labelFormat)
Set label format |
void |
setLabelFormatPattern(java.lang.String labelFormatPattern)
Set pattern of label format Examples: "%1$.2f, %2$.0f%%, %3$s" 1 - value, 2 - percent, 3 - slice name |
void |
setLegendFormat(PieLegendFormat legendFormat)
Set legend format |
void |
setLegendFormatPattern(java.lang.String legendFormatPattern)
Set pattern of legend format Examples: "%1$.2f, %2$.0f%%, %3$s" 1 - value, 2 - percent, 3 - slice name |
void |
setLocale(java.util.Locale locale)
Set locale of chart |
void |
setNumbersLabelPrecision(int numbersLabelPrecision)
Sets floating point numbers precision in the label values. |
void |
setNumbersLegendPrecision(int numbersLegendPrecision)
Sets floating point numbers precision in the legend values. |
void |
setOverallAngle(double angle)
Specifies the pie angle, how much angle the pie should occupy. |
void |
setRadius(double radius)
Sets pie series radius. |
void |
setStartAngle(double angle)
Sets start angle of pie chart segment. |
protected double |
sumAllValues()
|
protected void |
updateLegendStyle()
Update legend style of legend symbol |
protected void |
validateExplodeData()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayDataModel model
protected MetaDataModel metaModel
protected PlaneMapper mapper
protected Style style
protected GeneralPoint tempPoint
protected Point2D planePoint
protected Projector projector
protected PaintMode paintMode
protected boolean dirty
protected java.util.Map<DataColumnType,MinMaxValues> minMaxValues
protected double innerRadius
protected double overallRadius
protected double shrinkRadius
protected boolean explodeAndShrink
protected double minExplodeRadius
protected double maxExplodeRadius
protected double labelMargin
protected PieLabelFormat labelFormat
protected PieLegendFormat legendFormat
protected java.util.Locale locale
protected java.lang.Double[] values
protected java.lang.Double[] percentages
protected double overallAngle
protected double startAngle
protected LegendEntry[] entries
protected Point2D p1
protected Point2D p2
protected Point2D np
protected java.lang.String labelFormatPattern
protected java.lang.String legendFormatPattern
protected int numbersLabelPrecision
protected int numbersLegendPrecision
protected java.util.ArrayList<ChartElementEntity> sliceElements
protected int labelAreaMultiplier
| Constructor Detail |
|---|
public PieStrategy()
| Method Detail |
|---|
protected void initMinMaxValues()
public void dispose()
protected void drawPie(AbstractGraphics g,
ChartProjector projector,
PlaneMapper mapper,
HotSpotMap hotMap,
Style style,
PieSeries series)
protected void drawLabels(AbstractGraphics g,
ChartProjector projector,
HotSpotMap hotMap,
Style style,
PieSeries series)
public void draw(AbstractGraphics g,
ChartProjector projector,
PlaneMapper mapper,
HotSpotMap hotMap,
Style style,
PieSeries series)
protected double sumAllValues()
protected void validateExplodeData()
protected double calculateShrink()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
protected Point2D projectPoint(Projector projector,
GeneralPoint ptt,
Point2D planePoint,
double x,
double y)
projector - projectorptt - template pointplanePoint - template point to map plane coordinatesx - x coordinate to mapy - y coordinate to mappublic java.util.Map<DataColumnType,MinMaxValues> getMinMaxValues()
public void setInnerRadius(double radius)
radius - doughnut inner radius (in range [0, 0.5]).public double getInnerRadius()
public void setRadius(double radius)
radius - radius of pie series in range [0,0.5]public double getRadius()
public void setStartAngle(double angle)
angle - angle [0; 360]public double getStartAngle()
public void setOverallAngle(double angle)
angle - angle [0; 360]public double getOverallAngle()
public void setCenterPoint(GeneralPoint centerPoint)
centerPoint - point of the center the piepublic Point2D getCenterPoint()
public Point2D getSliceHalfPoint(int index,
double radius)
index - radius - radius of piepublic void setExplodeAndShrink(boolean flag)
flag - true, if explode and shrink, otherwise explode, but not shrink
public LegendEntry[] createLegendEntries(ArrayDataModel model,
MetaDataModel metaModel,
Style style)
model - data modelmetaModel - meta data modelstyle - style of pie chartsprotected void updateLegendStyle()
public void setLabelFormat(PieLabelFormat labelFormat)
labelFormat - the labelFormat to setpublic PieLabelFormat getLabelFormat()
public java.lang.String getLabelFormatPattern()
public void setLabelFormatPattern(java.lang.String labelFormatPattern)
labelFormatPattern - the labelFormatPattern to setpublic java.lang.String getLegendFormatPattern()
public void setLegendFormatPattern(java.lang.String legendFormatPattern)
legendFormatPattern - the legendFormatPattern to setpublic PieLegendFormat getLegendFormat()
public void setLegendFormat(PieLegendFormat legendFormat)
legendFormat - the legendFormat to setpublic java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
locale - the locale to set
protected java.lang.String getLabelText(double value,
double percent,
java.lang.String sliceTitle)
value - value of slicepercent - percentage value of slicessliceTitle - slice name
protected java.lang.String getLegendText(double value,
double percent,
java.lang.String sliceTitle)
value - value of slicepercent - percentage value of slicessliceTitle - slice name
protected java.lang.String convertToString(java.lang.Double value,
int precision,
java.util.Locale local)
value - precision - precision of valuelocal - locale of chartpublic void calculateValuesAndPercentages(ArrayDataModel model)
model - data modelpublic int getNumbersLabelPrecision()
public void setNumbersLabelPrecision(int numbersLabelPrecision)
numbersLabelPrecision - precision of floating point numbers.public int getNumbersLegendPrecision()
public void setNumbersLegendPrecision(int numbersLegendPrecision)
numbersLegendPrecision - precision of floating point numbers.protected void fixStyles()
public void setLabelAreaMultiplier(int labelAreaMultiplier)
labelAreaMultiplier - label area multiplierpublic int getLabelAreaMultiplier()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||