Re: Losing controlListeners when display is rebuilt

> I have an application that adds a ControlListerner to the
> ProjectionControl of a DisplayImpl.  This display gets
> rebuilt when I change my projections or add in ScalarMaps
> after some DataReferences are added.  I figured that
> as long as there is always one ProjectionControl associated
> with a DisplayImpl, that no matter what I did to the display,
> my listener would always be active.  However, it appears
> that when the display is rebuilt, all display listeners are
> removed and are not added back in when the ProjectionControl
> is added back (same for GraphicsModeControl and
> DisplayRendererControl).  So once the display is rebuilt,
> I have no way of using the controlListener to listen for
> ProjectionControl changes.  Is this a bug?  I've attached
> a program that exhibits this behavior.

Not a bug, just the way it works. The DisplayImpl.clearMaps()
call clears up everything (it is desireable to have a method
that clears up everything - the bug would be to find something
that is not cleared up). The work-around is to re-add the
ControlListerner after rebuilding the display.

Bill


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