[OpenMap Users] Firing my own LayerEvent?

From: Adrian Lumsden <Adrian.Lumsden@sss.co.nz>
Date: Tue Jan 13 2004 - 18:07:02 EST

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"]
Received on Tue Jan 13 19:06:22 2004

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