Re: [OpenMap Users] How do I repaint() a single layer on the map?

From: Carsten Ø. Madsen <com_at_navicon.dk>
Date: Wed, 27 Feb 2008 15:23:13 +0100

Use

myLayer.background=true

in your props file on the "static" layers

/**
     * Property 'background' to designate this layer as a background
     * layer, which will cause extra buffering to occur if the
     * application can handle it. False by default.
     */
    public static final String AddAsBackgroundProperty = "background";

or use (Layer.java)

 /**
     * Mark the layer as one that should be considered a background
     * layer. What that means is up to the MapBean or application.
     */
    public void setAddAsBackground(boolean set) {
        addAsBackground = set;
    }

on the static layers. In combination with a buffered map bean this
should stop repaint from being called on the layers marked as background
as long as the projection stays the same between repaints.

BR
Carsten


Davidian wrote:
> I've tried calling doPrepare() rather than repaint(), but the behavior
> is the same. I think I've tracked down /why/ all of the layers are
> repainting each time, but I'm can't see a way to fix it.
>
> It looks like when repaint() is called on a class that extends
> com.bbn.openmap.Layer that that Layer is then passed to the
> *repaint(Layer layer)*. This method then passes the Layer to the
> repaint(Layer layer) method of th /StandardMapBeanRepaintPolicy
> /class, which then just calls the plain repaint() method (no
> parameters) of the MapBean class.
>
> Since MapBean is a JComponent, I think it probably just calls
> repaint() on all of it's children. I could be wrong, but this is my
> guess.
>
> So, the question is, how do I stop this from happening? :) Overriding
> the repaint(Layer layer) method of the StandardMapBeanRepaintPolicy
> doesn't seem like it will work because: what would I call there? You
> can't call repaint() on the Layer because it will just loop back
> around infinitely.
>
> Still looking for ideas...
>
> Thanks,
>
> Kennedy
>
> ------------------------------------------------------------------------
> View this message in context: Re: How do I repaint() a single layer on
> the map?
> <http://www.nabble.com/How-do-I-repaint%28%29-a-single-layer-on-the-map--tp15663314p15713622.html>
> Sent from the OpenMap mailing list archive
> <http://www.nabble.com/OpenMap-f16955.html> at Nabble.com.

--
[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 Wed Feb 27 2008 - 09:25:26 EST

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