DESY ACOP Beans Home

com.cosylab.gui.components.numberfield
Class Rad2HMSNumberDescriptor

java.lang.Object
  extended by com.cosylab.gui.components.numberfield.AngleNumberDescriptor
      extended by com.cosylab.gui.components.numberfield.HMSNumberDescriptor
          extended by com.cosylab.gui.components.numberfield.Rad2HMSNumberDescriptor
All Implemented Interfaces:
NumberDescriptor

public class Rad2HMSNumberDescriptor
extends HMSNumberDescriptor

Visualize double value in radians by converting it to hours and displays it in format XX:XX:XX.

Author:
Igor Kriznar

Field Summary
static java.lang.String DESCRIPTION
           
static java.lang.String NAME
           
 
Constructor Summary
Rad2HMSNumberDescriptor()
          Constructs a new Rad2HMSNNumberDescritptor.
 
Method Summary
 java.lang.Number parseNumber(java.lang.String number)
          Parses string and creates Number.
 java.lang.String printString(java.lang.Number number)
          Converts provided Number to a string, which is used for displaying the value.
static double toHours(double rad)
          Converts angle in radians to angle in hours.
static double toRadians(double hour)
          Converts angle in hours to angle in radians.
 
Methods inherited from class com.cosylab.gui.components.numberfield.AngleNumberDescriptor
getDegreeSeparator, getFormat, getMinuteSeparator, getNumberType, getSecondSeparator, isUseFullFormat, main, printEditString, setDegreeSeparator, setFormat, setMinuteSeparator, setNumberType, setSecondSeparator, setUseFullFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
NumberDescriptor, Constant Field Values

DESCRIPTION

public static final java.lang.String DESCRIPTION
See Also:
NumberDescriptor, Constant Field Values
Constructor Detail

Rad2HMSNumberDescriptor

public Rad2HMSNumberDescriptor()
Constructs a new Rad2HMSNNumberDescritptor.

Method Detail

toHours

public static final double toHours(double rad)
Converts angle in radians to angle in hours. 24 hours is 2PI radians.

Parameters:
rad - angle in radians
Returns:
angle in hours

toRadians

public static double toRadians(double hour)
Converts angle in hours to angle in radians. 24 hours is 2PI radians.

Parameters:
hour - angle in hours
Returns:
angle in radians

printString

public java.lang.String printString(java.lang.Number number)
Description copied from interface: NumberDescriptor
Converts provided Number to a string, which is used for displaying the value.

Specified by:
printString in interface NumberDescriptor
Overrides:
printString in class AngleNumberDescriptor
Parameters:
number - a number to be transformed to string
Returns:
a String representing a number.

parseNumber

public java.lang.Number parseNumber(java.lang.String number)
Description copied from interface: NumberDescriptor
Parses string and creates Number. If string is not presentation of a number and can not be parsed, then null must be returned.

Specified by:
parseNumber in interface NumberDescriptor
Overrides:
parseNumber in class AngleNumberDescriptor
Parameters:
number - a string representing a number
Returns:
instance of Number or null if string can not be parsed


Copyright © 2010. All Rights Reserved.