Package info.monitorenter.gui.chart.axis
Class AxisLinear<T extends IAxisScalePolicy>
java.lang.Object
info.monitorenter.gui.chart.axis.AAxis<T>
info.monitorenter.gui.chart.axis.AxisLinear<T>
- Type Parameters:
T- Subtypes may be more picky which scale policies the accept to disallow incorrect scales: This supports it (seeIAxis.setAxisScalePolicy(IAxisScalePolicy)).
- All Implemented Interfaces:
IAxis<T>,PropertyChangeListener,Serializable,EventListener
An
AAxis with linear display of values.
- Version:
- $Revision: 1.22 $
- Author:
- Achim Westermann
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class info.monitorenter.gui.chart.axis.AAxis
AAxis.AChart2DDataAccessor, AAxis.XDataAccessor, AAxis.YDataAccessorNested classes/interfaces inherited from interface info.monitorenter.gui.chart.IAxis
IAxis.AxisTitle -
Field Summary
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_rangePolicyFields 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 aLabelFormatterSimplefor formatting numbers and aAxisScalePolicyAutomaticBestFitfor controlling the scale.AxisLinear(IAxisLabelFormatter formatter) Constructor that uses the given label formatter for formatting labels.AxisLinear(IAxisLabelFormatter formatter, T scalePolicy) Constructor that uses the given label formatter for formatting labels along with the given scale policy. -
Method Summary
Modifier and TypeMethodDescriptionprotected AAxis<T>.AChart2DDataAccessorcreateAccessor(Chart2D chart, int dimension, int position) Template method to create the properimplementation.AAxis.AChart2DDataAccessordoublegetScaledValue(double absolute) Scales the given absolute value into a value between 0 and 1.0 (if it is in the range of the data).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, scaleTrace, setAccessor, setAxisPosition, setAxisScalePolicy, setAxisTitle, setChart, setFormatter, setMajorTickSpacing, setMinorTickSpacing, setPaintGrid, setPaintScale, setPixelXLeft, setPixelXRight, setPixelYBottom, setPixelYTop, setRange, setRangePolicy, setStartMajorTick, setTitle, setTitlePainter, setVisible, translateMousePosition, translatePxToValue, translateValueToPx
-
Constructor Details
-
AxisLinear
public AxisLinear()Creates an instance that uses aLabelFormatterSimplefor formatting numbers and aAxisScalePolicyAutomaticBestFitfor controlling the scale. -
AxisLinear
Constructor that uses the given label formatter for formatting labels.- Parameters:
formatter- needed for formatting labels of this axis.
-
AxisLinear
Constructor that uses the given label formatter for formatting labels along with the given scale policy.- Parameters:
formatter- needed for formatting labels of this axis.scalePolicy- controls the ticks/labels and their distance.
-
-
Method Details
-
createAccessor
Description copied from class:AAxisTemplate method to create the properimplementation.AAxis.AChart2DDataAccessor- Specified by:
createAccessorin classAAxis<T extends IAxisScalePolicy>- Parameters:
chart- the chart to access.dimension-orChart2D.X.Chart2D.Yposition-,Chart2D.CHART_POSITION_BOTTOM,Chart2D.CHART_POSITION_LEFTorChart2D.CHART_POSITION_RIGHT.Chart2D.CHART_POSITION_TOP- Returns:
- the proper
implementation.AAxis.AChart2DDataAccessor - See Also:
-
getScaledValue
public double getScaledValue(double absolute) Description copied from interface:IAxisScales the given absolute value into a value between 0 and 1.0 (if it is in the range of the data).If the given absolute value is not in the display- range of the
Chart2D, negative values or values greater than 1.0 may result.- Parameters:
absolute- a value in the real value range of the corresponding chart.- Returns:
- a value between 0.0 and 1.0 that is mapped to a position within the chart.
- See Also:
-