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_protectedConstructs from another instance.CompositeDisplayable(LocalDisplay display) Constructs from an initial VisAD display. -
Method Summary
Modifier and TypeMethodDescriptionAssociates a ConstantMap with this Displayable.voidaddDisplayable(Displayable displayable) Adds a Displayable to the composite.voidaddListDataListener(ListDataListener listener) Adds a listener for list-data events.voidRemoves 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.voiddebug()_more_protected voiddestroy()Called when the displayable is removed from a display mastervoid_more_intGets the current number of displayables.protected voidfireListDataContentsChanged(int index0, int index1) Invokes the contentsChanged() method of all registered ListDataListener-s.protected voidfireListDataIntervalAdded(int index0, int index1) Invokes the intervalAdded() method of all registered ListDataListener-s.protected voidfireListDataIntervalRemoved(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 givenaniTypeif the contained Data object adapted by thisDisplayableDatahave any data of that type.getDisplayable(int index) Gets a Displayable of the composite.intindexOf(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 voidAdds DataReference-s to the associated display.protected final voidRemoves this instance's DataReference-s from the associated VisAD display.removeDisplayable(int index) Removes a Displayable from the composite.booleanremoveDisplayable(Displayable displayable) Removes a Displayable from the composite.voidremoveListDataListener(ListDataListener listener) Removes a listener for list-data events.voidsetAdjustFlow(boolean adjust) Sets whether flows are adjusted.voidSets the color of the childrenvoidsetColorPalette(float[][] c) Sets the color table of the children.voidsetColorUnit(Unit unit) Sets the unit to be used for colors on all contained childrenvoidsetConstantPosition(double value, DisplayRealType type) Set the z position to given valuevoidsetDisplay(LocalDisplay display) Sets the associated VisAD display.voidsetDisplayable(int index, Displayable displayable) Sets a Displayable of the composite.protected voidsetDisplayMaster(DisplayMaster master) _more_voidsetDisplayUnit(Unit unit) Sets the unit on all contained children.voidsetLineWidth(float width) Sets the line width of the children.voidsetManipulable(boolean manipulable) Sets the manipulable value of this Displayable.voidsetPointMode(boolean usePoints) Set the flags for whether the Displayable displays data as points.voidsetPointSize(float size) Sets the point size of the childrenvoidsetSelectedRange(double low, double hi) Set the range of the selected data on each of the children displayables.voidsetUseFastRendering(boolean fastRender) Set the flags for whether the Displayable uses it's methods to render quickly (eg, not account for projection seams).voidsetUseTimesInAnimation(boolean value) Set the UseTimesInAnimation property.voidsetVisible(boolean visible) Sets the visibility of this Displayable.voidsetVisible(boolean visible, int index) Sets the visibility of an individual child.voidsetVisible(boolean visible, int lowerIndex, int upperIndex) Sets the visibility of an interval of children.voidtoFront()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
Displayableat the given position. - Throws:
IndexOutOfBoundsException- Invalid index.
-
removeDisplayable
Removes a Displayable from the composite.- Parameters:
displayable- The Displayable to be removed.- Returns:
trueif 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:
destroyin 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:
setDisplayin classDisplayable- Parameters:
display- The associated VisAD display.- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.- See Also:
-
setDisplayMaster
_more_- Overrides:
setDisplayMasterin classDisplayable- Parameters:
master- _more_- Throws:
RemoteException- _more_VisADException- _more_
-
myAddDataReferences
Adds DataReference-s to the associated display.- Specified by:
myAddDataReferencesin classDisplayable- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
myRemoveDataReferences
Removes this instance's DataReference-s from the associated VisAD display.- Specified by:
myRemoveDataReferencesin classDisplayable- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
addConstantMap
Associates a ConstantMap with this Displayable.- Overrides:
addConstantMapin 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:
setVisiblein classDisplayable- Parameters:
visible- Iftrueand 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:
setManipulablein 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:
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.
-
setConstantPosition
public void setConstantPosition(double value, DisplayRealType type) throws VisADException, RemoteException Set the z position to given value- Overrides:
setConstantPositionin classDisplayable- Parameters:
value- The valuetype- The type- Throws:
RemoteException- On badnessVisADException- On badness
-
toFront
Brings all the children to front.- Overrides:
toFrontin classDisplayable- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
setColor
Sets the color of the children- Overrides:
setColorin classDisplayable- Parameters:
c- The color.- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
setUseTimesInAnimation
Set the UseTimesInAnimation property.- Overrides:
setUseTimesInAnimationin 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:
setAdjustFlowin classDisplayable- Parameters:
adjust- true to adjust- Throws:
RemoteException- Java RMI failure.VisADException- VisAD failure.
-
setDisplayUnit
Sets the unit on all contained children.- Overrides:
setDisplayUnitin 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:
setSelectedRangein 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:
setColorUnitin classDisplayable- Parameters:
unit- The display unit to use.- Throws:
RemoteExceptionVisADException
-
setPointSize
Sets the point size of the children- Overrides:
setPointSizein classDisplayable- Parameters:
size- size (pixels)- Throws:
RemoteExceptionVisADException
-
setLineWidth
Sets the line width of the children. Calls setLineWidth on each child- Overrides:
setLineWidthin classDisplayable- Parameters:
width- width for children (pixels)- Throws:
RemoteExceptionVisADException
-
setColorPalette
Sets the color table of the children. Calls setColorPalette on each child- Overrides:
setColorPalettein 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 theDisplayabledoesn't exist, then-1is returned.- Parameters:
displayable- TheDisplayableto have its index returned.- Returns:
- The index of the Displayable in this composite or -1.
-
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- _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:
cloneForDisplayin 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.
-