Package ucar.visad.display
Class ConstantMapAdapter
java.lang.Object
ucar.visad.display.MapAdapter
ucar.visad.display.ConstantMapAdapter
- All Implemented Interfaces:
Comparable
,ConstantMaps
,Propertied
Provides support for adapting VisAD ConstantMap-s into something that is
(hopefully) easier to use. Unlike instances of VisAD
ConstantMap
, the underlying ConstantMap
of
an instance of this class may change.
(Yes, I know, a modifiable ConstantMap is something of an oxymoron -- yet
it's still useful.)
Instances of this class have the following, bound, JavaBean
properties:
Name | Type | Access | Default | Description |
---|---|---|---|---|
constantMap | ConstantMap |
set/get | construction-dependent |
The underlying ConstantMap of this instance |
- Version:
- $Revision: 1.10 $
- Author:
- Steven R. Emmerson
-
Nested Class Summary
Nested classes/interfaces inherited from interface ucar.visad.display.ConstantMaps
ConstantMaps.Visitor
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstantMapAdapter
(double value, DisplayRealType drt) Constructs.Constructs.ConstantMapAdapter
(Real value, DisplayRealType drt) Constructs. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ConstantMaps.Visitor visitor) Accepts a visitor for this instance.int
Compares this instance to another object.boolean
Indicates if this instance is semantically identical to another object.Returns the constant-map property.Returns the constant-map properties.static ConstantMap[]
getConstantMaps
(ConstantMapAdapter[] constantMapAdapters) Returns theConstantMap
s of this instance.int
hashCode()
Returns the hash code of this instance.void
setDisplay
(Display display) This method should be package private because it is expected that only a DisplayAdapter will invoke this method.void
setValue
(double value) Set the constant value of the associated DisplayRealType.void
Set the constant value of the associated DisplayRealType.toString()
Returns the string representation of this instance.Methods inherited from class ucar.visad.display.MapAdapter
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getDisplayRealType, removePropertyChangeListener, removePropertyChangeListener
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ucar.visad.display.Propertied
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
CONSTANT_MAP
The name of the constant-map property.- See Also:
-
-
Constructor Details
-
ConstantMapAdapter
Constructs. The numeric value of the underlying ConstantMap will be NaN.- Parameters:
drt
- The DisplayRealType to be associated with this adapter.- Throws:
VisADException
- VisAD failure.
-
ConstantMapAdapter
Constructs.- Parameters:
value
- The initial value for the DisplayRealType in units of the default unit of the DisplayRealType.drt
- The DisplayRealType to be associated with this adapter.- Throws:
VisADException
- VisAD failure.
-
ConstantMapAdapter
Constructs.- Parameters:
value
- The initial value for the DisplayRealType in units of the default unit of the DisplayRealType.drt
- The DisplayRealType to be associated with this adapter.- Throws:
VisADException
- VisAD failure.
-
-
Method Details
-
setValue
Set the constant value of the associated DisplayRealType. Fires aPropertyChangeEvent
forCONSTANT_MAP
with this instance as the source and with the both the old and new values appropriately set. The event is fired synchronously -- so watch out for deadlock.- Parameters:
value
- The new value for the associated DisplayRealType.- Throws:
VisADException
- VisAD failure.
-
setValue
Set the constant value of the associated DisplayRealType. Fires aPropertyChangeEvent
forCONSTANT_MAP
with this instance as the source and with the both the old and new values appropriately set. The event is fired synchronously -- so watch out for deadlock.- Parameters:
value
- The new value for the associated DisplayRealType in units of the default unit of the DisplayRealType.- Throws:
VisADException
- VisAD failure.
-
getConstantMap
Returns the constant-map property.- Returns:
- The constant-map property.
-
getConstantMaps
Returns the constant-map properties. This implementation returns this instances constant-map in a one-element array.- Specified by:
getConstantMaps
in interfaceConstantMaps
- Returns:
- The constant-map properties.
-
getConstantMaps
Returns theConstantMap
s of this instance. It is guaranteed that the returned array contains no duplicates.- Parameters:
constantMapAdapters
- An array of adapted ConstantMap-s. May benull
.- Returns:
- The array of ConstantMap-s corresponding
to the input. May be
null
.
-
setDisplay
This method should be package private because it is expected that only a DisplayAdapter will invoke this method.- Specified by:
setDisplay
in interfaceConstantMaps
- Parameters:
display
- The VisAD display.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
accept
Accepts a visitor for this instance.- Specified by:
accept
in interfaceConstantMaps
- Parameters:
visitor
- The visitor for this instance.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
toString
Returns the string representation of this instance. -
compareTo
Compares this instance to another object.- Specified by:
compareTo
in interfaceComparable
- Parameters:
obj
- The other object. Must be an instance of this class.- Returns:
- A value less than, equal to, or greater than zero depending on whether this instance is considered less than, equal to, or greater than the other object, respectively.
-
equals
Indicates if this instance is semantically identical to another object. -
hashCode
public int hashCode()Returns the hash code of this instance.
-