Hi Curtis, You're right, I forgot to mention the fact that I added 1 variable "myMappings" in SpreadSheet.java which was an array of ScalarMaps. Before, the additions I made to SpreadSheet.java was (1) the method loadMyDataSet(), (2) "myMappings" array, and (3) one line that created a "GO" button shown below: //public ScalarMap[] myMappings = new ScalarMap[4]; addToolbarButton("GO", "Open small.v5d", "loadMyDataSet", true, Toolbar) /** * Calls loadMyDataSet in Go.java where file is loaded. */ public void loadMyDataSet() { try { System.out.println("In SpreadSheet, loadMyDataSet(), and in try clause"); BasicSSCell testCell = new BasicSSCell("testCell"); VisadAPI mine = new VisadAPI(this, testCell); System.out.println("this: " + this); System.out.println("BasicSSCell: " + testCell); //VisadAPI.loadMyDataSet(); mine.loadMyDataSet(); } catch (VisADException exc) { System.out.println("VisAD Exception in SS. Could not load file small.v5d into the SpreadSheet"); } catch (RemoteException exc) { System.out.println("Visad Exception in SS. Could not load file small.v5d into spreadsheet"); } System.out.println("exited normally"); } Now SpreadSheet.java only has 2 additions. I took out the "myMappings" array because it wasn't need. And I instead just used the line you recommended in VisadAPI.java: myBasicSS.setMaps(new ScalarMap[] {Alt_rad, Alt_green, Lat_blue, Long_red}); 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? Attached is VisadAPI.java and the only 2 changes I added to SpreadSheet.java was that one method and the "GO" button. 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 2:21 PM To: Kam, Michelle C Subject: RE: your mail Hi Michelle, I couldn't get your code to compile. I received errors such as: VisadAPI.java:43: cannot resolve symbol symbol : method myAutoDetect (boolean) location: class visad.ss.SpreadSheet mySS.myAutoDetect(false); ^ VisadAPI.java:54: cannot resolve symbol symbol : variable myMappings location: class visad.ss.SpreadSheet myBasicSS.setMaps(mySS.myMappings); ^ This suggests you made additional modifications to the SpreadSheet that you did not pass along in email. So, I can't test your changes to determine if setMaps() has a bug. Why are you playing around with variables like "myMappings"? You shouldn't need to add any additional fields to the SpreadSheet, or to BasicSSCell. All you need to do is call myBasicSS.setMaps with those ScalarMaps you construct in your VisadAPI.setMappings() method: myBasicSS.setMaps(new ScalarMap[] {Alt_rad, Alt_green, Lat_blue, Long_red}); If that doesn't work, and you think the SpreadSheet has a bug, please send me a test case demonstrating the problem and I'll look into it. Thanks, Curtis At 03:55 PM 6/11/2003, Kam, Michelle C wrote: >Hi, > >Attached below is my VisadAPI.java file that loads in small.v5d and sets up >the mappings. It compiles fine. It also runs without errors. But the default >mappings that I specified do not appear. Would someone be able to tell if I >passed the array myMappings correctly to BasicSSCell's setMaps method? > > From SpreadSheet.java: >public void loadMyDataSet() { > > try { > System.out.println("In SpreadSheet, loadMyDataSet(), and in try >clause"); > VisadAPI mine = new VisadAPI(this, new >BasicSSCell("testCell")); > System.out.println("this: " + this); > //VisadAPI.loadMyDataSet(); > mine.loadMyDataSet(); > } > catch (VisADException exc) { > System.out.println("VisAD Exception in SS. Could not load file >small.v5d into the SpreadSheet"); >} > catch (RemoteException exc) { > System.out.println("Visad Exception in SS. Could not load file >small.v5d into spreadsheet"); >} > >System.out.println("exited normally"); >} > >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: Tuesday, June 10, 2003 5:44 PM >To: Kam, Michelle C >Cc: visad-list@xxxxxxxxxxxxx >Subject: RE: your mail > > >Hi Michelle, > >Somewhere, you are calling BasicSSCell.addDataSource(). >Wherever you are doing that, whether by hacking SpreadSheet.java >in your own extension of the SpreadSheet, or some other solution, >that same method can contain the call to BasicSSCell.setMaps() >immediately afterward. > >Swells.java does not use the SpreadSheet; it just uses the >general VisAD functionality. If you want a SpreadSheet cell to >use certain mappings, call BasicSSCell.setMaps(). If you just >want a normal VisAD display (i.e., not a SpreadSheet cell), then >feel free to use DisplayImpl.addMap() repeatedly to add the maps. > >-Curtis > >At 06:13 PM 6/10/2003, Kam, Michelle C wrote: >>Hi Curtis, >> >>Ok so from my understanding, if I want to change the default mappings that >>first appear or overwrite the default mappings when loading a file, I would >>have to create a new class which creates the array of ScalarMap's and adds >>them to the display such as with a call to display.addMap(someMap)? >> >> >>Also, I was looking at Swells.java as an example, and they don't call >>BasicSSCell.setMaps() from within that class so do you recommend trying to >>call it from my own subclass? >> >>Thanks, >>Michelle
Attachment:
VisadAPI.java
Description: Binary data
visad
archives: