Package ucar.visad.display
Class CompositeDisplayable
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.CompositeDisplayable
- Direct Known Subclasses:
AerologicalDisplay.DisplayablePseudoAdiabaticTrajectory
,MeanWindSet
,PseudoAdiabaticDisplayable
,RadarGrid
,SelectorDisplayable
,Sounding
,SoundingSet
,WindProfile
,WindProfileSet
Supports composition of a list of Displayable-s into a single Displayable.
A change to the list of Displayable-s of an instance of this class fires a javax.swing.event.ListDataEvent.
- Version:
- $Revision: 1.50 $
- Author:
- Steven R. Emmerson
-
Field Summary
FieldsFields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
-
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs from nothing._more_protected
Constructs from another instance.CompositeDisplayable
(LocalDisplay display) Constructs from an initial VisAD display. -
Method Summary
Modifier and TypeMethodDescriptionAssociates a ConstantMap with this Displayable.void
addDisplayable
(Displayable displayable) Adds a Displayable to the composite.void
addListDataListener
(ListDataListener listener) Adds a listener for list-data events.void
Removes all displayables from this composite -- causing them to be removed from the VisAD display.Returns a clone of this instance suitable for another VisAD display.void
debug()
_more_protected void
destroy()
Called when the displayable is removed from a display mastervoid
_more_int
Gets the current number of displayables.protected void
fireListDataContentsChanged
(int index0, int index1) Invokes the contentsChanged() method of all registered ListDataListener-s.protected void
fireListDataIntervalAdded
(int index0, int index1) Invokes the intervalAdded() method of all registered ListDataListener-s.protected void
fireListDataIntervalRemoved
(int index0, int index1) Invokes the intervalRemoved() method of all registered ListDataListener-s.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.getDisplayable
(int index) Gets a Displayable of the composite.int
indexOf
(Displayable displayable) Gets the index of the particular Displayable.iterator()
Obtains an Iterator over the children of this composite.Obtains the last displayable added to this composite.protected final void
Adds DataReference-s to the associated display.protected final void
Removes this instance's DataReference-s from the associated VisAD display.removeDisplayable
(int index) Removes a Displayable from the composite.boolean
removeDisplayable
(Displayable displayable) Removes a Displayable from the composite.void
removeListDataListener
(ListDataListener listener) Removes a listener for list-data events.void
setAdjustFlow
(boolean adjust) Sets whether flows are adjusted.void
Sets the color of the childrenvoid
setColorPalette
(float[][] c) Sets the color table of the children.void
setColorUnit
(Unit unit) Sets the unit to be used for colors on all contained childrenvoid
setConstantPosition
(double value, DisplayRealType type) Set the z position to given valuevoid
setDisplay
(LocalDisplay display) Sets the associated VisAD display.void
setDisplayable
(int index, Displayable displayable) Sets a Displayable of the composite.protected void
setDisplayMaster
(DisplayMaster master) _more_void
setDisplayUnit
(Unit unit) Sets the unit on all contained children.void
setLineWidth
(float width) Sets the line width of the children.void
setManipulable
(boolean manipulable) Sets the manipulable value of this Displayable.void
setPointMode
(boolean usePoints) Set the flags for whether the Displayable displays data as points.void
setPointSize
(float size) Sets the point size of the childrenvoid
setSelectedRange
(double low, double hi) Set the range of the selected data on each of the children displayables.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
setUseTimesInAnimation
(boolean value) Set the UseTimesInAnimation property.void
setVisible
(boolean visible) Sets the visibility of this Displayable.void
setVisible
(boolean visible, int index) Sets the visibility of an individual child.void
setVisible
(boolean visible, int lowerIndex, int upperIndex) Sets the visibility of an interval of children.void
toFront()
Brings all the children to front.toString()
Returns a string representation of this composite.Methods inherited from class ucar.visad.display.Displayable
addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, destroyDisplayable, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getData, getDestroyed, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, hasDataObject, isActive, isUnitCompatible, isVisible, logException, myAddConstantMaps, removeConstantMap, removeDataReferences, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setColorPalette, setContourInfo, setDisplayActive, setDisplayInactive, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange
-
Field Details
-
label
_more_ -
cnt
public static int cnt_more_
-
-
Constructor Details
-
CompositeDisplayable
Constructs from nothing.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
CompositeDisplayable
_more_- Parameters:
lbl
- _more_- Throws:
RemoteException
- _more_VisADException
- _more_
-
CompositeDisplayable
Constructs from an initial VisAD display.- Parameters:
display
- The VisAD display.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
CompositeDisplayable
Constructs from another instance. The Displayable-s and ConstantMap-s are copied from the other instance. The list of ListDataListener-s, however, is empty.- Parameters:
that
- The other instance.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
-
Method Details
-
addListDataListener
Adds a listener for list-data events.- Parameters:
listener
- The listener for list-data events.
-
removeListDataListener
Removes a listener for list-data events.- Parameters:
listener
- The listener for list-data events.
-
addDisplayable
Adds a Displayable to the composite.- Parameters:
displayable
- The Displayable to be added.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.- See Also:
-
setDisplayable
public void setDisplayable(int index, Displayable displayable) throws RemoteException, VisADException Sets a Displayable of the composite. The Displayable will receive the ConstantMap-s associated with this instance. The ScalarMap-s of the Displayable will be added to this instance. The "visible" property of the Displayable will be unaffected.- Parameters:
index
- The index of the Displayable.displayable
- The Displayable to be added.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
getDisplayable
Gets a Displayable of the composite.- Parameters:
index
- The position that contains the Displayable. Must be non-negative and less than the number of Displayable-s.- Returns:
- The
Displayable
at the given position. - Throws:
IndexOutOfBoundsException
- Invalid index.
-
removeDisplayable
Removes a Displayable from the composite.- Parameters:
displayable
- The Displayable to be removed.- Returns:
true
if and only if this composite contained the specified Displayable.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
destroy
Called when the displayable is removed from a display master- Overrides:
destroy
in classDisplayable
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
removeDisplayable
Removes a Displayable from the composite.- Parameters:
index
- The index of the displayable to be removed.- Returns:
- The given Displayable.
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
iterator
Obtains an Iterator over the children of this composite.- Returns:
- An Iterator over the children of this composite.
-
setDisplay
Sets the associated VisAD display.- Overrides:
setDisplay
in classDisplayable
- Parameters:
display
- The associated VisAD display.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.- See Also:
-
setDisplayMaster
_more_- Overrides:
setDisplayMaster
in classDisplayable
- Parameters:
master
- _more_- Throws:
RemoteException
- _more_VisADException
- _more_
-
myAddDataReferences
Adds DataReference-s to the associated display.- Specified by:
myAddDataReferences
in classDisplayable
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
myRemoveDataReferences
Removes this instance's DataReference-s from the associated VisAD display.- Specified by:
myRemoveDataReferences
in classDisplayable
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
addConstantMap
Associates a ConstantMap with this Displayable.- Overrides:
addConstantMap
in classDisplayable
- Parameters:
map
- A ConstantMap to be associated with this Displayable.- Returns:
- The ConstantMap (as a convenience).
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
debug
public void debug()_more_ -
setVisible
Sets the visibility of this Displayable.- Overrides:
setVisible
in classDisplayable
- Parameters:
visible
- Iftrue
and this composite'saddScalarMaps()
andaddDataReferences()
methods have been invoked, then the composite will be made visible; otherwise, iffalse
, then it is or will become invisible.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setManipulable
Sets the manipulable value of this Displayable.- Overrides:
setManipulable
in classDisplayable
- Parameters:
manipulable
- value- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setVisible
public void setVisible(boolean visible, int lowerIndex, int upperIndex) throws RemoteException, VisADException Sets the visibility of an interval of children.- Parameters:
visible
- Whether or not to display the interval of children.lowerIndex
- The lower index of the interval.upperIndex
- The upper index of the interval.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
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.
-
setConstantPosition
public void setConstantPosition(double value, DisplayRealType type) throws VisADException, RemoteException Set the z position to given value- Overrides:
setConstantPosition
in classDisplayable
- Parameters:
value
- The valuetype
- The type- Throws:
RemoteException
- On badnessVisADException
- On badness
-
toFront
Brings all the children to front.- Overrides:
toFront
in classDisplayable
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setColor
Sets the color of the children- Overrides:
setColor
in classDisplayable
- Parameters:
c
- The color.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setUseTimesInAnimation
Set the UseTimesInAnimation property.- Overrides:
setUseTimesInAnimation
in classDisplayable
- Parameters:
value
- The new value for UseTimesInAnimation- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setAdjustFlow
Sets whether flows are adjusted. Used by displays that don't support this.- Overrides:
setAdjustFlow
in classDisplayable
- Parameters:
adjust
- true to adjust- Throws:
RemoteException
- Java RMI failure.VisADException
- VisAD failure.
-
setDisplayUnit
Sets the unit on all contained children.- Overrides:
setDisplayUnit
in classDisplayable
- Parameters:
unit
- The display unit to use.- Throws:
VisADException
- if a VisADFailure occurs.RemoteException
- if a Java RMI failure occurs.
-
setSelectedRange
Set the range of the selected data on each of the children displayables.- Overrides:
setSelectedRange
in classDisplayable
- Parameters:
low
- The minimum value of the selected rangehi
- The maximum value of the selected range- Throws:
VisADException
- if a VisADFailure occurs.RemoteException
- if a Java RMI failure occurs.
-
setColorUnit
Sets the unit to be used for colors on all contained children- Overrides:
setColorUnit
in classDisplayable
- Parameters:
unit
- The display unit to use.- Throws:
RemoteException
VisADException
-
setPointSize
Sets the point size of the children- Overrides:
setPointSize
in classDisplayable
- Parameters:
size
- size (pixels)- Throws:
RemoteException
VisADException
-
setLineWidth
Sets the line width of the children. Calls setLineWidth on each child- Overrides:
setLineWidth
in classDisplayable
- Parameters:
width
- width for children (pixels)- Throws:
RemoteException
VisADException
-
setColorPalette
Sets the color table of the children. Calls setColorPalette on each child- Overrides:
setColorPalette
in classDisplayable
- Parameters:
c
- color palette- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setVisible
Sets the visibility of an individual child.- Parameters:
visible
- Whether or not to display theindex
- The index of the child.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
clearDisplayables
Removes all displayables from this composite -- causing them to be removed from the VisAD display.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
destroyAll
_more_- Throws:
RemoteException
- _more_VisADException
- _more_
-
lastDisplayable
Obtains the last displayable added to this composite.- Returns:
- The last Displayable added to this composite.
-
displayableCount
public int displayableCount()Gets the current number of displayables.- Returns:
- The current number of Displayable-s in this composite.
-
indexOf
Gets the index of the particular Displayable. If theDisplayable
doesn't exist, then-1
is returned.- Parameters:
displayable
- TheDisplayable
to have its index returned.- Returns:
- The index of the Displayable in this composite or -1.
-
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
- _more_- 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:
-
cloneForDisplay
Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.- Specified by:
cloneForDisplay
in classDisplayable
- Returns:
- A semi-deep clone of this instance.
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
fireListDataContentsChanged
protected void fireListDataContentsChanged(int index0, int index1) Invokes the contentsChanged() method of all registered ListDataListener-s.- Parameters:
index0
- The lower index of the range.index1
- The upper index of the range.
-
fireListDataIntervalAdded
protected void fireListDataIntervalAdded(int index0, int index1) Invokes the intervalAdded() method of all registered ListDataListener-s.- Parameters:
index0
- The lower index of the range.index1
- The upper index of the range.
-
fireListDataIntervalRemoved
protected void fireListDataIntervalRemoved(int index0, int index1) Invokes the intervalRemoved() method of all registered ListDataListener-s.- Parameters:
index0
- The lower index of the range.index1
- The upper index of the range.
-
toString
Returns a string representation of this composite.
-