|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.visad.display.Displayable
public abstract class Displayable
Provides support for encapsulating one or more displayed data objects together with their display-dependent state.
Instances of this class have the following bound properties:| Name | Type | Access | Default | Description |
|---|---|---|---|---|
| display | visad.LocalDisplay | set/get | null |
The VisAD display associated with this instance |
| scalarMapSet | ScalarMapSet | get | empty set | The set of non-spatial or unique ScalarMap-s associated with this instance |
This implementation conserves memory by delaying storage allocation for PropertyChangeListener-s until the first one is registered.
ScalarMapSet| Field Summary | |
|---|---|
static String |
DISPLAY
The name of the VisAD display property. |
protected CompositeDisplayable |
parent
The parent. |
static String |
SCALAR_MAP_SET
The name of the set of ScalarMapSet property. |
| Constructor Summary | |
|---|---|
protected |
Displayable()
Constructs from nothing. |
protected |
Displayable(Displayable that)
Constructs from another instance. |
protected |
Displayable(LocalDisplay display)
Constructs from an initial VisAD display. |
| Method Summary | |
|---|---|
ConstantMap |
addConstantMap(ConstantMap constantMap)
Adds a ConstantMap to this instance. |
void |
addConstantMaps(ConstantMap[] maps)
Adds ConstantMaps to this instance. |
void |
addDataReferences()
Requests that this instance's DataReferences be added to
the associated VisAD display as soon as feasible. |
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 boolean |
addRefsInvoked()
Returns whether or not the client has requested that this instance's DataReferences be added to the display. |
protected void |
addScalarMap(ScalarMap map)
Adds a ScalarMap to this instance's set of ScalarMap-s. |
protected void |
addScalarMaps(ScalarMapSet maps)
Adds a set of ScalarMap-s to this instance's set of ScalarMap-s. |
protected void |
applyColorUnit(ScalarMap map,
RealType realType)
If the colorUnit is not compatible with the unit of the given real type then clear the colorUnit and set the override unit of the given ScalarMap to the default Unit of the realType. |
protected void |
applyDisplayUnit(ScalarMap map,
RealType realType)
If the displayUnit is not compatible with the unit of the given RealType then clear the displayUnit and set the override
unit of the given ScalarMap to the default Unit of the
realType. |
protected void |
checkUnit(RealType realType,
Unit unit)
Check if the given unit is compatible with the unit of the given realtype. |
abstract Displayable |
cloneForDisplay()
Returns a clone of this instance suitable for another VisAD display. |
protected ConstantMap[] |
combineConstantMaps(ConstantMapSet maps)
Combines this instance's ConstantMap-s with another set of ConstantMap-s and returns a copy of the set. |
protected void |
destroy()
Called when the displayable is removed from a display master |
protected void |
firePropertyChange(PropertyChangeEvent event)
Fires a PropertyChangeEvent. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Fires a PropertyChangeEvent. |
protected void |
fireScalarMapSetChange()
Fires a PropertyChangeEvent for the SCALAR_MAP_SET property with the value of the SCALAR_MAP_SET at the time of the last firing as the old value. |
Set |
getAnimationSet(RealType aniType)
Returns the set of values for the given aniType if
the contained Data objects adapted by this Displayable have
any data of that type. |
Unit |
getColorUnit()
Return the color Unit. |
ConstantMap[] |
getConstantMaps()
Returns copies of the ConstantMap-s of this instance. |
Data |
getData()
Returns the single, VisAD data object adapted by this Displayable, if one exists. |
LocalDisplay |
getDisplay()
Returns the associated VisAD display. |
DisplayMaster |
getDisplayMaster()
Get the display master. |
Unit |
getDisplayUnit()
Returns the unit that is being used by the VisAD display subsystem for rendering this instance or null if no such unit exists. |
boolean |
getPointMode()
Get whether or not to render data as points |
protected static ScalarMap |
getScalarMap(LocalDisplay display,
ScalarMap template)
Finds the ScalarMap of a VisAD display that matches a given ScalarMap in the sense that it has the same ScalarType and DisplayRealType. |
protected static ScalarMap |
getScalarMap(LocalDisplay display,
ScalarType scalarType,
DisplayRealType displayRealType)
Finds the ScalarMap of a VisAD display that has the given ScalarType and DisplayRealType. |
protected ScalarMap |
getScalarMap(ScalarMap template)
Returns the ScalarMap in this instance's set of ScalarMaps that matches a template or null if no such
ScalarMap is found. |
ScalarMapSet |
getScalarMapSet()
Returns the set of ScalarMap-s associated with this instance. |
boolean |
getUseFastRendering()
Get whether or not to use fast rendering. |
boolean |
getUseTimesInAnimation()
Get the UseTimesInAnimation property. |
boolean |
getVisible()
Gets the visibility property. |
boolean |
hasDataObject()
Indicates whether or not this Displayable adapts a single,
VisAD data object. |
boolean |
isActive()
Is the DisplayMaster this displayable is part of active |
protected boolean |
isUnitCompatible(RealType realType,
Unit unit)
Is the given unit compatible (i.e., is either null or can convert to the defaultUnit) with the the given real type. |
boolean |
isVisible()
Returns the visibility property. |
void |
logException(String msg,
Exception exc)
A wrapper around LogUtil.logException |
protected void |
myAddConstantMaps(ConstantMap[] newMaps)
Adds this instance's data references to the associated VisAD display if possible. |
protected abstract void |
myAddDataReferences()
Adds this instance's data references to the associated VisAD display if possible. |
protected abstract void |
myRemoveDataReferences()
Removes this instance's data references from the associated VisAD display. |
ConstantMap |
removeConstantMap(DisplayRealType displayRealType)
Removes a ConstantMap from this instance. |
void |
removeDataReferences()
Removes this instance's data references from the associated VisAD display. |
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. |
protected void |
removeScalarMap(ScalarMap map)
Removes a ScalarMap from this instance's set of ScalarMap-s. |
protected void |
replaceScalarMap(ScalarMap oldMap,
ScalarMap newMap)
Replaces a ScalarMap in this instance's set of ScalarMap-s. |
void |
setAdjustFlow(boolean adjust)
A no-op method so we can have a consistent api with the composite pattern. |
void |
setColor(Color c)
A no-op method so we can have a consistent api with the composite pattern. |
void |
setColorPalette(ColorTable colorTable)
A wrapper method calling setColorPalette (float[][] c) |
void |
setColorPalette(float[][] c)
A no-op method so we can have a consistent api with the composite pattern. |
void |
setColorUnit(Unit unit)
A hook to allow sub-classes to set their color unit. |
void |
setConstantPosition(double value,
DisplayRealType type)
Set the z position to given value |
void |
setContourInfo(ContourInfo contourInfo)
A no-op method for setting contour information |
void |
setDisplay(LocalDisplay display)
Associates this instance with a given VisAD display. |
void |
setDisplayActive()
A wrapper arount DisplayMaster.setDisplayActive. |
void |
setDisplayInactive()
A wrapper arount DisplayMaster.setDisplayInactive. |
protected void |
setDisplayMaster(DisplayMaster master)
Set the display master. |
void |
setDisplayUnit(Unit unit)
Sets the unit for use by the VisAD display subsystem. |
void |
setLineWidth(float size)
A no-op method so we can have a consistent api with the composite pattern. |
void |
setOverrideAnimationSet(List times)
_more_ |
void |
setOverrideAnimationSet(Set set)
_more_ |
protected void |
setParent(CompositeDisplayable parent)
Set the parent. |
void |
setPointMode(boolean usePoints)
Set the flags for whether the Displayable displays data as points. |
void |
setPointSize(float size)
A no-op method so we can have a consistent api with the composite pattern. |
void |
setRangeForColor(double low,
double hi)
A no-op method so we can have a consistent api with the composite pattern. |
void |
setRangeForColor(Range r)
Just a wrapper around the other setRangeForColor(double, double) |
protected void |
setScalarMapSet(ScalarMapSet maps)
Sets the set of ScalarMap-s of this instance. |
void |
setSelectedRange(double low,
double hi)
A no-op method so we can have a consistent api with the composite pattern. |
void |
setSelectedRange(Range r)
Just a wrapper around the other setSelectedRange(double, double) |
void |
setUseFastRendering(boolean fastRender)
Set the flags for whether the renderer should use fast (but perhaps inaccurate) rendering (ie, not account for projection seams) |
void |
setUseTimesInAnimation(boolean value)
Set the UseTimesInAnimation property. |
void |
setVisible(boolean visible)
Sets the visibility property. |
void |
toFront()
Bring the displayable to the front. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DISPLAY
public static final String SCALAR_MAP_SET
protected CompositeDisplayable parent
| Constructor Detail |
|---|
protected Displayable()
throws RemoteException,
VisADException
VisADException - VisAD failure.
RemoteException - Java RMI failure.
protected Displayable(LocalDisplay display)
throws RemoteException,
VisADException
display - The VisAD display. May be null.
VisADException - VisAD failure.
RemoteException - Java RMI failure.
protected Displayable(Displayable that)
throws RemoteException,
VisADException
that - The other instance.
VisADException - VisAD failure.
RemoteException - Java RMI failure.| Method Detail |
|---|
public void toFront()
throws RemoteException,
VisADException
VisADException - VisAD failure.
RemoteException - Java RMI failure.public DisplayMaster getDisplayMaster()
DisplayMaster this displayable is part of.
protected void setDisplayMaster(DisplayMaster master)
throws VisADException,
RemoteException
master - The DisplayMaster this displayable is part of.
RemoteException - _more_
VisADException - _more_
public void setUseFastRendering(boolean fastRender)
throws VisADException,
RemoteException
fastRender - true to render quickly
VisADException - VisAD failure.
RemoteException - Java RMI failure.public boolean getUseFastRendering()
public void setPointMode(boolean usePoints)
throws VisADException,
RemoteException
usePoints - true to display as points
VisADException - VisAD failure.
RemoteException - Java RMI failure.public boolean getPointMode()
protected void setParent(CompositeDisplayable parent)
parent - The parent composite.
public void setConstantPosition(double value,
DisplayRealType type)
throws VisADException,
RemoteException
value - The valuetype - The type
RemoteException - On badness
VisADException - On badness
public void setDisplayInactive()
throws RemoteException,
VisADException
VisADException - VisAD failure.
RemoteException - Java RMI failure.
public void setDisplayActive()
throws RemoteException,
VisADException
RemoteException - On badness
VisADException - On badness
public boolean isActive()
throws RemoteException,
VisADException
VisADException - VisAD failure.
RemoteException - Java RMI failure.
public void setDisplay(LocalDisplay display)
throws RemoteException,
VisADException
super.setDisplay(display).
display - The VisAD display.
VisADException - if a core VisAD failure occurs.
RemoteException - if Java RMI failure occurs.removeDataReferences()public final LocalDisplay getDisplay()
null if this instance hasn't been
associated with a VisAD display yet.public final ScalarMapSet getScalarMapSet()
protected final boolean addRefsInvoked()
DataReferences be added to the display.
true if and only if
addDataReferences() has been called
without an intervening removeDataReferences().public void addPropertyChangeListener(PropertyChangeListener listener)
listener - The PropertyChangeListener to be added.
public void addPropertyChangeListener(String name,
PropertyChangeListener listener)
name - The name of the property.listener - The PropertyChangeListener to be added.public void removePropertyChangeListener(PropertyChangeListener listener)
listener - The PropertyChangeListener to be removed.
public void removePropertyChangeListener(String name,
PropertyChangeListener listener)
name - The name of the property.listener - The PropertyChangeListener to be removed.
public ConstantMap addConstantMap(ConstantMap constantMap)
throws RemoteException,
VisADException
constantMap - The ConstantMap to be added.
null.
VisADException - VisAD failure.
RemoteException - Java RMI failure.
public void addConstantMaps(ConstantMap[] maps)
throws RemoteException,
VisADException
maps - The ConstantMaps to be added.
VisADException - VisAD failure.
RemoteException - Java RMI failure.public ConstantMap removeConstantMap(DisplayRealType displayRealType)
displayRealType - The DisplayRealType to have its ConstantMap
removed.
null.
public void setRangeForColor(double low,
double hi)
throws VisADException,
RemoteException
A no-op method so we can have a consistent api with the composite pattern. This method is overwritten in CompositeDisplayable, which iterates through its children composite calling setRangeForColor. This method is overwritten in RGBDisplayable to actually setRangeForColor.
There is a fundamental problem with the Composite pattern (of which the Displayable class serves as the abstract root class) in that you want to have the Composite class (e.g., CompositeDisplayable) to be able to have methods which are recursively applied to its children. However, not all methods are shared by all potential children classes. There is a tension between having methods defined for objects that make sense and having the utility of applying methods to a group of objects through the composite.
With these no-op methods here (e.g., setColorPalette, setColor, setPointSize) we leaned towards utility vs. method signature correctness.
Of course, one way around this is to have a general setProperty (propertyName, value) method which is used.
low - The minimum value of the range for the color.hi - The maximum value of the range for the color.
VisADException - if a VisADFailure occurs.
RemoteException - if a Java RMI failure occurs.
public void setRangeForColor(Range r)
throws VisADException,
RemoteException
setRangeForColor(double, double)
r - The range for the color.
VisADException - if a VisADFailure occurs.
RemoteException - if a Java RMI failure occurs.
public void setSelectedRange(Range r)
throws VisADException,
RemoteException
setSelectedRange(double, double)
r - The range for the color.
VisADException - if a VisADFailure occurs.
RemoteException - if a Java RMI failure occurs.
public void setSelectedRange(double low,
double hi)
throws VisADException,
RemoteException
low - The minimum value of the selected rangehi - The maximum value of the selected range
VisADException - if a VisADFailure occurs.
RemoteException - if a Java RMI failure occurs.
public void setColorPalette(float[][] c)
throws RemoteException,
VisADException
c - color palette
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public void setContourInfo(ContourInfo contourInfo)
throws VisADException,
RemoteException
contourInfo - Contains contour and labeling information
VisADException - VisAD failure.
RemoteException - Java RMI failure.
public void setColorPalette(ColorTable colorTable)
throws RemoteException,
VisADException
colorTable - ColorTable that defines the palette
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public void setColor(Color c)
throws RemoteException,
VisADException
c - the Color
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public void setPointSize(float size)
throws RemoteException,
VisADException
size - point size
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public void setLineWidth(float size)
throws RemoteException,
VisADException
size - line width size (pixels)
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public void setVisible(boolean visible)
throws RemoteException,
VisADException
visible - Whether or not this instance should be
displayed.
RemoteException - Java RMI failure.
VisADException - VisAD failure.public boolean getVisible()
public boolean isVisible()
public final void addDataReferences()
throws DisplayException,
VisADException,
RemoteException
DataReferences be added to
the associated VisAD display as soon as feasible. This might or might
not happen during the invocation of this method (a
DataReference
might not be added if, for example, it contains no data). Invoking this
method will cause all subsequent addRefsInvoked() invocations
to return true until removeDataReferences() is
invoked. This method is idempotent: it may be invoked multiple times.
DisplayException - if setDisplay(LocalDisplay) has not
been invoked.
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.
public final void removeDataReferences()
throws DisplayException,
VisADException,
RemoteException
addRefsInvoked() invocations to return false until addDataReferences() is invoked. This method is idempotent: it may
be invoked multiple times.
DisplayException - if setDisplay(LocalDisplay) hasn't been
invoked.
VisADException - VisAD failure.
RemoteException - Java RMI failure.
protected abstract void myAddDataReferences()
throws VisADException,
RemoteException
VisADException - VisAD failure.
RemoteException - Java RMI failure.
protected abstract void myRemoveDataReferences()
throws VisADException,
RemoteException
VisADException - VisAD failure.
RemoteException - Java RMI failure.
protected void myAddConstantMaps(ConstantMap[] newMaps)
throws VisADException,
RemoteException
newMaps - new maps
VisADException - VisAD failure.
RemoteException - Java RMI failure.
protected void destroy()
throws RemoteException,
VisADException
VisADException - VisAD failure.
RemoteException - Java RMI failure.protected void setScalarMapSet(ScalarMapSet maps)
fireScalarMapSetChange(). Intermediate subclasses that
have their own ScalarMap-s should override this method and invoke
super.setScalarMaps(ScalarMapSet).
maps - The set of ScalarMap-s to be added.fireScalarMapSetChange()public boolean hasDataObject()
Indicates whether or not this Displayable adapts a single,
VisAD data object.
This implementation always returns false.
public Data getData()
throws VisADException,
RemoteException
Returns the single, VisAD data object adapted by this Displayable, if one exists. null will be returned if
this instance adapts such an object but the object is unset, or if this
instance is not capable of adapting a single, VisAD data object. To
distinguish these cases, use hasDataObject().
This implementation always returns null.
null.
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.hasDataObject()
protected void addScalarMaps(ScalarMapSet maps)
throws BadMappingException
fireScalarMapSetChange().
maps - The set of ScalarMap-s to be added.
BadMappingException - Duplicate ScalarMap.fireScalarMapSetChange()
protected void addScalarMap(ScalarMap map)
throws BadMappingException
fireScalarMapSetChange().
map - The ScalarMap to be added.
BadMappingException - Duplicate ScalarMap.fireScalarMapSetChange()protected ScalarMap getScalarMap(ScalarMap template)
ScalarMap in this instance's set of ScalarMaps that matches a template or null if no such
ScalarMap is found.
template - The template.
null.protected void removeScalarMap(ScalarMap map)
fireScalarMapSetChange().
map - The ScalarMap to be removed.fireScalarMapSetChange()
protected void replaceScalarMap(ScalarMap oldMap,
ScalarMap newMap)
throws BadMappingException
fireScalarMapSetChange().
oldMap - The old ScalarMap to be removed. May be
null.newMap - The new ScalarMap to be added.
BadMappingException - Duplicate ScalarMap.fireScalarMapSetChange()
protected static ScalarMap getScalarMap(LocalDisplay display,
ScalarType scalarType,
DisplayRealType displayRealType)
throws VisADException,
RemoteException
display - The VisAD display.scalarType - The ScalarType to match.displayRealType - The DisplayRealType to match.
null if no matching ScalarMap was
found.
VisADException - VisAD failure.
RemoteException - Java RMI failure.
protected static ScalarMap getScalarMap(LocalDisplay display,
ScalarMap template)
throws VisADException,
RemoteException
display - The VisAD display.template - The ScalarMap to match.
null if no matching ScalarMap was
found.
VisADException - VisAD failure.
RemoteException - Java RMI failure.protected void firePropertyChange(PropertyChangeEvent event)
event - The PropertyChangeEvent.
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
propertyName - The name of the property.oldValue - The old value of the property.newValue - The new value of the property.public ConstantMap[] getConstantMaps()
public abstract Displayable cloneForDisplay()
throws RemoteException,
VisADException
VisADException - VisAD failure.
RemoteException - Java RMI failure.protected ConstantMap[] combineConstantMaps(ConstantMapSet maps)
maps - The set of ConstantMap-s to be combined with the
ConstantMap-s of this instance.
protected void fireScalarMapSetChange()
addScalarMaps(ScalarMapSet),
addScalarMap(ScalarMap),
removeScalarMap(ScalarMap),
replaceScalarMap(ScalarMap oldMap, ScalarMap newMap)
public void logException(String msg,
Exception exc)
msg - message for the exceptionexc - exception that is being logged
public void setDisplayUnit(Unit unit)
throws RemoteException,
VisADException
unit - The display unit to use.
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public Unit getDisplayUnit()
throws RemoteException,
VisADException
null if no such unit exists.
null.
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public void setColorUnit(Unit unit)
throws RemoteException,
VisADException
unit - The color unit or null
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public Unit getColorUnit()
throws RemoteException,
VisADException
Unit.
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public void setAdjustFlow(boolean adjust)
throws RemoteException,
VisADException
adjust - true to adjust
RemoteException - Java RMI failure.
VisADException - VisAD failure.
protected boolean isUnitCompatible(RealType realType,
Unit unit)
realType - RealType to checkunit - Unit in question
protected void checkUnit(RealType realType,
Unit unit)
throws VisADException,
RemoteException
realtype.
If not throw a VisADException.
realType - RealType to checkunit - Unit in question
RemoteException - Java RMI failure.
VisADException - VisAD failure.
protected void applyDisplayUnit(ScalarMap map,
RealType realType)
throws VisADException,
RemoteException
RealType then clear the displayUnit and set the override
unit of the given ScalarMap to the default Unit of the
realType. Else set the override unit of the
ScalarMap to the displayUnit.
map - ScalarMap to modifyrealType - RealType of default unit
RemoteException - Java RMI failure.
VisADException - VisAD failure.
protected void applyColorUnit(ScalarMap map,
RealType realType)
throws VisADException,
RemoteException
map - ScalarMap to changerealType - RealType for default unit
RemoteException - Java RMI failure.
VisADException - VisAD failure.
public Set getAnimationSet(RealType aniType)
throws VisADException,
RemoteException
Returns the set of values for the given aniType if
the contained Data objects adapted by this Displayable 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.
This implementation always returns null.
aniType - The type used for animation
null.
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.hasDataObject()public void setOverrideAnimationSet(