NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: setting constant map properties

Hi Jim,

It will probably be easiest if you save your DataReferences
in your own arrays or Vectors. You can remove them from the
DisplayImpl by a call to removeReference(), then add again
with the new ConstantMap values.

Some of the other folks on the list have written complex
applications that may do something like this - perhaps they
can add to this?

Good luck,
Bill

On Fri, 12 Dec 2003, Jim Cookas wrote:

> hello
>
> 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 pleased...here 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 file
>
> 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 class...in 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 display...here 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 
> reference...is 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!
>
> jc
>
>


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