Re: [OpenMap Users] Flickering of OMPoly shapes

From: Don Dietrick <dietrick_at_bbn.com>
Date: Mon, 18 Dec 2006 15:58:22 -0500

Hi Alex,

The setNeedToRegenerate() method is an internal method that lets the
OMGraphic keep track of when certain settings have changed that would
make it's current screen location invalid. That method just sets a
flag, and your OMGraphic needs to be generated with the current
projection at this point. It's unclear when you are calling generate
on your polys, and this is important because that can be one of the
most expensive parts of the animation process.

I think the flickering is probably more the effect of a race
condition with other layers on the map. When the map projection
changes, all layers react to it and call repaint() on themselves when
they are ready. If no layers ever call repaint(), then the map won't
update. The Java AWT paint mechanism handles the paint ordering for
the layers, and a layer may get painted several times as a result of
a projection change - it depends on when the other layers are ready,
too.

The flickering effect usually happens when a layer on top calls
repaint() before one of the background layers is ready. The MapBean
obliges, paints the top layer because it's ready with just the
background color of the MapBean (the ocean color), and then paints
all of the layers when the bottom layer requests it. You can reduce
this effect by speeding up the bottom layers.

So, what kind of layers are you using?

- Don


On Dec 16, 2006, at 10:21 PM, Alex Yeo wrote:

> Hi,
>
> I have created an application that is able to animate a group of
> OMPoly shapes. Just for info, the shapes are subclasses of the
> OMPoly and overrides the setLocation method. In the overridden
> method, the setNeedToRegenerate invocation is removed. There is an
> Animation thread that calls the setNeedToRegenerate for all the
> shapes during each cycle. There is no flickering at this stage.
>
> The flickering only happens when the map centers on a specific
> shape during each animation cycle.
>
> I am at my wits end. Has anyone faced a similar situation?
>
> Cheers.
>
> Alex
>
> --
> [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 Dec 18 2006 - 15:59:28 EST

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