Class DisplayableData
- Direct Known Subclasses:
ColorScale
,FrontDrawer
,ImageRGBDisplayable
,IntermediateRings
,LineDrawing
,RGBDisplayable
,StationModelDisplayable
Instances of this class have the following bound properties:
Name | Type | Access | Default | Description |
---|---|---|---|---|
boolean | set/is | true |
Whether or not the data should be rendered. | |
manipulable | boolean | set/is | false |
Whether or not the data can be manipulated (i.e. modified) via the display. |
- Version:
- $Revision: 1.55 $
- Author:
- Steven R. Emmerson
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String
The name of the line-width property.static final String
The name of the "manipulable" property.protected DataRenderer
renderer for the datastatic final String
The name of the "visible" property.Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
-
Constructor Summary
ConstructorsConstructorDescriptionDisplayableData
(String name) Constructs from a name for the Displayable.Constructs from another instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Adds a listener for data changes.Returns a clone of this instance suitable for another VisAD Display.protected void
Handles a change to the data.protected void
destroy()
Called when the displayable is removed from a display masterboolean
Gets the "active" property.getAnimationSet
(RealType aniType, boolean force) Returns the set of values for the givenaniType
if the contained Data object adapted by thisDisplayableData
have any data of that type.final Data
getData()
Returns the data of this instance ornull
if no such data exists.protected DataRenderer
Obtains the DataRenderer for this displayable.float
Gets the current line width associated with this Displayablefinal String
getName()
Returns the name of this instance.float
Gets the point size associated with this DisplayableDataboolean
hasData()
See if any data has been set in the DataReference for this DisplayableData.final boolean
Indicates whether or not thisDisplayable
adapts a single, VisAD data object.final boolean
Gets the "manipulable" property.boolean
Get the pickable propertyprotected void
myAddConstantMaps
(ConstantMap[] newMaps) Adds this instance's data references to the associated VisAD display if possible.protected final void
Adds the VisAD DataReference of this instance to the associated VisAD display if appropriate.protected final void
Removes the VisAD DataReference of this instance from the associated VisAD display.final void
removeAction
(Action action) Removes a listener for data changes.final void
setActive
(boolean active) Sets the "active" property.final void
Sets the data for this instance.final void
setDataReference
(DataReference reference) Set the data reference for this instance.void
setDragAdapter
(DisplayableData.DragAdapter dragAdapter) Set the drag adaptervoid
setLineWidth
(float lineWidth) Sets the width of lines in this Displayable.final void
setManipulable
(boolean manipulable) Sets the "manipulable" property.void
setPickable
(boolean pickable) Set the pickable propertyvoid
setPointMode
(boolean usePoints) Set the flags for whether the Displayable displays data as points.void
setPointSize
(float pointSize) Sets the size of points in this Displayable.void
setUseFastRendering
(boolean fastRender) Set the flags for whether the Displayable uses it's methods to render quickly (eg, not account for projection seams).void
setVisible
(boolean visible) Sets the "visible" property.showme()
Print out my nametoString()
Get a String representation of this object.Methods inherited from class ucar.visad.display.Displayable
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, destroyDisplayable, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getDestroyed, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, isActive, isUnitCompatible, isVisible, logException, removeConstantMap, removeDataReferences, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setAdjustFlow, setColor, setColorPalette, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setDisplayUnit, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
-
Field Details
-
MANIPULABLE
The name of the "manipulable" property.- See Also:
-
VISIBLE
The name of the "visible" property.- See Also:
-
LINE_WIDTH
The name of the line-width property. -
renderer
renderer for the data
-
-
Constructor Details
-
DisplayableData
Constructs from a name for the Displayable. Constructs with a default DataRenderer which is appropriate for the dimensionality of the display and does not directly manipulate the data. The "visible" property will initially betrue
.- Parameters:
name
- The name for the Displayable.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
DisplayableData
Constructs from another instance. The following attributes are set from the other instance: name, manipulatility, visibility, the data reference, and activity. Note, in particular, that the data reference is set by assignment from the data reference of the other instance (i.e. the same data reference is used).- Parameters:
that
- The other instance.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
-
Method Details
-
setUseFastRendering
Set the flags for whether the Displayable uses it's methods to render quickly (eg, not account for projection seams).- Overrides:
setUseFastRendering
in classDisplayable
- Parameters:
fastRender
- Should the rendering be quick (and possibly inaccurate)- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setPointMode
Set the flags for whether the Displayable displays data as points.- Overrides:
setPointMode
in classDisplayable
- Parameters:
usePoints
- true to display as points- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
cloneForDisplay
Returns a clone of this instance suitable for another VisAD Display.
This implementation does not clone the underlying data.
- Specified by:
cloneForDisplay
in classDisplayable
- Returns:
- A clone of this instance for another display.
- Throws:
VisADException
- if a VisAD failure occurs.RemoteException
- if a Java RMI failure occurs.
-
getName
Returns the name of this instance.- Returns:
- The name of this instance as given to the constructor.
-
setManipulable
Sets the "manipulable" property. This property may be set even while this instance is being displayed. This method fires a PropertyChangeEvent for @link #MANIPULABLE}.
This implementation uses the overridable method
getDataRenderer()
to obtain a newDataRenderer
, if necessary, and the methodDisplayable.getConstantMaps()
if the data-reference needs to be (re)added to the display.- Overrides:
setManipulable
in classDisplayable
- Parameters:
manipulable
- Whether or not this instance may be directly manipulated by the VisAD system.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
isManipulable
public final boolean isManipulable()Gets the "manipulable" property.- Returns:
true
if and only if this instance may be directly manipulated by the VisAD system.
-
setVisible
Sets the "visible" property. This method fires a PropertyChangeEvent for VISIBLE.- Overrides:
setVisible
in classDisplayable
- Parameters:
visible
- Whether or not this instance should be visible.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
getActive
public boolean getActive()Gets the "active" property.- Returns:
- active state
-
setActive
Sets the "active" property. Changes to the data object are reported if and only if the value of the "active" property istrue
. If the data object changed while the active property wasfalse
, then the change will be reported when the active property is set totrue
.- Parameters:
active
- Whether or not to report changes to the data object.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
myAddDataReferences
Adds the VisAD DataReference of this instance to the associated VisAD display if appropriate. This method does not verify that the VisAD display has been set. This method is idempotent.
This implementation uses the overridable methods
getDataRenderer()
andDisplayable.getConstantMaps()
.- Specified by:
myAddDataReferences
in classDisplayable
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
myRemoveDataReferences
Removes the VisAD DataReference of this instance from the associated VisAD display. This method does not verify that the VisAD display has been set. This method is idempotent. Invoking this method will result in the overridable methodgetDataRenderer()
being invoked if this instance is subsequently added to the display.- Specified by:
myRemoveDataReferences
in classDisplayable
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
myAddConstantMaps
Adds this instance's data references to the associated VisAD display if possible. This method does not verify that the VisAD display has been set. This method is idempotent.- Overrides:
myAddConstantMaps
in classDisplayable
- Parameters:
newMaps
- maps to add- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
dataChange
Handles a change to the data. This method is called when the data of this instance's DataReference changes -- whether by direct manipulation by the VisAD display or by the setData() or setDataReference() methods. This method should be overridden in subclasses when appropriate.
This implementation does nothing.
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setDataReference
public final void setDataReference(DataReference reference) throws TypeException, RemoteException, VisADException Set the data reference for this instance. This method will result in the invocation of the dataChange() method. This method may be called even while this instance is being rendered in the associated VisAD display: it will cause the new data to be rendered.
This implementations uses the overridable methods
getDataRenderer()
andDisplayable.getConstantMaps()
.- Parameters:
reference
- The data reference for this instance. May not havenull
data.- Throws:
TypeException
- Data reference hasnull
data.VisADException
- VisAD failure.RemoteException
- Java RMI failure.- See Also:
-
destroy
Called when the displayable is removed from a display master- Overrides:
destroy
in classDisplayable
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setData
Sets the data for this instance. This method will result in the invocation of the dataChange() method. This method may be called even while this instance is being rendered in the associated VisAD display: it will cause the new data to be rendered.
This implementation uses the overridable methods
getDataRenderer()
andDisplayable.getConstantMaps()
.- Parameters:
data
- The data for this instance.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.- See Also:
-
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 classDisplayable
- Returns:
- True if and only if this instance adapts a single, VisAD data object.
-
getData
Returns the data of this instance ornull
if no such data exists. If the return-value is non-null
then it is the actual data and not a copy.- Overrides:
getData
in classDisplayable
- Returns:
- The data value or
null
. - Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.- See Also:
-
addAction
Adds a listener for data changes.- Parameters:
action
- The listener for changes to the underlying data.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
removeAction
Removes a listener for data changes.- Parameters:
action
- The listener for changes to the underlying data.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
hasData
See if any data has been set in the DataReference for this DisplayableData.- Returns:
- true if the data in the reference is not null.
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
getDataRenderer
Obtains the DataRenderer for this displayable. This is a template method: it may be overridden in subclasss to supply a non-default DataRenderer.- Returns:
- The DataRenderer for this displayable.
- Throws:
VisADException
- VisAD failure.
-
showme
Print out my name- Returns:
- my name
-
setPickable
Set the pickable property- Parameters:
pickable
- true to pick- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
isPickable
public boolean isPickable()Get the pickable property- Returns:
- true if pickable
-
getAnimationSet
Returns the set of values for the given
aniType
if the contained Data object adapted by thisDisplayableData
have any data of that type.null
will be returned if this instance adapts such an object but the object is unset, or if this instance does not support this type.- Overrides:
getAnimationSet
in classDisplayable
- Parameters:
aniType
- The type used for animationforce
- true to force- Returns:
- The set of times from all data
May be
null
. - Throws:
VisADException
- if a VisAD failure occurs.RemoteException
- if a Java RMI failure occurs.- See Also:
-
toString
Get a String representation of this object. -
setLineWidth
Sets the width of lines in this Displayable.- Overrides:
setLineWidth
in classDisplayable
- Parameters:
lineWidth
- Width of lines (1 = normal)- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
getLineWidth
public float getLineWidth()Gets the current line width associated with this Displayable- Returns:
- line width
-
setPointSize
Sets the size of points in this Displayable.- Overrides:
setPointSize
in classDisplayable
- Parameters:
pointSize
- Size of points (2 = normal)- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
getPointSize
public float getPointSize()Gets the point size associated with this DisplayableData- Returns:
- point size
-
setDragAdapter
Set the drag adapter- Parameters:
dragAdapter
- the drag adapter
-