Re: [OpenMap Users] Animation in two separate layers.

From: Don Dietrick <dietrick_at_bbn.com>
Date: Mon, 11 Feb 2008 14:19:41 -0500

Hi Jay,

I'd also try calling prepare() in the thread updating a particular
layer, instead of calling doPrepare(). Then, I'd call repaint() on
the MapBean on some time interval, independent of the layer updates.

In addition to calling prepare(), you'll have to call
setList(OMGraphicList) with the list prepare() returns. Also, you'll
want to create a new OMGraphicList object to return from prepare().
This will get a current OMGraphicList in the layer whenever paint() is
called on it, so if paint() is called on the layer when the update
thread is working on the list, the old list will still get painted.

Hope this helps,

Don


On Feb 11, 2008, at 1:48 PM, Carsten Ø. Madsen wrote:

> Hi
>
> I would guess that the two layers needs to be synchronized animation
> wise somehow to eliminate the flickering. Maybe a time since last
> animation could be used to avoid that one layer (bottom) finishing a
> redraw triggers a redraw of the top layer. The default doPrepare
> will kick off two threads and if the bottom layer finishes before
> the top layer this will cause the thread preparing the top layer to
> be canceled (and vice versa) and new thread will be kicked off this
> all depends on the timing between the two layers.
>
> An alternative is to implement a new policy http://www.openmap.org/doc/api/com/bbn/openmap/layer/policy/package-summary.html
> or perhaps try
> using the single threaded StandardRenderPolicy.
>
> BR
> Carsten
>
> Jay D. Askren wrote:
>>
>> I am doing some animation in two open map layers. Both layers
>> extend OMGraphicHandlerLayer. I set the background=true on all non-
>> animation layers. The animation seems to work great if I only add
>> one of these layers to the map. If I try to add both layers to the
>> map, the map flickers every single time step. I noticed if I just
>> comment out doPrepare() on one of the layers, the flicker goes
>> away, but of course that layer stops animating. It appears to be a
>> problem when I call doPrepare from two different layers in the time
>> step. Has anyone else seen this problem? Any ideas of how to fix
>> it? Thanks.
>>
>>
>>
>> Jay
>>
>>
>>
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Feb 11 2008 - 14:20:13 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT