Package ucar.unidata.view.sounding
Class Readout
java.lang.Object
ucar.unidata.view.sounding.Readout
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
Provides support for value readouts.
- Version:
- $Id: Readout.java,v 1.12 2005/05/13 18:33:36 jeffmc Exp $
- Author:
- Steven R. Emmerson
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The name of the name property.static final String
The name of the numeric-string property.static final int
The indicator for using the unit of the Real.static final int
The indicator for using the name of the RealType.static final int
The indicator for using the unit of the RealType.static final int
The indicator for using the client-supplied name.static final int
The indicator for using the unit supplied by the client.static final String
The name of the unit-string property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) Adds a PropertyChangeListener for a named property.getName()
Returns the name of the readout.protected String
Returns the name of the given Real, given the current name-use mode.Returns the name component.int
Returns the type of name-use.Returns the numeric string of the readout.protected String
getNumericString
(Real real) Returns the numeric-string of the given Real, given the current unit-use mode.Returns the numeric-value component.Returns the client-supplied name for the readout.Returns the client-supplied unit-specification.Returns the unit-specification component.Returns the unit-specification of the readout.protected String
getUnitString
(Real real) Returns the unit-specification of the given Real, given the current unit-use mode.int
Returns the type of unit-use.void
Handles a change to a property.void
setNameUse
(int which) Sets the type of name-use.void
setSpecifiedName
(String name) Sets the client-supplied name for the readout.void
setSpecifiedUnit
(String unitString) Sets the client-supplied unit-specification.void
setUnitUse
(int which) Sets the type of unit-use.
-
Field Details
-
REALTYPE_NAME
public static final int REALTYPE_NAMEThe indicator for using the name of the RealType.- See Also:
-
SPECIFIED_NAME
public static final int SPECIFIED_NAMEThe indicator for using the client-supplied name.- See Also:
-
REAL_UNIT
public static final int REAL_UNITThe indicator for using the unit of the Real.- See Also:
-
REALTYPE_UNIT
public static final int REALTYPE_UNITThe indicator for using the unit of the RealType.- See Also:
-
SPECIFIED_UNIT
public static final int SPECIFIED_UNITThe indicator for using the unit supplied by the client.- See Also:
-
NAME
The name of the name property.- See Also:
-
NUMERIC_STRING
The name of the numeric-string property.- See Also:
-
UNIT_STRING
The name of the unit-string property.- See Also:
-
-
Constructor Details
-
Readout
public Readout()Constructs from nothing.
-
-
Method Details
-
setSpecifiedName
Sets the client-supplied name for the readout.- Parameters:
name
- The client-supplied name for the readout.
-
getSpecifiedName
Returns the client-supplied name for the readout.- Returns:
- The client-supplied name for the readout.
-
setNameUse
public void setNameUse(int which) Sets the type of name-use.- Parameters:
which
- The type of name-use. One of REALTYPE_NAME or SPECIFIED_NAME.
-
getNameUse
public int getNameUse()Returns the type of name-use.- Returns:
- The type of name-use. One of REALTYPE_NAME or SPECIFIED_NAME.
-
setSpecifiedUnit
Sets the client-supplied unit-specification.- Parameters:
unitString
- The client-supplied unit-specification.- Throws:
NoSuchUnitException
- if the specification couldn't be decoded.ParseException
- if the specification couldn't be parsed.
-
getSpecifiedUnit
Returns the client-supplied unit-specification.- Returns:
- The client-supplied unit-specification.
-
setUnitUse
public void setUnitUse(int which) Sets the type of unit-use.- Parameters:
which
- The type of unit-use. One of REAL_UNIT, REALTYPE_UNIT, or SPECIFIED_UNIT.
-
getUnitUse
public int getUnitUse()Returns the type of unit-use.- Returns:
- The type of unit-use. One of REAL_UNIT, REALTYPE_UNIT, or SPECIFIED_UNIT.
-
getName
Returns the name of the readout.- Returns:
- The name of the readout.
-
getNumericString
Returns the numeric string of the readout.- Returns:
- The numeric string of the readout.
- Throws:
VisADException
- if a core VisAD failure occurs.
-
getUnitString
Returns the unit-specification of the readout.- Returns:
- The unit-specification of the readout.
-
addPropertyChangeListener
Adds a PropertyChangeListener for a named property.- Parameters:
propertyName
- The name of the property.listener
- The PropertyChangeListener to be added.
-
propertyChange
Handles a change to a property.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
event
- The property change event.
-
getNameComponent
Returns the name component.- Returns:
- The name component.
-
getNumericValueComponent
Returns the numeric-value component.- Returns:
- The numeric-value component.
-
getUnitComponent
Returns the unit-specification component.- Returns:
- The unit-specification component.
-
getName
Returns the name of the given Real, given the current name-use mode.- Parameters:
real
- The Real to have a name returned.- Returns:
- The name of the Real given the current name-use mode.
-
getNumericString
Returns the numeric-string of the given Real, given the current unit-use mode.- Parameters:
real
- The Real to have a numeric-string returned.- Returns:
- The numeric-string of the Real given the current unit-use mode.
-
getUnitString
Returns the unit-specification of the given Real, given the current unit-use mode.- Parameters:
real
- The Real to have a unit-specification returned.- Returns:
- The unit-specification of the Real given the current unit-use mode.
-