Package info.monitorenter.gui.chart.axis
Class AxisLog10<T extends AxisScalePolicyTransformation>
java.lang.Object
info.monitorenter.gui.chart.axis.AAxis<T>
info.monitorenter.gui.chart.axis.AAxisTransformation<T>
info.monitorenter.gui.chart.axis.AxisLog10<T>
- Type Parameters:
T
- Used to enforce that this instance only acceptsAxisScalePolicyTransformation
and subtypes.
- All Implemented Interfaces:
IAxis<T>
,PropertyChangeListener
,Serializable
,EventListener
An
AAxis
with log base 10 scaled
display of values.
Caution
This will not work with negative values (Double.NaN is computed for log of negative values).
This will even not work with values invalid input: '<' 1.0 as the log transformation turns
negative for values invalid input: '<' 1.0 and becomes Double.NEGATIVE_INFINITY
with
lim -> 0.0 with more and more turns to a 100 % CPU load.
- Version:
- $Revision: 1.15 $
- Author:
- Pieter-Jan Busschaert (contributor), Achim Westermann
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class info.monitorenter.gui.chart.axis.AAxisTransformation
AAxisTransformation.XDataAccessor, AAxisTransformation.YDataAccessor
Nested classes/interfaces inherited from class info.monitorenter.gui.chart.axis.AAxis
AAxis.AChart2DDataAccessor
Nested classes/interfaces inherited from interface info.monitorenter.gui.chart.IAxis
IAxis.AxisTitle
-
Field Summary
Fields inherited from class info.monitorenter.gui.chart.axis.AAxisTransformation
m_outputErrorTstamp
Fields inherited from class info.monitorenter.gui.chart.axis.AAxis
DEBUG, m_accessor, m_formatter, m_majorTickSpacing, m_max, m_min, m_minorTickSpacing, m_needsFullRescale, m_rangePolicy
Fields inherited from interface info.monitorenter.gui.chart.IAxis
PROPERTY_ADD_REMOVE_TRACE, PROPERTY_AXIS_SCALE_POLICY_CHANGED, PROPERTY_LABELFORMATTER, PROPERTY_PAINTGRID, PROPERTY_PAINTSCALE, PROPERTY_RANGEPOLICY
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance that uses aLabelFormatterSimple
for formatting numbers and aAxisScalePolicyAutomaticBestFit
for controlling the scale.AxisLog10
(IAxisLabelFormatter formatter, T scalePolicy) Constructor that uses the given label formatter for formatting labels. -
Method Summary
Modifier and TypeMethodDescriptiondouble
transform
(double in) PerformsMath.log10(double)
with a check for reaching infinity.double
untransform
(double in) Template method for performing the reverse axis transformation.Methods inherited from class info.monitorenter.gui.chart.axis.AAxisTransformation
createAccessor, getMaxTransformed, getMinTransformed, getScaledValue, scaleTrace, translateMousePosition, translatePxToValue
Methods inherited from class info.monitorenter.gui.chart.axis.AAxis
addPropertyChangeListener, addTrace, ensureInitialized, equals, findMax, findMin, getAccessor, getAxisPosition, getAxisScalePolicy, getAxisTitle, getDimension, getDimensionString, getFormatter, getHeight, getMajorTickSpacing, getMax, getMaxValue, getMin, getMinorTickSpacing, getMinValue, getPixelXLeft, getPixelXRight, getPixelYBottom, getPixelYTop, getPropertyChangeListeners, getRange, getRangePolicy, getTitle, getTitlePainter, getTraces, getValueDistanceForPixel, getWidth, hashCode, hasTrace, initPaintIteration, isDirtyScaling, isPaintGrid, isPaintScale, isStartMajorTick, isVisible, paint, paintTitle, propertyChange, removeAllTraces, removeAxisTitle, removePropertyChangeListener, removeTrace, scale, scalePoint, setAccessor, setAxisPosition, setAxisScalePolicy, setAxisTitle, setChart, setFormatter, setMajorTickSpacing, setMinorTickSpacing, setPaintGrid, setPaintScale, setPixelXLeft, setPixelXRight, setPixelYBottom, setPixelYTop, setRange, setRangePolicy, setStartMajorTick, setTitle, setTitlePainter, setVisible, translateValueToPx
-
Constructor Details
-
AxisLog10
public AxisLog10()Creates an instance that uses aLabelFormatterSimple
for formatting numbers and aAxisScalePolicyAutomaticBestFit
for controlling the scale. -
AxisLog10
Constructor that uses the given label formatter for formatting labels.- Parameters:
formatter
- needed for formatting labels of this axis. Prefer using simple implementations likeLabelFormatterSimple
, a log axis is complicated enough to understand.scalePolicy
- controls the ticks/labels and their distance.
-
-
Method Details
-
transform
public double transform(double in) PerformsMath.log10(double)
with a check for reaching infinity.The argument should not be negative, so only normalized values (no chart values but their scaled values or pixel values) should be given here.
If the argument is close to zero, the result of log would be
Double.POSITIVE_INFINITY
which is transformed toDouble.MAX_VALUE
.- Specified by:
transform
in classAAxisTransformation<T extends AxisScalePolicyTransformation>
- Parameters:
in
- the value to compute the log base 10 of.- Returns:
- log base 10 for the given value.
-
untransform
public double untransform(double in) Description copied from class:AAxisTransformation
Template method for performing the reverse axis transformation.This is the counterpart to
AAxisTransformation.transform(double)
.- Specified by:
untransform
in classAAxisTransformation<T extends AxisScalePolicyTransformation>
- Parameters:
in
- the transformed value.- Returns:
- the normal value;
- See Also:
-