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 StringThe name of the line-width property.static final StringThe name of the "manipulable" property.protected DataRendererrenderer for the datastatic final StringThe 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 voidAdds a listener for data changes.Returns a clone of this instance suitable for another VisAD Display.protected voidHandles a change to the data.protected voiddestroy()Called when the displayable is removed from a display masterbooleanGets the "active" property.getAnimationSet(RealType aniType, boolean force) Returns the set of values for the givenaniTypeif the contained Data object adapted by thisDisplayableDatahave any data of that type.final DatagetData()Returns the data of this instance ornullif no such data exists.protected DataRendererObtains the DataRenderer for this displayable.floatGets the current line width associated with this Displayablefinal StringgetName()Returns the name of this instance.floatGets the point size associated with this DisplayableDatabooleanhasData()See if any data has been set in the DataReference for this DisplayableData.final booleanIndicates whether or not thisDisplayableadapts a single, VisAD data object.final booleanGets the "manipulable" property.booleanGet the pickable propertyprotected voidmyAddConstantMaps(ConstantMap[] newMaps) Adds this instance's data references to the associated VisAD display if possible.protected final voidAdds the VisAD DataReference of this instance to the associated VisAD display if appropriate.protected final voidRemoves the VisAD DataReference of this instance from the associated VisAD display.final voidremoveAction(Action action) Removes a listener for data changes.final voidsetActive(boolean active) Sets the "active" property.final voidSets the data for this instance.final voidsetDataReference(DataReference reference) Set the data reference for this instance.voidsetDragAdapter(DisplayableData.DragAdapter dragAdapter) Set the drag adaptervoidsetLineWidth(float lineWidth) Sets the width of lines in this Displayable.final voidsetManipulable(boolean manipulable) Sets the "manipulable" property.voidsetPickable(boolean pickable) Set the pickable propertyvoidsetPointMode(boolean usePoints) Set the flags for whether the Displayable displays data as points.voidsetPointSize(float pointSize) Sets the size of points in this Displayable.voidsetUseFastRendering(boolean fastRender) Set the flags for whether the Displayable uses it's methods to render quickly (eg, not account for projection seams).voidsetVisible(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:
setUseFastRenderingin 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:
setPointModein 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:
cloneForDisplayin 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:
setManipulablein 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:
trueif 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:
setVisiblein 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:
myAddDataReferencesin 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:
myRemoveDataReferencesin 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:
myAddConstantMapsin 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 havenulldata.- Throws:
TypeException- Data reference hasnulldata.VisADException- VisAD failure.RemoteException- Java RMI failure.- See Also:
-
destroy
Called when the displayable is removed from a display master- Overrides:
destroyin 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
Displayableadapts a single, VisAD data object.This implementation always returns
true.- Overrides:
hasDataObjectin classDisplayable- Returns:
- True if and only if this instance adapts a single, VisAD data object.
-
getData
Returns the data of this instance ornullif no such data exists. If the return-value is non-nullthen it is the actual data and not a copy.- Overrides:
getDatain 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
aniTypeif the contained Data object adapted by thisDisplayableDatahave any data of that type.nullwill be returned if this instance adapts such an object but the object is unset, or if this instance does not support this type.- Overrides:
getAnimationSetin 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:
setLineWidthin 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:
setPointSizein 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
-