|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.graphics.chart.ChartFactory.ChartMetrics
com.davisor.graphics.chart.PieFactory.PieMetrics
PieMetrics contains calculated values for size variables needed when drawing the pie.
Unlike typical metrics, pie metrics need to remember the context they we created with so that they can reread values from there if the metrics ever needs to be recalculated.
PieFactory.PieMetrics| Field Summary | |
float |
centerX
Pie center. |
float |
centerY
Pie center. |
protected PieFactory.PieContext |
context
Reference to the context this metrics was created with. |
java.awt.Font |
font
Value label font |
float |
offset
Horizontal offset between slice and label |
float |
r
radius |
java.util.List |
slices
Pie slices with exact coordinates and render information. |
| Fields inherited from class com.davisor.graphics.chart.ChartFactory.ChartMetrics |
M_height, M_width |
| Constructor Summary | |
PieFactory.PieMetrics(PieFactory.PieContext context)
Creates new pie metrics. |
|
| Method Summary | |
void |
scale(float xFactor,
float yFactor)
Apply linear scaling to the image. |
void |
scaleToSize(java.lang.Number width,
java.lang.Number height)
Scales the metrics to make the chart meet given new size. |
| Methods inherited from class com.davisor.graphics.chart.ChartFactory.ChartMetrics |
add, getHeight, getSize, getWidth, scale, setHeight, setSize, setWidth |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected PieFactory.PieContext context
public java.awt.Font font
public float centerX
public float centerY
public float r
public float offset
public java.util.List slices
| Constructor Detail |
public PieFactory.PieMetrics(PieFactory.PieContext context)
context - the context this metrics was created with| Method Detail |
public void scale(float xFactor,
float yFactor)
scale in class ChartFactory.ChartMetricsxFactor - horizontal scaling factoryFactor - vertical scaling factor
public void scaleToSize(java.lang.Number width,
java.lang.Number height)
Rescaling a pie is a troublesome operation, in particular because pie labels do not scale linearly. Instead, we have to recompute the entire metrics again agains the given new chart size constrains.
scaleToSize in class ChartFactory.ChartMetricswidth - new chart width (may be null = keep the old width)height - new chart height (may be null = keep the old height)ChartFactory.ChartMetrics.getSize(int),
PieFactory.createMetrics(PieFactory.PieContext,Number,Number)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||