DESY ACOP Beans Home

com.cosylab.gui.components.range2
Class LinearRange

java.lang.Object
  extended by com.cosylab.gui.components.range2.LinearRange
All Implemented Interfaces:
Range

public class LinearRange
extends java.lang.Object
implements Range

Implementation of linear range.

Version:
$id$
Author:
Ales Pucelj

Constructor Summary
LinearRange()
           
 
Method Summary
 TickCalculator getDefaultTickCalculator()
          Returns the default TickCaluclator employed by this Range.
 double toAbsolute(double relative, RangedValue ranged)
          Converts relative value in this range to absolute.
 double toRelative(double absolute, RangedValue ranged)
          Converts absolute value into relative (defined in 0.0 to 1.0 range).
 double validate(double value)
          Returns the parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearRange

public LinearRange()
Method Detail

validate

public double validate(double value)
Returns the parameters.

Specified by:
validate in interface Range
Parameters:
value - to test.
Returns:
acceptable value.
See Also:
com.cosylab.gui.components.range.Range#checkValue(double)

toAbsolute

public double toAbsolute(double relative,
                         RangedValue ranged)
Converts relative value in this range to absolute. If span of range is infinite, return value is 0. Conversion is implemented for all values even outside the 0.0 - 1.0 range.

Specified by:
toAbsolute in interface Range
Parameters:
relative - value in range 0.0 to 1.0 inclusively.
Returns:
absolute value.
See Also:
com.cosylab.gui.components.range.Range#toAbsolute(double)

toRelative

public double toRelative(double absolute,
                         RangedValue ranged)
Converts absolute value into relative (defined in 0.0 to 1.0 range). If span of the range is infinite, return value is 0.5. Conversion is defined for all values of even outside the range.

Specified by:
toRelative in interface Range
Parameters:
absolute - value.
Returns:
relative value.
See Also:
com.cosylab.gui.components.range.Range#toRelative(double)

getDefaultTickCalculator

public TickCalculator getDefaultTickCalculator()
Description copied from interface: Range
Returns the default TickCaluclator employed by this Range.

Specified by:
getDefaultTickCalculator in interface Range
Returns:


Copyright © 2010. All Rights Reserved.