|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Range
This interface is a definition of range, a pair of two values denoting minimum and maximum. Range can be interpreted as a function of two parameters defined between minimum and maximum.
Two operations are defined on this range, conversion from absolute value
to relative and vice-versa. Absolute values are of the same scale as
minimum and maximum, relative values are defined as an interval between
0 and 1, where toRelative(getMinimum())
returns 0 and
toRelative(getMaximum())
returns 1.
Additionally, each range provides TickCollector
, which generates
information used when rendering scale ticks.
Method Summary | |
---|---|
TickCalculator |
getDefaultTickCalculator()
Returns the default TickCaluclator employed by this Range. |
double |
toAbsolute(double relative,
RangedValue ranged)
Converts relative value (in 0 to 1 range) to absolute value. |
double |
toRelative(double absolute,
RangedValue ranged)
Converts absolute value (in getMinimum() to
getMaximum() range) to relative value (0 to 1 range). |
double |
validate(double value)
Checks the value for acceptability. |
Method Detail |
---|
double toAbsolute(double relative, RangedValue ranged)
These conditions must be true:
toAbsolute(0.0) == getMinimum()
toAbsolute(1.0) == getMaximum()
toAbsolute(toRelative(x)) == x
relative
- value to convert to absolute.
double toRelative(double absolute, RangedValue ranged)
getMinimum()
to
getMaximum()
range) to relative value (0 to 1 range).These conditions must be true:
toRelative(getMinimum()) == 0.0
toRelative(getMaximum()) == 1.0
toRelative(toAbsolute(x)) == x
getMinimum()
and getMaximum()
.
absolute
- value to convert to relative.
double validate(double value)
For some scales i.e. logarithmic, no value can be set below certain value (0.0 in case of logarithmic). This method will ensure, that whenever incorrect value is passed, it returns a value that is acceptable. In case of logarithmic range, return value will never be less than 0.0.
value
- to test.
TickCalculator getDefaultTickCalculator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |