|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.visad.display.MapAdapter
ucar.visad.display.ScalarMapAdapter
public abstract class ScalarMapAdapter
Provides support for adapting VisAD ScalarMap-s to something that is
(hopefully) easier to use. Unlike instances of VisAD 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 |
| Field Summary | |
|---|---|
static String |
SCALAR_MAP
The name of the ScalarMap property. |
static String |
SCALAR_TYPE
The name of the ScalarType property. |
| Constructor Summary | |
|---|---|
protected |
ScalarMapAdapter(ScalarType st,
DisplayRealType drt,
DisplayAdapter displayAdapter)
Constructs. |
| Method Summary | |
|---|---|
void |
addScalarMapListener(ScalarMapListener listener)
Adds a ScalarMapListener to the underlying ScalarMap. |
int |
compareTo(Object obj)
Compares this instance to another object. |
boolean |
equals(Object obj)
Indicates if this instance is semantically identical to another object. |
protected Control |
getControl()
Returns the control of the underlying ScalarMap. |
DisplayRealType |
getDisplayType()
Returns the DisplayRealType of the underlying ScalarMap. |
ScalarType |
getScalarType()
Returns the ScalarType of the underlying ScalarMap. |
int |
hashCode()
Returns the hash code of this instance. |
void |
removeScalarMapListener(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(Real lower,
Real upper)
Explicitly sets the range of RealType data values that is mapped
to the natural range of DisplayRealType display values. |
protected void |
setScalarType(ScalarType scalarType)
Sets the ScalarType that is mapped to the associated DisplayRealType. |
| 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, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SCALAR_TYPE
ScalarType property.
public static final String SCALAR_MAP
ScalarMap property.
| Constructor Detail |
|---|
protected ScalarMapAdapter(ScalarType st,
DisplayRealType drt,
DisplayAdapter displayAdapter)
throws VisADException,
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.
VisADException - VisAD failure.
RemoteException - Java RMI failure.| Method Detail |
|---|
public void setRange(Real lower,
Real upper)
throws VisADException,
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.
VisADException - VisAD failure.
RemoteException - Java RMI failure.protected void scalarMapChange()
ScalarMap.
This method should be overridden in subclasses when appropriate.
protected void setScalarType(ScalarType scalarType)
throws VisADException,
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 ScalarMapListeners registered with this
instance are removed from the previous, underlying ScalarMap
and transferred to the new, underlying ScalarType. This method
fires PropertyChangeEvents 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.
VisADException - VisAD failure.
RemoteException - Java RMI failure.DisplayAdapter.accept(ScalarMapAdapter)public ScalarType getScalarType()
ScalarType of the underlying ScalarMap.
ScalarType of the underlying ScalarMap.public DisplayRealType getDisplayType()
DisplayRealType of the underlying ScalarMap.
DisplayRealType of the underlying
ScalarMap.public void addScalarMapListener(ScalarMapListener listener)
ScalarMapListener to the underlying ScalarMap.
If the underlying ScalarMap changes, then the ScalarMapListeners 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(ScalarMapListener listener)
ScalarMapListener from the underlying ScalarMap.
listener - The ScalarMapListener to be removed from
the underlying ScalarMap.public int compareTo(Object obj)
ScalarMap.
obj - The other object.
public boolean equals(Object obj)
ScalarMap-s are equal.
equals in class Objectobj - 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 Objectprotected Control getControl()
ScalarMap.
ScalarMap.
protected abstract void setControl()
throws RemoteException,
VisADException
ScalarMap.
VisADException - VisAD failure.
RemoteException - Java RMI failure.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||