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?
Michelle Kam (408) 742-2881
Lockheed Martin Space Systems Co. SSM/ATC/MSIS
1111 Lockheed Martin Way, Sunnyvale, CA 94089
From: Curtis Rueden [mailto:curtis@xxxxxxxxxxxxx]
Sent: Tuesday, June 10, 2003 2:33 PM
To: Kam, Michelle C
Subject: RE: your mail
First, I would call the SpreadSheet's setAutoDetect(false) method
to disable automatic mapping detection, since you are just going
to set up your own maps anyway.
Then you are going to construct an array of ScalarMaps, which you
will pass to BasicSSCell's setMaps() method, to define your maps.
An example of the ScalarMap constructor is:
ScalarMap map = new ScalarMap(rtype, Display.XAxis);
Where "rtype" is the RealType from your data's MathType that
identifies which aspect of your data you want mapped, and
Display.XAxis signifies a mapping to the display's X axis.
For example, if you have an image with MathType:
((x, y) -> (r, g, b))
a common set of mappings might be:
x -> Display.XAxis
y -> Display.YAxis
r -> Display.Red
g -> Display.Green
b -> Display.Blue
If you are confused, I suggest you check out Ugo Taddei's
VisAD tutorial at:
It will give you a rundown of VisAD basics such as MathTypes
At 04:21 PM 6/10/2003, you wrote:
>It turns out that I needed Java 3D to be re-installed on my computer to see
>the image in 3D!
>What I'm trying to do now is replace the current default mappings that come
>up when I first load small.v5d with my own mappings. I've been tracing
>through all this code and it looks like the data structure that holds the
>actual mappings is ScalarMaps?
>I looked through the classes you mentioned, but I was wondering where the
>actual mappings within ScalarMap are assigned. Or is it maps? I want to
>just copy that method (wherever it may be) and hard code a different set of
>mappings. But I'm having a hard time determining where that lies without
>getting sent from class to class within the visAD package.
>"The mapping dialog is brought up by a call to FancySSCell.addMapDialog().
>The ScalarMap array is created by MappingDialog when the "Done" button is
>clicked at MappingDialog.java:1125-1126. Then, FancySSCell.addMapDialog()
>takes that array and passes it to its setMapsAuto() method, which calls
>BasicSSCell.setMaps() after switching to the proper cell dimension for
>mappings (under the right conditions).
>The maps are actually added in BasicSSCell.setMaps() at BasicSSCell:1629."