setting constant map properties


i am currently developing a line/image plotting application for radar analysis 
using visad...i am relatively new to the package, but thus far i have been 
quite is my problem:

basically i want to allow the user change various properties of each line that 
is currently displayed in the plot...i have created my own java widgets for 
this and they control color, width, and style...i add each data set to the 
display like this (the data is added with default display properties to be 
changed later by the user):

dataRef = new DataReferenceImpl("dataRef");  // dataRef is local
dataRef.setData(field);  // 'field' (local) is populated with data from a text 

ConstantMap[] lineCMap = {
        new ConstantMap(redVal, Display.Red),
        new ConstantMap(greenVal, Display.Green),
        new ConstantMap(blueVal, Display.Blue),
        new ConstantMap(GraphicsModeControl.SOLID_STYLE, Display.LineStyle),
        new ConstantMap(1.0f, Display.LineWidth) };

_display.addReference(dataRef, lineCMap);  // '_display' is a member of my 
plotter class

i am not storing the data references anywhere else in the theory, i 
thought i could grab the data reference i need from the _display, change the 
constant maps (according to user-specified values), and pass it back to the is some pseudo-code:

void listener() {
        // get appropriate data reference from _display

        // create new constant maps with user-specified values

        // swap out the old data reference (and old constant maps) with new 
data reference (and new constant maps)

the other idea was maybe to replace the constant maps for the requested data this possible?...i cannot seem to figure out how to do this...i 
have read documentation everywhere and looked at many examples...

many thanks in advance for any help!


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: