Re: [OpenMap Users] best way to access a layer handler and repaint updated data?

From: Don Dietrick <dietrick@bbn.com>
Date: Thu Mar 20 2003 - 20:31:50 EST

Hi Ed,

I think you want to use the MapHandler to find the LayerHandler, and
then get the layers from that to find your layers. Unless your layers
are set to be added to the MapHandler when they are created (and that
doesn't happen by default), they will not be in the MapHandler.

        LayerHandler lh =
this.ourMap.getmBeanHandler().get("com.bbn.openmap.LayerHandler");

        Layer[] layers = lh.getLayers();

etc.

Hope this helps,

Don

On Tuesday, March 18, 2003, at 01:27 PM, Ed MacKerrow wrote:

> I have added some layers that ultimately extend LocationLayer.  I am
> using a modified version of the OpenMap application, that uses a
> Properties file to load layers and associate handlers with those
> layers.
>  
> I would like to "refresh" some of the objects and OMGraphics that are
> on these layers of mine.  Currently I am trying to gain access to
> these layer "handlers" in the following way:
>  
>        
>         Iterator it = this.ourMap.getmBeanHandler().iterator();
>         while ( it.hasNext() ) {
>             Object obj = it.next();
>             if ( obj instanceof MyLocationLayer ) {
>  
>                 ( ( MyLocationLayer ) obj ).doPrepare();
>                 ( ( MyLocationLayer ) obj ).repaint();
>              }
>         }
> When I do this the map does not show any visible change of state. 
> Note that I am really NOT getting the handler to my layer here, and my
> guess is that is the problem, but I have yet to figure out how to get
> the handler...
>  
> Any suggestions would be greatly appreciated,
>  
> Thanks in advance,
>  
> ed
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Edward P. MacKerrow
> Theoretical Division, T-13, Complex Systems Group
> Mail Stop - B213 Los Alamos National Laboratory
> Los Alamos, NM  87545
> (505) 665-3491 (office)
> (505) 603-0352 (cell)
> (505) 665 - 3003 (fax)
> mackerrow@lanl.gov
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>  
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Mar 20 23:10:04 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:35 EDT