public class Readout
extends java.lang.Object
implements java.beans.PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
The name of the name property.
|
static java.lang.String |
NUMERIC_STRING
The name of the numeric-string property.
|
static int |
REAL_UNIT
The indicator for using the unit of the Real.
|
static int |
REALTYPE_NAME
The indicator for using the name of the RealType.
|
static int |
REALTYPE_UNIT
The indicator for using the unit of the RealType.
|
static int |
SPECIFIED_NAME
The indicator for using the client-supplied name.
|
static int |
SPECIFIED_UNIT
The indicator for using the unit supplied by the client.
|
static java.lang.String |
UNIT_STRING
The name of the unit-string property.
|
Constructor and Description |
---|
Readout()
Constructs from nothing.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener for a named property.
|
java.lang.String |
getName()
Returns the name of the readout.
|
protected java.lang.String |
getName(visad.Real real)
Returns the name of the given Real, given the current name-use mode.
|
java.awt.Component |
getNameComponent()
Returns the name component.
|
int |
getNameUse()
Returns the type of name-use.
|
java.lang.String |
getNumericString()
Returns the numeric string of the readout.
|
protected java.lang.String |
getNumericString(visad.Real real)
Returns the numeric-string of the given Real, given the current
unit-use mode.
|
java.awt.Component |
getNumericValueComponent()
Returns the numeric-value component.
|
java.lang.String |
getSpecifiedName()
Returns the client-supplied name for the readout.
|
java.lang.String |
getSpecifiedUnit()
Returns the client-supplied unit-specification.
|
java.awt.Component |
getUnitComponent()
Returns the unit-specification component.
|
java.lang.String |
getUnitString()
Returns the unit-specification of the readout.
|
protected java.lang.String |
getUnitString(visad.Real real)
Returns the unit-specification of the given Real, given the current
unit-use mode.
|
int |
getUnitUse()
Returns the type of unit-use.
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
Handles a change to a property.
|
void |
setNameUse(int which)
Sets the type of name-use.
|
void |
setSpecifiedName(java.lang.String name)
Sets the client-supplied name for the readout.
|
void |
setSpecifiedUnit(java.lang.String unitString)
Sets the client-supplied unit-specification.
|
void |
setUnitUse(int which)
Sets the type of unit-use.
|
public static final int REALTYPE_NAME
public static final int SPECIFIED_NAME
public static final int REAL_UNIT
public static final int REALTYPE_UNIT
public static final int SPECIFIED_UNIT
public static final java.lang.String NAME
public static final java.lang.String NUMERIC_STRING
public static final java.lang.String UNIT_STRING
public void setSpecifiedName(java.lang.String name)
name
- The client-supplied name for the readout.public java.lang.String getSpecifiedName()
public void setNameUse(int which)
which
- The type of name-use. One of REALTYPE_NAME or
SPECIFIED_NAME.public int getNameUse()
public void setSpecifiedUnit(java.lang.String unitString) throws visad.data.units.NoSuchUnitException, visad.data.units.ParseException
unitString
- The client-supplied unit-specification.visad.data.units.NoSuchUnitException
- if the specification couldn't be decoded.visad.data.units.ParseException
- if the specification couldn't be parsed.public java.lang.String getSpecifiedUnit()
public void setUnitUse(int which)
which
- The type of unit-use. One of REAL_UNIT,
REALTYPE_UNIT, or SPECIFIED_UNIT.public int getUnitUse()
public java.lang.String getName()
public java.lang.String getNumericString() throws visad.VisADException
visad.VisADException
- if a core VisAD failure occurs.public java.lang.String getUnitString()
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- The name of the property.listener
- The PropertyChangeListener to be added.public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- The property change event.public java.awt.Component getNameComponent()
public java.awt.Component getNumericValueComponent()
public java.awt.Component getUnitComponent()
protected java.lang.String getName(visad.Real real)
real
- The Real to have a name returned.protected java.lang.String getNumericString(visad.Real real)
real
- The Real to have a numeric-string returned.protected java.lang.String getUnitString(visad.Real real)
real
- The Real to have a unit-specification returned.