ucar.visad.display
Class DataAdapter

java.lang.Object
  extended by ucar.visad.display.DataAdapter
All Implemented Interfaces:
Propertied

public class DataAdapter
extends Object
implements Propertied

Provides support for adapting VisAD data objects into something that is (hopefully) easier to use. This class aggregates a VisAD Display, a DataReference, a DataRenderer, and associated ConstantMap-s into a single entity.

Instances of this class have the following, bound, JavaBean properties:

Name Type Access Default Description
constantMap ConstantMap construction-dependent Fired whenever any ConstantMap changes
PropertyChangeEvent-s fired for the CONSTANT_MAP property have the originating instance of this class as the source and the old and new values set to the appropriate ConstantMaps.

Version:
$Revision: 1.9 $
Author:
Steven R. Emmerson

Field Summary
static String CONSTANT_MAP
          The name of the ConstantMap "property".
 
Constructor Summary
DataAdapter(DisplayAdapter displayAdapter, DataReference dataReference)
          Constructs.
DataAdapter(DisplayAdapter displayAdapter, DataReference dataReference, ConstantMaps constantMaps)
          Constructs.
DataAdapter(DisplayAdapter displayAdapter, DataReference dataReference, ConstantMaps constantMaps, DataRenderer renderer)
          Constructs.
 
Method Summary
 void addAction(Action action)
          Links an Action to the data component.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to this instance.
 void addPropertyChangeListener(String name, PropertyChangeListener listener)
          Adds a PropertyChangeListener for a named property to this instance.
protected  void firePropertyChange(PropertyChangeEvent event)
          Fires a PropertyChangeEvent.
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Fires a PropertyChangeEvent.
 void removeAction(Action action)
          Unlinks an Action from the data component.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener from this instance.
 void removePropertyChangeListener(String name, PropertyChangeListener listener)
          Removes a PropertyChangeListener for a named property from this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT_MAP

public static final String CONSTANT_MAP
The name of the ConstantMap "property".

See Also:
Constant Field Values
Constructor Detail

DataAdapter

public DataAdapter(DisplayAdapter displayAdapter,
                   DataReference dataReference)
            throws VisADException,
                   RemoteException
Constructs.

Parameters:
displayAdapter - The adapted display.
dataReference - The reference to the datum.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

DataAdapter

public DataAdapter(DisplayAdapter displayAdapter,
                   DataReference dataReference,
                   ConstantMaps constantMaps)
            throws VisADException,
                   RemoteException
Constructs.

Parameters:
displayAdapter - The adapted display.
dataReference - The reference to the datum.
constantMaps - The constant maps for the datum. May be null.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

DataAdapter

public DataAdapter(DisplayAdapter displayAdapter,
                   DataReference dataReference,
                   ConstantMaps constantMaps,
                   DataRenderer renderer)
            throws VisADException,
                   RemoteException
Constructs. This is the most general constructor.

Parameters:
displayAdapter - The adapted display.
dataReference - The reference to the datum.
constantMaps - The constant maps for the datum. May be null.
renderer - The renderer for the data. May be null. If non-null, then must not have been used before.
Throws:
VisADException - The DataRenderer is already in-use for other data.
RemoteException - Java RMI failure.
Method Detail

addAction

public void addAction(Action action)
               throws VisADException,
                      RemoteException
Links an Action to the data component.

Parameters:
action - The Action to be linked.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

removeAction

public void removeAction(Action action)
                  throws VisADException,
                         RemoteException
Unlinks an Action from the data component.

Parameters:
action - The Action to be unlinked.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to this instance.

Specified by:
addPropertyChangeListener in interface Propertied
Parameters:
listener - The PropertyChangeListener to be added.

addPropertyChangeListener

public void addPropertyChangeListener(String name,
                                      PropertyChangeListener listener)
Adds a PropertyChangeListener for a named property to this instance.

Specified by:
addPropertyChangeListener in interface Propertied
Parameters:
name - The name of the property.
listener - The PropertyChangeListener to be added.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from this instance.

Specified by:
removePropertyChangeListener in interface Propertied
Parameters:
listener - The PropertyChangeListener to be removed.

removePropertyChangeListener

public void removePropertyChangeListener(String name,
                                         PropertyChangeListener listener)
Removes a PropertyChangeListener for a named property from this instance.

Specified by:
removePropertyChangeListener in interface Propertied
Parameters:
name - The name of the property.
listener - The PropertyChangeListener to be removed.

firePropertyChange

protected void firePropertyChange(PropertyChangeEvent event)
Fires a PropertyChangeEvent.

Parameters:
event - The PropertyChangeEvent.

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Fires a PropertyChangeEvent.

Parameters:
propertyName - The name of the property.
oldValue - The old value of the property.
newValue - The new value of the property.