Re: [OpenMap Users] Firing my own LayerEvent?

From: Don Dietrick <dietrick@bbn.com>
Date: Tue Jan 13 2004 - 19:15:07 EST

Hi Adrian,

I think I'd just get the LayerHandler and add the layer you want to it,
with it's visibility set to true. The rest should just happen. If the
layer is already part of the LayerHandler, I'd call
LayerHandler.turnLayerOn(true, layer);

- Don

On Jan 13, 2004, at 6:07 PM, Adrian Lumsden wrote:

> Hello,
>
> I use a custom mouse mode to manage multiple layers of the same class
> only
> one of which is active (receiving mouse events) at any one time.
>
> The mouse mode picks up the right click and uses that to show a popup
> menu
> with it's items corresponding to the layers managed by that mouse mode.
>
> When the user selects a new layer to activate I want to issue a
> LayerEvent
> to notify all listeners with a setLayers() method of the change.
>
> My first attempt was:
>
> Layer[] layers = niApp.getMapFrame().getLayers(); // Get
> all
> the layers
> LayerSupport ls = new LayerSupport(this); //
> Create
> support
> ls.fireLayer(LayerEvent.ADD, layers); // Send
> out a layer event
>
> This doesn't work because the new LayerSupport instance has no
> registered
> listeners and the fire() method does nothing (Except ignore the
> request).
>
> I assume that the MapBean/LayerHandler etc has it's own instance of
> LayerSupport and that is the one that I need to call to fire() my
> event. I
> can't see a way of getting hold of that LayerSupport nor the list of
> LayerListeners.
>
> Any suggestions as to how I might work around this problem?
>
>
> with regards,
>
> Adrian
>
> _____________________________________________
>
> Dr. Adrian Lumsden
> Product Specialist
> Scientific Software and Systems Limited
>
> Tel: +64 4 917-6680 (direct)
> +64 4 917-6670 (reception)
> Fax: +64 4 917-6671
> E-mail: Adrian.Lumsden@spamhole.sss.co.nz
>
> Visit us on the Web at: http://www.sss.co.nz
> _____________________________________________
>
> This e-mail passed SSS's content security scan.
> It is covered by the confidentiality clauses at
> http://www.sss.co.nz/content_and_confidentiality
>
> --
> [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"]
>

--
[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 Tue Jan 13 19:17:20 2004

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