Re: Visibility between layers and handlers and objects?

From: Don Dietrick <dietrick@bbn.com>
Date: Sat May 04 2002 - 10:00:26 EDT

Hi Ed,

Ideally, you should be able to use the MapHandler to get the
LocationHandler to hook up with your OMGraphic supplier. The
LocationLayer hasn't been updated to use the MapHandler yet, though.
I'm a little surprised that the LocationLayer has such restricted access
to it's handlers. That should probably be looked at again.

Anyway,

On Friday, May 3, 2002, at 11:38 PM, Ed MacKerrow wrote:

>
> Dear OpenMappers--
>
>
>
> I am trying to update some location (OMGraphic) objects on a map. The
> setup
> is as follows:
>
> 1. I invoke OpenMap, which uses the properties file to create a
> LocationLayer and a Handler for our objects
> 2. I then instantiate our OMGraphic objects in classes outside of the
> LocationLayer and Handlers.
> 3. I then want to get access to the Layer so that we can add our
> objects to
> the associated OMGraphicList -- a member of our LocationLayer

So you want to load the OMGraphicList objects to the LocationLayer, and
not the LocationHandler? If so, is there a particular reason you want
to use the LocationLayer (for the GUI or something)?

> Item 3 is what I cannot figure out. I know that I can go from the
> Handler
> to the Layer using the getLayer() method, but I don't know how to
> access the
> Handler (since the properties file and Open Map take care of that
> behind the
> scenes).
>
> Due to design reasons, I would prefer NOT to instantiate the OMGraphic
> objects inside the Handler.
>
> I guess, the bottom line is that I want to get to the OMGraphicsList
> object
> inside my LocationLayer from ANY object....

In this case, you can just add a addToBeanContext=true property in the
openmap.properties file for your LocationLayer. Your OMGraphicList
provider can use the MapHandler to look for it there, and use the
graphic list accessor methods.

The graphic list in the LocationLayer is actually a Vector, not a
OMGraphicList object. Just so you know.

Another approach would be to extend the LocationLayer so it uses the
MapHandler to find objects (Layer.findAndInit(Object)). Then, make the
object that is providing your OMGraphicList implement the
LocationHandler interface, plus some other empty interface that sets it
apart as an object that does something special for you, and add it to
the MapHandler as well.

The extended LocationLayer should use the MapHandler to look for your
special empty interface object.

- Don

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Sat May 4 10:01:50 2002

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