public abstract class ScalarMapAdapter extends MapAdapter
ScalarMap
, one
can modify the associated ScalarType
of an instance of this class.
Instances of this class have the following, bound, JavaBean
properties:
Name | Type | Access | Default | Description |
---|---|---|---|---|
scalarType | ScalarType |
set/get | construction-dependent | The ScalarType of the underlying ScalarMap
of this instance |
scalarMap | ScalarMap |
construction-dependent | The underlying ScalarMap of this instance |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SCALAR_MAP
The name of the
ScalarMap property. |
static java.lang.String |
SCALAR_TYPE
The name of the
ScalarType property. |
Modifier | Constructor and Description |
---|---|
protected |
ScalarMapAdapter(visad.ScalarType st,
visad.DisplayRealType drt,
DisplayAdapter displayAdapter)
Constructs.
|
Modifier and Type | Method and Description |
---|---|
void |
addScalarMapListener(visad.ScalarMapListener listener)
Adds a
ScalarMapListener to the underlying ScalarMap . |
int |
compareTo(java.lang.Object obj)
Compares this instance to another object.
|
boolean |
equals(java.lang.Object obj)
Indicates if this instance is semantically identical to another object.
|
protected visad.Control |
getControl()
Returns the control of the underlying
ScalarMap . |
visad.DisplayRealType |
getDisplayType()
Returns the
DisplayRealType of the underlying ScalarMap . |
visad.ScalarType |
getScalarType()
Returns the
ScalarType of the underlying ScalarMap . |
int |
hashCode()
Returns the hash code of this instance.
|
void |
removeScalarMapListener(visad.ScalarMapListener listener)
Removes a
ScalarMapListener from the underlying ScalarMap . |
protected void |
scalarMapChange()
Handles a change to the underlying
ScalarMap . |
protected abstract void |
setControl()
Sets the control of the underlying
ScalarMap . |
void |
setRange(visad.Real lower,
visad.Real upper)
Explicitly sets the range of
RealType data values that is mapped
to the natural range of DisplayRealType display values. |
protected void |
setScalarType(visad.ScalarType scalarType)
Sets the
ScalarType that is mapped to the associated DisplayRealType . |
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getDisplayRealType, removePropertyChangeListener, removePropertyChangeListener
public static final java.lang.String SCALAR_TYPE
ScalarType
property.public static final java.lang.String SCALAR_MAP
ScalarMap
property.protected ScalarMapAdapter(visad.ScalarType st, visad.DisplayRealType drt, DisplayAdapter displayAdapter) throws visad.VisADException, java.rmi.RemoteException
st
- The ScalarType to be associated with the
DisplayRealType.drt
- The DisplayRealType to be associated with the
ScalarType.displayAdapter
- The associated, adapted, VisAD display.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public void setRange(visad.Real lower, visad.Real upper) throws visad.VisADException, java.rmi.RemoteException
RealType
data values that is mapped
to the natural range of DisplayRealType
display values. This
method is used to define a linear map from Scalar to DisplayScalar
values.lower
- The data value to be mapped to the low end
of the natural range of the DisplayRealType.upper
- The data value to be mapped to the upper end
of the natural range of the DisplayRealType.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.protected void scalarMapChange()
ScalarMap
.
This method should be overridden in subclasses when appropriate.protected void setScalarType(visad.ScalarType scalarType) throws visad.VisADException, java.rmi.RemoteException
ScalarType
that is mapped to the associated DisplayRealType
. If the new ScalarType
differs from the
previous ScalarType
, then the underlying ScalarMap
is
changed to conform. All ScalarMapListener
s registered with this
instance are removed from the previous, underlying ScalarMap
and transferred to the new, underlying ScalarType
. This method
fires PropertyChangeEvent
s for SCALAR_TYPE
and SCALAR_MAP
with this instance as the source and the old and new values
appropriately set. This is done synchronously -- so watch out
for deadlock.scalarType
- The ScalarType to be mapped to the
DisplayRealType.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.DisplayAdapter.accept(ScalarMapAdapter)
public visad.ScalarType getScalarType()
ScalarType
of the underlying ScalarMap
.ScalarType
of the underlying ScalarMap
.public visad.DisplayRealType getDisplayType()
DisplayRealType
of the underlying ScalarMap
.DisplayRealType
of the underlying
ScalarMap
.public void addScalarMapListener(visad.ScalarMapListener listener)
ScalarMapListener
to the underlying ScalarMap
.
If the underlying ScalarMap
changes, then the ScalarMapListener
s added by this instance are removed from the previous,
underlying ScalarType
and transferred to the new, underlying
ScalarType
.listener
- The ScalarMapListener
to be added to the
underlying ScalarMap
.public void removeScalarMapListener(visad.ScalarMapListener listener)
ScalarMapListener
from the underlying ScalarMap
.listener
- The ScalarMapListener
to be removed from
the underlying ScalarMap
.public int compareTo(java.lang.Object obj)
ScalarMap
.obj
- The other object.public boolean equals(java.lang.Object obj)
ScalarMap
-s are equal.equals
in class java.lang.Object
obj
- The other object.true
if and only if the other
object is an instance of this class and its
underlying ScalarMap
is equal to this
instance's.public int hashCode()
hashCode
in class java.lang.Object
protected visad.Control getControl()
ScalarMap
.ScalarMap
.protected abstract void setControl() throws java.rmi.RemoteException, visad.VisADException
ScalarMap
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.