info.monitorenter.gui.chart.axis
Class AxisLogE

java.lang.Object
  extended by info.monitorenter.gui.chart.axis.AAxis
      extended by info.monitorenter.gui.chart.axis.AAxisTransformation
          extended by info.monitorenter.gui.chart.axis.AxisLogE
All Implemented Interfaces:
IAxis, PropertyChangeListener, Serializable, EventListener

public class AxisLogE
extends AAxisTransformation

An AAxis with log 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 < 1.0 as the log transformation turns negative for values < 1.0 and becomes Double.NEGATIVE_INFINITY with lim -> 0.0 with more and more turns to a 100 % CPU load.

Version:
$Revision: 1.9 $
Author:
Pieter-Jan Busschaert (contributor), Achim Westermann
See Also:
Serialized Form

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
 
Field Summary
 
Fields inherited from class info.monitorenter.gui.chart.axis.AAxis
m_accessor, m_formatter, m_majorTickSpacing, m_minorTickSpacing, m_power
 
Fields inherited from interface info.monitorenter.gui.chart.IAxis
PROPERTY_LABELFORMATTER, PROPERTY_PAINTGRID, PROPERTY_RANGEPOLICY, PROPERTY_TITLE, PROPERTY_TITLEFONT, PROPERTY_TITLEPAINTER
 
Constructor Summary
AxisLogE()
          Creates an instance that uses a LabelFormatterSimple for formatting numbers.
AxisLogE(IAxisLabelFormatter formatter)
          Creates an instance that will the given label formatter for formatting labels.
 
Method Summary
protected  double transform(double in)
          Performs Math.log10(double) with a check for reaching infinity.
protected  double untransform(double in)
          Template method for performing the reverse axis transformation.
 
Methods inherited from class info.monitorenter.gui.chart.axis.AAxisTransformation
createAccessor, getMax, getMin, getScaledValue, translateMousePosition, translatePxToValue
 
Methods inherited from class info.monitorenter.gui.chart.axis.AAxis
addPropertyChangeListener, addTrace, getAccessor, getDimension, getFormatter, getHeight, getLabels, getMajorTickSpacing, getMinorTickSpacing, getPropertyChangeListeners, getRange, getRangePolicy, getScaleValues, getTitle, getTitlePainter, getValueDistanceForPixel, getWidth, initPaintIteration, isPaintGrid, isPaintScale, isStartMajorTick, paintTitle, propertyChange, removePropertyChangeListener, removeTrace, replace, roundToTicks, scale, scaleTrace, setAccessor, setChart, setFormatter, setMajorTickSpacing, setMinorTickSpacing, setPaintGrid, setPaintScale, setRange, setRangePolicy, setStartMajorTick, setTitle, setTitlePainter, translateValueToPx
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxisLogE

public AxisLogE()
Creates an instance that uses a LabelFormatterSimple for formatting numbers.


AxisLogE

public AxisLogE(IAxisLabelFormatter formatter)
Creates an instance that will the given label formatter for formatting labels.

Parameters:
formatter - needed for formatting labels of this axis.
Method Detail

transform

protected double transform(double in)
Performs Math.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 to Double.MAX_VALUE.

Specified by:
transform in class AAxisTransformation
Parameters:
in - the value to compute the log base 10 of.
Returns:
log base 10 for the given value.

untransform

protected 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 class AAxisTransformation
Parameters:
in - the transformed value.
Returns:
the normal value;
See Also:
AAxisTransformation.untransform(double)


Copyright © 2001 - 2007 LGPL, All Rights Footloose.