Leah-
Leah Foechterle wrote:
I tried that earlier and ran into a problem. I am constantly
changing the data displayed by my application. When I change
the data I removeAllReferences() from my display, reset the
data and re-add the references. If I add a constant map in
addReference(), the second time I add the reference I get
an exception saying that I can't add the same constant map
twice. But, if I don't add a constant map, the data is
displayed as though a constant map isn't there at all.
Do you need to remove all data references? Is the data
(and associated ScalarTypes) changing? If not, then could
you just call DataReference.setData() with the new Data?
If so, the ConstantMaps will stay in place. Only the
data is changing.
If the ScalarTypes keep changing, could you have something
like:
DataReference myRef = new DataReferenceImpl("place holder");
<set up scalarMaps>
<read in new data>
myRef.setData(<new data>);
display.addReference(myRef, ConstantMap[] <array>);
<read in new Data>
for (int i = 0; i < oldMaps; i++) {
display.removeMap(<oldScalarMap>);
}
<add in any new ScalarMaps>
myRef.setData(<new Data>);
I looked through the visad/example code. The closest
example creates a new display and then adds all the scalar
and constant maps. I'd prefer not to create a new display
everytime I change the data.
A change was made recently where you can add and remove
ScalarMaps at will. See visad/examples/HSVDisplay.java.
How can I get around this?
Don
*************************************************************
Don Murray UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx P.O. Box 3000
(303) 497-8628 Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************