public class DisplayableData extends Displayable
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. |
Modifier and Type | Class and Description |
---|---|
static interface |
DisplayableData.DragAdapter
DragAdapter
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LINE_WIDTH
The name of the line-width property.
|
static java.lang.String |
MANIPULABLE
The name of the "manipulable" property.
|
protected visad.DataRenderer |
renderer
renderer for the data
|
static java.lang.String |
VISIBLE
The name of the "visible" property.
|
DISPLAY, parent, SCALAR_MAP_SET
Constructor and Description |
---|
DisplayableData(DisplayableData that)
Constructs from another instance.
|
DisplayableData(java.lang.String name)
Constructs from a name for the Displayable.
|
Modifier and Type | Method and Description |
---|---|
void |
addAction(visad.Action action)
Adds a listener for data changes.
|
Displayable |
cloneForDisplay()
Returns a clone of this instance suitable for another VisAD Display.
|
protected void |
dataChange()
Handles a change to the data.
|
protected void |
destroy()
Called when the displayable is removed from a display master
|
boolean |
getActive()
Gets the "active" property.
|
visad.Set |
getAnimationSet(visad.RealType aniType,
boolean force)
Returns the set of values for the given
aniType if
the contained Data object adapted by this DisplayableData have
any data of that type. |
visad.Data |
getData()
Returns the data of this instance or
null if no such data
exists. |
protected visad.DataRenderer |
getDataRenderer()
Obtains the DataRenderer for this displayable.
|
float |
getLineWidth()
Gets the current line width associated with this Displayable
|
java.lang.String |
getName()
Returns the name of this instance.
|
float |
getPointSize()
Gets the point size associated with this DisplayableData
|
boolean |
hasData()
See if any data has been set in the DataReference for this
DisplayableData.
|
boolean |
hasDataObject()
Indicates whether or not this
Displayable adapts a single,
VisAD data object. |
boolean |
isManipulable()
Gets the "manipulable" property.
|
boolean |
isPickable()
Get the pickable property
|
protected void |
myAddConstantMaps(visad.ConstantMap[] newMaps)
Adds this instance's data references to the associated VisAD display if
possible.
|
protected void |
myAddDataReferences()
Adds the VisAD DataReference of this instance to the associated VisAD
display if appropriate.
|
protected void |
myRemoveDataReferences()
Removes the VisAD DataReference of this instance from the associated
VisAD display.
|
void |
removeAction(visad.Action action)
Removes a listener for data changes.
|
void |
setActive(boolean active)
Sets the "active" property.
|
void |
setData(visad.Data data)
Sets the data for this instance.
|
void |
setDataReference(visad.DataReference reference)
Set the data reference for this instance.
|
void |
setDragAdapter(DisplayableData.DragAdapter dragAdapter)
Set the drag adapter
|
void |
setLineWidth(float lineWidth)
Sets the width of lines in this Displayable.
|
void |
setManipulable(boolean manipulable)
Sets the "manipulable" property.
|
void |
setPickable(boolean pickable)
Set the pickable property
|
void |
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.
|
java.lang.String |
showme()
Print out my name
|
java.lang.String |
toString()
Get a String representation of this object.
|
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
public static final java.lang.String MANIPULABLE
public static final java.lang.String VISIBLE
public static java.lang.String LINE_WIDTH
protected visad.DataRenderer renderer
public DisplayableData(java.lang.String name) throws visad.VisADException, java.rmi.RemoteException
true
.name
- The name for the Displayable.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public DisplayableData(DisplayableData that) throws visad.VisADException, java.rmi.RemoteException
that
- The other instance.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public void setUseFastRendering(boolean fastRender) throws visad.VisADException, java.rmi.RemoteException
setUseFastRendering
in class Displayable
fastRender
- Should the rendering be quick (and possibly
inaccurate)visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public void setPointMode(boolean usePoints) throws visad.VisADException, java.rmi.RemoteException
setPointMode
in class Displayable
usePoints
- true to display as pointsvisad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public Displayable cloneForDisplay() throws visad.VisADException, java.rmi.RemoteException
Returns a clone of this instance suitable for another VisAD Display.
This implementation does not clone the underlying data.
cloneForDisplay
in class Displayable
visad.VisADException
- if a VisAD failure occurs.java.rmi.RemoteException
- if a Java RMI failure occurs.public final java.lang.String getName()
public final void setManipulable(boolean manipulable) throws visad.VisADException, java.rmi.RemoteException
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 new DataRenderer
, if
necessary, and the method Displayable.getConstantMaps()
if the
data-reference needs to be (re)added to the display.
setManipulable
in class Displayable
manipulable
- Whether or not this instance may be directly
manipulated by the VisAD system.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public final boolean isManipulable()
true
if and only if this instance may be
directly manipulated by the VisAD system.public void setVisible(boolean visible) throws java.rmi.RemoteException, visad.VisADException
setVisible
in class Displayable
visible
- Whether or not this instance should be visible.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public boolean getActive()
public final void setActive(boolean active) throws visad.VisADException, java.rmi.RemoteException
true
. If
the data object changed while the active property was false
,
then the change will be reported when the active property is set
to true
.active
- Whether or not to report changes to the data
object.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.protected final void myAddDataReferences() throws visad.VisADException, java.rmi.RemoteException
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()
and Displayable.getConstantMaps()
.
myAddDataReferences
in class Displayable
visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.protected final void myRemoveDataReferences() throws visad.VisADException, java.rmi.RemoteException
getDataRenderer()
being invoked if
this instance is subsequently added to the display.myRemoveDataReferences
in class Displayable
visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.protected void myAddConstantMaps(visad.ConstantMap[] newMaps) throws visad.VisADException, java.rmi.RemoteException
myAddConstantMaps
in class Displayable
newMaps
- maps to addvisad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.protected void dataChange() throws visad.VisADException, java.rmi.RemoteException
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.
visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public final void setDataReference(visad.DataReference reference) throws visad.TypeException, java.rmi.RemoteException, visad.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()
and Displayable.getConstantMaps()
.
reference
- The data reference for this instance. May not
have null
data.visad.TypeException
- Data reference has null
data.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.dataChange()
protected void destroy() throws java.rmi.RemoteException, visad.VisADException
destroy
in class Displayable
visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public final void setData(visad.Data data) throws java.rmi.RemoteException, visad.VisADException
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()
and Displayable.getConstantMaps()
.
data
- The data for this instance.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.dataChange()
public final boolean hasDataObject()
Indicates whether or not this Displayable
adapts a single,
VisAD data object.
This implementation always returns true
.
hasDataObject
in class Displayable
public final visad.Data getData() throws visad.VisADException, java.rmi.RemoteException
null
if no such data
exists. If the return-value is non-null
then it is the
actual data and not a copy.getData
in class Displayable
null
.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.Displayable.hasDataObject()
public final void addAction(visad.Action action) throws visad.VisADException, java.rmi.RemoteException
action
- The listener for changes to the underlying
data.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public final void removeAction(visad.Action action) throws visad.VisADException, java.rmi.RemoteException
action
- The listener for changes to the underlying
data.visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public boolean hasData() throws visad.VisADException, java.rmi.RemoteException
visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.protected visad.DataRenderer getDataRenderer() throws visad.VisADException
visad.VisADException
- VisAD failure.public java.lang.String showme()
public void setPickable(boolean pickable) throws visad.VisADException, java.rmi.RemoteException
pickable
- true to pickvisad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public boolean isPickable()
public visad.Set getAnimationSet(visad.RealType aniType, boolean force) throws visad.VisADException, java.rmi.RemoteException
Returns the set of values for the given aniType
if
the contained Data object adapted by this DisplayableData
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.
getAnimationSet
in class Displayable
aniType
- The type used for animationforce
- true to forcenull
.visad.VisADException
- if a VisAD failure occurs.java.rmi.RemoteException
- if a Java RMI failure occurs.hasDataObject()
public java.lang.String toString()
toString
in class java.lang.Object
public void setLineWidth(float lineWidth) throws visad.VisADException, java.rmi.RemoteException
setLineWidth
in class Displayable
lineWidth
- Width of lines (1 = normal)visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public float getLineWidth()
public void setPointSize(float pointSize) throws visad.VisADException, java.rmi.RemoteException
setPointSize
in class Displayable
pointSize
- Size of points (2 = normal)visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public float getPointSize()
public void setDragAdapter(DisplayableData.DragAdapter dragAdapter)
dragAdapter
- the drag adapter