DESY ACOP Beans Home

com.cosylab.gui.components.numberfield
Class AngleNumberDescriptor

java.lang.Object
  extended by com.cosylab.gui.components.numberfield.AngleNumberDescriptor
All Implemented Interfaces:
NumberDescriptor
Direct Known Subclasses:
HMSNumberDescriptor, Rad2DegNumberDescriptor

public class AngleNumberDescriptor
extends java.lang.Object
implements NumberDescriptor

AnglesNumberDescriptor displays double as angle string.

Author:
Igor Kriznar

Field Summary
static java.lang.String DESCRIPTION
           
static java.lang.String NAME
           
 
Constructor Summary
AngleNumberDescriptor()
          Creates a new AngleNumberDescriptor object.
AngleNumberDescriptor(boolean full)
          Creates a new AngleNumberDescriptor object.
AngleNumberDescriptor(char degreeSeparator, char minuteSeparator, char secondSeparator)
          Creates a new AngleNumberDescriptor with specified separator characters.
AngleNumberDescriptor(char degreeSeparator, char minuteSeparator, char secondSeparator, boolean full)
          Creates a new AngleNumberDescriptor with specified separator characters.
 
Method Summary
 char getDegreeSeparator()
          Separator printed after integral part of number, thus degree sign ° by default.
 java.lang.String getFormat()
          Returns the format
 char getMinuteSeparator()
          Separator printed after integral part of minutes, thus minutes sign ' in degree notation by default.
 java.lang.Class getNumberType()
          Returns last set number type.
 char getSecondSeparator()
          Separator printed after seconds (60 seconds is one minute), thus seconds sign " in degree notation by default.
 boolean isUseFullFormat()
          If true then value is printed in full format with all separators, thus 0 is printed as 00°00'00"
static void main(java.lang.String[] args)
          Test applet
 java.lang.Number parseNumber(java.lang.String number)
          Parses string and creates Number.
 java.lang.String printEditString(java.lang.Number number)
          Converts provided Number to a string, which is displayed when NumberField enters in to edit mode and wants to edit value.
 java.lang.String printString(java.lang.Number number)
          Converts provided Number to a string, which is used for displaying the value.
 void setDegreeSeparator(char degreeSeparator)
          Separator printed after integral part of number, thus degree sign ° by default.
 void setFormat(java.lang.String newFormat)
          Set the Number format
 void setMinuteSeparator(char minuteSeparator)
          Sets separator printed after integral part of minutes (60 minutes is one degree), thus minutes sign ' in degree notation by default.
 void setNumberType(java.lang.Class newNumberFormat)
          Sets number type to descriptor, ame as used on number field.
 void setSecondSeparator(char secondSeparator)
          Sets separator printed after seconds (60 seconds is one minute), thus seconds sign " in degree notation by default.
 void setUseFullFormat(boolean useFullFormat)
          If set to true then value is printed in full format with all separators, thus 0 is printed as 00°00'00"
 
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

AngleNumberDescriptor

public AngleNumberDescriptor()
Creates a new AngleNumberDescriptor object.


AngleNumberDescriptor

public AngleNumberDescriptor(boolean full)
Creates a new AngleNumberDescriptor object.

Parameters:
full - if true number is printed in full format

AngleNumberDescriptor

public AngleNumberDescriptor(char degreeSeparator,
                             char minuteSeparator,
                             char secondSeparator)
Creates a new AngleNumberDescriptor with specified separator characters.

Parameters:
degreeSeparator - separator after degree part of value
minuteSeparator - separator after minutes part of value
secondSeparator - separator after seconds part of value, if 0 it is not diplayed.

AngleNumberDescriptor

public AngleNumberDescriptor(char degreeSeparator,
                             char minuteSeparator,
                             char secondSeparator,
                             boolean full)
Creates a new AngleNumberDescriptor with specified separator characters.

Parameters:
degreeSeparator - separator after degree part of value
minuteSeparator - separator after minutes part of value
secondSeparator - separator after seconds part of value, if 0 it is not diplayed.
full - if true number is printed in full format
Method Detail

main

public static void main(java.lang.String[] args)
Test applet

Parameters:
args - cmd

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
Parameters:
number - a string representing a number
Returns:
instance of Number or null if string can not be parsed

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
Parameters:
number - a number to be transformed to string
Returns:
a String representing a number.

printEditString

public java.lang.String printEditString(java.lang.Number number)
Description copied from interface: NumberDescriptor
Converts provided Number to a string, which is displayed when NumberField enters in to edit mode and wants to edit value. Edit string is usually stripped from unnecessary characters and prepared for easyer user editing.

Specified by:
printEditString in interface NumberDescriptor
Parameters:
number - a number to be transformed to string
Returns:
a String representation a number prepared for editing.

getFormat

public java.lang.String getFormat()
Description copied from interface: NumberDescriptor
Returns the format

Specified by:
getFormat in interface NumberDescriptor
Returns:
Format

setFormat

public void setFormat(java.lang.String newFormat)
Description copied from interface: NumberDescriptor
Set the Number format

Specified by:
setFormat in interface NumberDescriptor

setNumberType

public void setNumberType(java.lang.Class newNumberFormat)
Description copied from interface: NumberDescriptor
Sets number type to descriptor, ame as used on number field.

Specified by:
setNumberType in interface NumberDescriptor
Parameters:
newNumberFormat - number type

getNumberType

public java.lang.Class getNumberType()
Description copied from interface: NumberDescriptor
Returns last set number type.

Specified by:
getNumberType in interface NumberDescriptor
Returns:
last set number type

getDegreeSeparator

public char getDegreeSeparator()
Separator printed after integral part of number, thus degree sign ° by default.

Returns:
separator after degree part

getMinuteSeparator

public char getMinuteSeparator()
Separator printed after integral part of minutes, thus minutes sign ' in degree notation by default.

Returns:
separator after minutes part

setMinuteSeparator

public void setMinuteSeparator(char minuteSeparator)
Sets separator printed after integral part of minutes (60 minutes is one degree), thus minutes sign ' in degree notation by default.

Parameters:
minuteSeparator - new separator after minutes part

getSecondSeparator

public char getSecondSeparator()
Separator printed after seconds (60 seconds is one minute), thus seconds sign " in degree notation by default. If 0 then is not printed.

Returns:
separator after seconds part

setSecondSeparator

public void setSecondSeparator(char secondSeparator)
Sets separator printed after seconds (60 seconds is one minute), thus seconds sign " in degree notation by default. If 0 then is not printed.

Parameters:
secondSeparator - new separator after seconds part

setDegreeSeparator

public void setDegreeSeparator(char degreeSeparator)
Separator printed after integral part of number, thus degree sign ° by default.

Parameters:
degreeSeparator - new separator after degree part

isUseFullFormat

public boolean isUseFullFormat()
If true then value is printed in full format with all separators, thus 0 is printed as 00°00'00"

Returns:
if true number is printed in full format

setUseFullFormat

public void setUseFullFormat(boolean useFullFormat)
If set to true then value is printed in full format with all separators, thus 0 is printed as 00°00'00"

Parameters:
useFullFormat - new full print flag


Copyright © 2010. All Rights Reserved.