Re: Variable Winds

Hi Bill,

Thanks, that works as you describe. It's interesting to note that I can break this by specifying a font, eg:
  Font txtfont = new Font("Arial", Font.PLAIN, 4);
  tcontrol.setFont(txtfont);
Should I be able to do this?

I have a second question, which involves visad.bom.PickManipulationRendererJ3D.

The main routine in PMR nicely demonstrates how to detect that a user has clicked on a variety of visad data. This is done by:
* defining the data,
* making a DataReference to that data
* creating a CellImpl
* linking that CellImpl to the DataReference
* defining a doAction method in the CellImpl
* having code in the doAction which proves it works!
  eg "System.out.println("Real selected")

This works fine...
My problem is this: I'm also changing the data externally (eg in relation to the variable wind issue, the user presses "V" to toggle between two states, namely a variable wind and a not variable wind... this is changing the data which is linked to the PickManipulationRenderer).

I need to differentiate between the 2 cases of:
1) user has clicked on the data and
2) the data has been changed exernally.

Is there a way to do this?

Thanks in advance,

James

Bill Hibbard wrote:

Hi James,

Thanks for the recommendation. I've gone for option 2, but have run into
difficulty as described below.


Not exactly my recommendation (separate Data object and ScalarMap
to Shape), but good enough. You can fix the problem by adding:

 TextControl tcontrol = (TextControl) flows_text_map.getControl();
 tcontrol.setNumberFormat(new DecimalFormat());

after 'display.addMap(flows_text_map);', and 'import java.text.*;'
at the top. The default NumberFormat must deal with NaN incorrectly.
I attached a fixed version of your code.

Cheers,
Bill





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