RE: setMaps()?

>I also want to emphasize what Bill said earlier--if you are sure you want
>this
>functionality within the context of the SpreadSheet, then you can continue
>along the path I described above, but if you don't need the SpreadSheet,
>then
>it would be easier to write a stand-alone VisAD application.

It would definitely be easier to write a stand-alone VisAD application but for 
the purposes of our interactive genetic algorithms project, we will need to 
use spreadsheets. If I can get the spreadsheet working, it will be used as a 
tool for the human to select his/her preferences among various representations 
of data. 
For example, 16 different ways of representing data will be layed out in 16 
cells. The user can use the mouse to click on the cells that "look the best" 
to them. The mappings in the chosen cells progress to the next generation of 
data representations and the same process is repeated.

So although it makes things more complex, I do need to work with the 
spreadsheet.

-Michelle Kam


>===== Original Message From "Kam, Michelle C" <michelle.c.kam@xxxxxxxx> ====
>Hi Curtis,
>
>Busy waiting for a data change didn't quite seem to work. I'm still seeing
>small.v5d loaded without any mappings at all.
>
>And you're right. I did have that other method in SpreadSheet.java called
>"myAutoDetect()" which I now removed since I wasn't using it. So your
>version of my SpreadSheet.java should be most up to date. Attached is my
>updated VisadAPI.java as well as SSCellListener since I had to import a
>couple packages in that class to have it compile. Do you know what could be
>causing this?
>
>Thanks,
>Michelle
>
>Michelle Kam           (408) 742-2881
>Lockheed Martin Space Systems Co. SSM/ATC/MSIS
>B/153 O/L922
>1111 Lockheed Martin Way, Sunnyvale, CA 94089
>
>
>
>
>-----Original Message-----
>From: Curtis Rueden [mailto:curtis@xxxxxxxxxxxxx]
>Sent: Thursday, June 12, 2003 5:12 PM
>To: Kam, Michelle C
>Cc: visad-list@xxxxxxxxxxxxx
>Subject: RE: setMaps()?
>
>
>Hi Michelle,
>
>>and making the appropriate modifications in VisadAPI.java. It still
>compiles
>>and runs. But I'm stuck in the same spot as before. When I run java -mx512m
>>visad.ss.SpreadSheet and a spreadsheet appears. I click on my "GO" button
>>and the small.v5d does not have my specified mappings. There are no
>mappings
>>at all under "Current Maps".
>>
>>Is there a problem with setMaps?
>
>First, you still have a line that calls "mySS.myAutoDetect(false)" which
>fails to compile on my machine.  I changed this line to
>"mySS.setAutoDetect(false)" and proceeded to investigate.
>
>The reason what you are doing doesn't work is that the SpreadSheet loads the
>data in the background (in a separate thread).  You are calling setMaps
>immediately after instructing the SpreadSheet to load some data, and thus
>the
>load is not yet complete when you call setMaps.
>
>I apologize for my bad advice of putting setMaps in the same method as
>addDataSource.  It turns out that won't work.  But I believe you can solve
>the
>problem by registering your VisadAPI as an SSCellListener, then listening
>for
>DATA_CHANGE events and setting the maps at that point.
>
>Just have your VisadAPI class implement SSCellListener, add a method:
>    "public void ssCellChanged(SSCellChangeEvent e)"
>and in that method, if "e.getChangeType() == SSCellChangeEvent.DATA_CHANGE",
>then call your setCurrentMaps method at that point.  You may also want to
>perform some additional checks, to ensure that it is your small.v5d data
>source that was added, rather than some other data, or a data clear
>operation.
>
>I also want to emphasize what Bill said earlier--if you are sure you want
>this
>functionality within the context of the SpreadSheet, then you can continue
>along the path I described above, but if you don't need the SpreadSheet,
>then
>it would be easier to write a stand-alone VisAD application.
>
>>On another note, after reading Ugo's tutorial, I'm wondering if maybe I
>need
>>to add a Data Reference object after I created the mappings. Would that be
>>necessary to get the mappings to show up on the display?
>
>No, the SpreadSheet logic takes care of all that.  You'd only need to create
>DataReferences if you used the core VisAD API without SpreadSheet.
>
>-Curtis