DESY ACOP Beans Home

com.cosylab.gui.components.range2
Class LogarithmicRange

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

public class LogarithmicRange
extends java.lang.Object
implements Range

Implementation of logarithmic range.

Version:
$id$
Author:
Ales Pucelj

Field Summary
static double SMALLEST
          Constant defining smallest number that can be defined within range.
 
Constructor Summary
LogarithmicRange()
           
 
Method Summary
 TickCalculator getDefaultTickCalculator()
          Returns the default TickCaluclator employed by this Range.
 double toAbsolute(double relative, RangedValue val)
          Returns absolute value.
 double toRelative(double absolute, RangedValue val)
          Returns relative value in 0.0 to 1.0 range inclusively.
 double validate(double value)
          Checks whether value is positive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SMALLEST

public static final double SMALLEST
Constant defining smallest number that can be defined within range.

See Also:
Constant Field Values
Constructor Detail

LogarithmicRange

public LogarithmicRange()
Method Detail

toAbsolute

public double toAbsolute(double relative,
                         RangedValue val)
Returns absolute value. Function is only guaranteed to return for values larger than 0.

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

toRelative

public double toRelative(double absolute,
                         RangedValue val)
Returns relative value in 0.0 to 1.0 range inclusively.

Specified by:
toRelative in interface Range
Parameters:
absolute - value, must be larger than 0.0.
Returns:
value in 0.0 to 1.0 range.
See Also:
com.cosylab.gui.components.range.Range#toRelative(double)

validate

public final double validate(double value)
Checks whether value is positive. If value is smaller than value defined by SMALLEST constant, this constant is returned. This prevents setting of values that cannot be representated on logarithmic scale.

Specified by:
validate in interface Range
Parameters:
value - to check.
Returns:
same as value parameter if valid, SMALLEST otherwise.

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.