Class RangePolicyMinimumViewport
- java.lang.Object
-
- info.monitorenter.gui.chart.rangepolicies.ARangePolicy
-
- info.monitorenter.gui.chart.rangepolicies.RangePolicyMinimumViewport
-
- All Implemented Interfaces:
IRangePolicy
,java.io.Serializable
- Direct Known Subclasses:
RangePolicyForcedPoint
public class RangePolicyMinimumViewport extends ARangePolicy
A
implementation that guarantees a minimum displayed range (viewport) but will stretch if values of the correspondingIRangePolicy
exceeds these constructor given bounds.Chart2D
To sum up the policy of this implementation this
IRangePolicy
- Guarantees to always display the constructor given range.
- Guarantees to always display every value within the
(everyChart2D
of the chart'sTracePoint2D
instances).ITrace2D
- Version:
- $Revision: 1.6 $
- Author:
- Achim Westermann
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class info.monitorenter.gui.chart.rangepolicies.ARangePolicy
m_propertyChangeSupport
-
Fields inherited from interface info.monitorenter.gui.chart.IRangePolicy
PROPERTY_RANGE, PROPERTY_RANGE_MAX, PROPERTY_RANGE_MIN
-
-
Constructor Summary
Constructors Constructor Description RangePolicyMinimumViewport(Range range)
Constructs an instance that will always ensure that the given range will be displayed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getMax(double chartMin, double chartMax)
Returns the maximum of the chart or of the internal range if greater.double
getMin(double chartMin, double chartMax)
Define the lower bound of the Chart2D's value range.-
Methods inherited from class info.monitorenter.gui.chart.rangepolicies.ARangePolicy
addPropertyChangeListener, equals, firePropertyChange, getPropertyChangeListeners, getRange, hashCode, removePropertyChangeListener, removePropertyChangeListener, setRange
-
-
-
-
Constructor Detail
-
RangePolicyMinimumViewport
public RangePolicyMinimumViewport(Range range)
Constructs an instance that will always ensure that the given range will be displayed.
- Parameters:
range
- the range that always should be visible.
-
-
Method Detail
-
getMax
public double getMax(double chartMin, double chartMax)
Returns the maximum of the chart or of the internal range if greater.- Parameters:
chartMin
- ignored.chartMax
- returned if greater than the value of the internal range.- Returns:
- Math.max(this.range.getMax(), chartMax).
- See Also:
IRangePolicy.getMax(double, double)
-
getMin
public double getMin(double chartMin, double chartMax)
Description copied from interface:IRangePolicy
Define the lower bound of the Chart2D's value range. Depends on theAAxis
this instance is bound to.- Parameters:
chartMin
- the minimum value of the connected Chart2D that may / should be taken into account.chartMax
- the maximum value of the connected Chart2D that may / should be taken into account.- Returns:
- the minimum value (lower bound) for the Chart2D to display.
- See Also:
IRangePolicy.getMin(double, double)
-
-