|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.mapper.AbstractAxisMapper
lt.monarch.chart.mapper.AnalogAxisMapper<Range<java.lang.Double>>
lt.monarch.chart.mapper.MathAxisMapper
public class MathAxisMapper extends AnalogAxisMapper<Range<java.lang.Double>>
Numeric axis mapper.
| Modifier and Type | Field and Description |
|---|---|
protected AxisMapperRange |
mapperRange
the axis mapper range |
protected NormalizedMathRange |
totalRange
the total range |
protected NormalizedMathRange |
visibleRange
the visible range |
| Constructor and Description |
|---|
MathAxisMapper()
Constructs a new MathAxisMapper with the normalized range [0; 1]. |
MathAxisMapper(double min,
double max)
Constructs a new MathAxisMapper with the specified range. |
MathAxisMapper(double min,
double max,
AxisMapperRange mapperRange)
Constructs a new MathAxisMapper with the specified mapping range and the
specified visible range. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
adjustRange(NormalizedMathRange range)
Adjusts the specified normalized mathematical range. |
protected AnalogAxisScale |
createScale()
Creates and returns a new AxisScale for this axis. |
java.lang.String |
formatKey(java.lang.Object key)
Formats the specified key. |
protected java.text.Format[] |
getFormats()
Gets axis mapper formats. |
java.text.NumberFormat |
getNumberFormat()
Gets mapper's NumberFormat. |
Range<java.lang.Double> |
getRange()
Gets mapping range of the mapper. |
AxisScale |
getScale()
Returns a scale object for this axis. |
AxisMapperRange |
getViewRange()
Gets an AxisMapperRange object representing visible axis range. |
Range<java.lang.Double> |
getVisibleRange()
Gets visible range of the mapper. |
boolean |
isAdjusting()
Returns the flag indicating whether the axis range will be adjusted (normalized). |
double |
map(double key)
Finds a position of the specified double value in the mapping range. |
double |
map(java.lang.Object key)
Finds position of the specified key in the visible range. |
java.lang.Object |
mapBack(double pos)
Finds a number corresponding to the specified position in the visible range. |
void |
setDrawSubScale(boolean drawSubScale)
Sets if the sub-scale on the axis should be drawn. |
void |
setIsAdjusting(boolean adjust)
Sets the flag indicating whether the axis range will be adjusted (normalized). |
void |
setMinimumSteps(int minSteps)
Sets a minimum number of steps for this axis mapper. |
void |
setNumberFormat(java.text.NumberFormat nf)
Assigns number format to mapper. |
void |
setRange(double min,
double max)
Sets mapping range for this mapper. |
void |
setVisibleRange(double min,
double max)
Sets the visible range for this mapper. |
void |
updateRange(double value)
Updates the mapping range so that the specified value will be in the range. |
| Methods inherited from class lt.monarch.chart.mapper.AnalogAxisMapper |
|---|
getPreferredHeight, getPreferredWidth |
| Methods inherited from class lt.monarch.chart.mapper.AbstractAxisMapper |
|---|
addListener, fireMappingChanged, getProjectionRange, removeListener, setProjectionRange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final NormalizedMathRange totalRange
protected final AxisMapperRange mapperRange
protected final NormalizedMathRange visibleRange
| Constructor Detail |
|---|
public MathAxisMapper()
MathAxisMapper with the normalized range [0; 1].
public MathAxisMapper(double min,
double max)
MathAxisMapper with the specified range. Entire range is
visible.
min - the range minimummax - the range maximum
public MathAxisMapper(double min,
double max,
AxisMapperRange mapperRange)
MathAxisMapper with the specified mapping range and the
specified visible range.
min - the mapping range startmax - the mapping range endmapperRange - the axis mapper range object representing visible range part| Method Detail |
|---|
public void setMinimumSteps(int minSteps)
minSteps steps.
minSteps - minimum number of stepsNormalizedMathRange.setMinimumSteps(int)protected AnalogAxisScale createScale()
AxisScale for this axis.
MathAxisScale representing scale for this axispublic void setDrawSubScale(boolean drawSubScale)
drawSubScale - True if to draw sub-scalepublic void setNumberFormat(java.text.NumberFormat nf)
nf - the number format
public void setRange(double min,
double max)
min - start of the mapping rangemax - end of the mapping rangepublic Range<java.lang.Double> getRange()
getRange in class AnalogAxisMapper<Range<java.lang.Double>>MathRange object representing current mapping range
public void setVisibleRange(double min,
double max)
min - start of the visible rangemax - end of the visible rangepublic Range<java.lang.Double> getVisibleRange()
getVisibleRange in class AnalogAxisMapper<Range<java.lang.Double>>MathRange object representing current visible rangepublic AxisMapperRange getViewRange()
AxisMapperAxisMapperRange object representing visible axis range. The object can
be used to set visible axis range. Returns normalized value from [0..1]
public AxisScale getScale()
MathAxisScale is
returned.
protected void adjustRange(NormalizedMathRange range)
adjustSteps method
of the range. If the mapper is adjusting calls adjustRange method of the range
also.
range - the range to adjustsetIsAdjusting(boolean)public double map(double key)
key - double value to mapNormalizedMathRange.map(double)public double map(java.lang.Object key)
Number and it's double value is forwarded to visible range's
map (double value) method.
key - the Number to mapNormalizedMathRange.map(double)public java.lang.Object mapBack(double pos)
Double.NaN is returned.
mapBack in interface AxisMappermapBack in class AbstractAxisMapperpos - position in the visible range; should be a value in range [0,1]NormalizedMathRange.mapBack(double)public java.lang.String formatKey(java.lang.Object key)
formatPrecise method.
key - the Number to formatNormalizedMathRange.formatPrecise(double)public java.text.NumberFormat getNumberFormat()
NumberFormat.
NumberFormatpublic void updateRange(double value)
value - the double valueNormalizedMathRange.updateRange(double)public boolean isAdjusting()
public void setIsAdjusting(boolean adjust)
adjust - - true if the range must be adjusted, false otherwise.protected java.text.Format[] getFormats()
AnalogAxisMapper
getFormats in class AnalogAxisMapper<Range<java.lang.Double>>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||