ucar.visad.display
Class DisplayableDataRef

java.lang.Object
  extended by ucar.visad.display.Displayable
      extended by ucar.visad.display.DisplayableDataRef

public class DisplayableDataRef
extends Displayable

Provides support for displaying the VisAD Data of a VisAD DataReference.

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

Field Summary
 
Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
 
Constructor Summary
DisplayableDataRef(DataReference ref)
          Constructs from a DataReference and a missing data value.
DisplayableDataRef(String name)
          Constructs from a DataReference and a missing data value.
 
Method Summary
 Displayable cloneForDisplay()
          Returns a clone of this instance suitable for another VisAD display.
 DataReference getDataReference()
          Returns the underlying DataReference attribute.
protected  DataRenderer getDataRenderer(DisplayImpl display)
          Returns the DataRenderer for this displayable.
 boolean hasDataObject()
          Indicates whether or not this Displayable adapts a single, VisAD data object.
 boolean isManipulable()
          Indicates whether or not this instance may be directly manipulated by the VisAD display subsystem.
protected  void myAddDataReferences()
          Adds this instance's DataReference to the associated VisAD display.
protected  void myRemoveDataReferences()
          Removes this instance's data references from the associated VisAD display.
 void setColor(Color color)
          Sets the color of this Displayable.
 void setData(Data d)
          Set the data on this reference
 void setLineStyle(int lineStyle)
          Sets the style of lines in this Displayable.
 void setLineWidth(float width)
          Sets the width of lines in this Displayable.
 void setManipulable(boolean manipulable)
          Sets the direct-manipulability of the underlying data.
 void setVisible(boolean visible)
          Sets whether or not this instance is visible.
 
Methods inherited from class ucar.visad.display.Displayable
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, destroy, destroyDisplayable, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getAnimationSet, getColorUnit, getConstantMaps, getData, getDestroyed, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, isActive, isUnitCompatible, isVisible, logException, myAddConstantMaps, removeConstantMap, removeDataReferences, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setAdjustFlow, setColorPalette, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setDisplayUnit, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setPointMode, setPointSize, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseFastRendering, setUseTimesInAnimation, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayableDataRef

public DisplayableDataRef(String name)
                   throws RemoteException,
                          VisADException
Constructs from a DataReference and a missing data value. By default, the DataRenderer will be appropriate for the dimensionality of the display and will not directly manipulate the data (but see setManipulable(boolean)).

Parameters:
name - the name of the reference
Throws:
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

DisplayableDataRef

public DisplayableDataRef(DataReference ref)
                   throws RemoteException,
                          VisADException
Constructs from a DataReference and a missing data value. By default, the DataRenderer will be appropriate for the dimensionality of the display and will not directly manipulate the data (but see setManipulable(boolean)).

Parameters:
ref - The data reference for this instance.
Throws:
NullPointerException - if the argument is null.
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.
Method Detail

getDataReference

public final DataReference getDataReference()
Returns the underlying DataReference attribute.

Returns:
The underlying DataReference.

setData

public void setData(Data d)
             throws VisADException,
                    RemoteException
Set the data on this reference

Parameters:
d - data to set
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setManipulable

public final void setManipulable(boolean manipulable)
                          throws VisADException,
                                 RemoteException
Sets the direct-manipulability of the underlying data. Invoking this method determines whether or not the Data attribute of this instance's DataReference attribute may be directly manipulated by the VisAD display subsystem.

Overrides:
setManipulable in class Displayable
Parameters:
manipulable - Whether or not this instance may be directly manipulated by the VisAD display subsystem.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

isManipulable

public final boolean isManipulable()
Indicates whether or not this instance may be directly manipulated by the VisAD display subsystem.

Returns:
true if and only if this instance may be directly manipulated by the VisAD display subsystem.

setVisible

public final void setVisible(boolean visible)
                      throws VisADException,
                             RemoteException
Sets whether or not this instance is visible.

Overrides:
setVisible in class Displayable
Parameters:
visible - Whether or not this instance is visible.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

myAddDataReferences

protected final void myAddDataReferences()
                                  throws VisADException,
                                         RemoteException
Adds this instance's DataReference to the associated VisAD display. This method does not verify that the VisAD display has been set. This method is idempotent.

Specified by:
myAddDataReferences in class Displayable
Throws:
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

myRemoveDataReferences

protected final void myRemoveDataReferences()
                                     throws VisADException,
                                            RemoteException
Removes this instance's data references from the associated VisAD display. This method does not verify that the VisAD display has been set. This method is idempotent.

Specified by:
myRemoveDataReferences in class Displayable
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

hasDataObject

public final boolean hasDataObject()

Indicates whether or not this Displayable adapts a single, VisAD data object.

This implementation always returns true.

Overrides:
hasDataObject in class Displayable
Returns:
True if and only if this instance adapts a single, VisAD data object.

getDataRenderer

protected DataRenderer getDataRenderer(DisplayImpl display)
                                throws VisADException
Returns the DataRenderer for this displayable.

Parameters:
display - The VisAD display for which a DataRenderer is needed.
Returns:
This Displayable's DataRenderer.
Throws:
VisADException - VisAD failure.

setColor

public void setColor(Color color)
              throws VisADException,
                     RemoteException
Sets the color of this Displayable.

Overrides:
setColor in class Displayable
Parameters:
color - The color.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setLineWidth

public void setLineWidth(float width)
                  throws VisADException,
                         RemoteException
Sets the width of lines in this Displayable.

Overrides:
setLineWidth in class Displayable
Parameters:
width - Width of lines (2 = normal)
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setLineStyle

public void setLineStyle(int lineStyle)
                  throws VisADException,
                         RemoteException
Sets the style of lines in this Displayable.

Parameters:
lineStyle - style of line
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
See Also:
GraphicsModeControl

cloneForDisplay

public Displayable cloneForDisplay()
                            throws RemoteException,
                                   VisADException
Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.

Specified by:
cloneForDisplay in class Displayable
Returns:
A semi-deep clone of this instance.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.