[idvdevelopers] failure attempting use of Displayable.cloneForDisplay

I am trying to use IDV classes in a servlet environment, rendering 
BufferedImages (offscreen mode) for return to a web browser.

If I have a single Displayable, in my case a Contour2DDisplayable, and I attempt to add it directly to two different DisplayMasters (one for each web 'user') I get an error:

2007-08-09 16:21:39,274 23078 ERROR  - visad.DisplayException: 
ScalarMap.setDisplay: ScalarMap cannot belong to two Displays
visad.DisplayException: ScalarMap.setDisplay: ScalarMap cannot belong to two 
Displays
        at visad.ScalarMap.setDisplay(ScalarMap.java:393)
        at visad.DisplayImpl.addMap(DisplayImpl.java:1926)
        at visad.DisplayImpl.addMap(DisplayImpl.java:1866)
        at 
ucar.visad.display.DisplayMaster.addScalarMaps(DisplayMaster.java:1778)
        at ucar.visad.display.DisplayMaster.rebuild(DisplayMaster.java:605)
        at 
ucar.visad.display.DisplayMaster.rebuildDisplay(DisplayMaster.java:578)
        at ucar.visad.display.DisplayMaster.setActive(DisplayMaster.java:1956)
        at ucar.visad.display.DisplayMaster.draw(DisplayMaster.java:1481)

But if I try to use the Contour2DDisplayable.cloneForDisplay() method to work around this, I get no image from the DisplayMaster.getImage call, it just hangs.

In I test in onscreen mode, I note that the use of cloneForDisplay means I 
never see the data in the Jframe.

It's as though the clone is only partial??

Any help gratefully appreciated.

BTW, in the IDV, do you recreate copies of Displayable 'from scratch' as it 
were, or use the clone technique??

Stuart Maclean



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