>When I load a data file into a spreadsheet cell, the input fileds such as
>latitude, longitude, etc are different per each file. Do you know which class
>I can find those fields that appear in the left column of the mapping dialog
>box called "Map From"? I'm looking for an array or some data structure that
>holds those fields so that I can map each input field to a corresponding
>Display type such as CylRadius that shows up in the "Map To" section of the
>mapping dialoge box.
MappingDialog extracts these ScalarTypes from the data's MathType.
Call BasicSSCell.getData to get the Data object, then call getType
on the Data, then parse the MathType it returns. MappingDialog does
this with a collection of recursive algorithms, but if you know
something about the structure of your MathType, you can probably
make some assumptions to simplify the process.
>I was trying to find a way to select multiple cells at once by pressing
>"Control" and selecting the desired cells with the mouse button. Would you
>recommend adding more fields in SpreadSheet.java like "CurX2" and "CurY2" to
>represent the 2nd cell that was selected by the user? And then add a method
>in SpreadSheet.java to handle 2 cells?
You'll need a more general solution to do multiple selection. My
first thought is to use a Vector to keep a list of which cells are
currently selected. Then you'd have to rewrite all the code that
affects the selected cell to instead go through that Vector and
apply changes to all selected cells.
This problem is much trickier than it appears at first, because you
have to make some decisions about how things behave when multiple
cells are selected. For example, you'd probably need to display
"[Multiple cells selected]" or something in the formula bar when a
multiple selection exists. If the dimensionalities of the selected
cells do not match, you'd need to use a fuzzy gray checkbox in the
cell menu to represent that fact. You'd need to arbitrarily pick a
cell for adding new data when the user types something in the
formula bar. You'd probably have to disable the Cut, Copy and Paste
features when a multiple selection exists. Overall, multiple
selection support represents significant work, with little to no
added functionality or convenience, which is why I never added it.
>And when I set up my array holding all the possible "Map To" fields that
>show up in the mapping dialog when you run the program, I counted 44
>different fields in the "Map To" section but in MappingDialog.java, there
>are 50 different entries for MapNames and MapTypes. Why don't the 6
>extra fields like "Hue" and "Saturation" appear in the dialog box?
Hue and Saturation actually *do* appear in the MappingDialog. They
are labeled "H" and "S", respectively. However, there are six types
that are not represented in that graphic. These are types that were
added to VisAD after I designed the MappingDialog graphic, and thus
they are not included. Actually, I did redesign the graphic once to
incorporate some new types we added, but those latest six were
added after the first redesign.