|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.monitorenter.gui.chart.axis.scalepolicy.AxisScalePolicyManualTicks
public class AxisScalePolicyManualTicks
Scale policy implementation that ensures the following:
While this strategy is quite comfortable and prevents visual oddities there are some consequences to it:
LabelFormatterNumber
via
IAxis.setFormatter(IAxisLabelFormatter)
that formats little to no
digits. But this could have both effects: More labels as the labels take less
space or less labels as the value range is so little that an increased
formatted value is possible only little times within that range.IAxis.setMinorTickSpacing(double)
and
IAxis.setMajorTickSpacing(double)
Constructor Summary | |
---|---|
AxisScalePolicyManualTicks()
|
Method Summary | |
---|---|
protected LabeledValue |
createLabeledValue(double value,
double majorTickSpacing,
IAxis<?> axis)
Just a helper to create a labeled value instance. |
protected java.util.List<LabeledValue> |
getLabels(IAxis<?> axis)
Returns the labels for this axis. |
java.util.List<LabeledValue> |
getScaleValues(java.awt.Graphics g2d,
IAxis<?> axis)
Returns the array of labeled values that will be used by the to paint labels. |
void |
initPaintIteration(IAxis<?> axis)
Performs expensive calculations for various values that are used by many calls throughout a paint iterations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AxisScalePolicyManualTicks()
Method Detail |
---|
protected LabeledValue createLabeledValue(double value, double majorTickSpacing, IAxis<?> axis)
value
- the value use.majorTickSpacing
- if value % majorTickSpacing is zero then the resulting
LabeledValue
will be judged as a major tick.axis
- needed to re-parse the value into the label string by using the
formatter of it.
protected java.util.List<LabeledValue> getLabels(IAxis<?> axis)
public java.util.List<LabeledValue> getScaleValues(java.awt.Graphics g2d, IAxis<?> axis)
IAxisScalePolicy
Chart2D
to paint labels.
getScaleValues
in interface IAxisScalePolicy
g2d
- Provides information about the graphic context (e.g. font
metrics).axis
- the axis to work for.
Chart2D
to paint labels.IAxisScalePolicy.getScaleValues(java.awt.Graphics,
info.monitorenter.gui.chart.IAxis)
public void initPaintIteration(IAxis<?> axis)
IAxisScalePolicy
These values are constant throughout a paint iteration by the contract that no point is added removed or changed in this period. Because these values are used from many methods it is impossible to calculate them at a "transparent" method that may perform this caching over a paint period without knowledge from outside. The first method called in a paint iteration is called several further times in the iteration. So this is the common hook to invoke before painting a chart.
initPaintIteration
in interface IAxisScalePolicy
axis
- the axis to read data from.IAxisScalePolicy.initPaintIteration(info.monitorenter.gui.chart.IAxis)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |