Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] notify if layer was added/removed

Sorry for the short answer, but: couldn't you use an interceptor for
trapping this kind of things?
There should be a layer added and removed one I think?

Ciao
Andrea


On Tue, Dec 14, 2010 at 11:57 AM,  <konfri@xxxxxx> wrote:
> Hey Jody,
>
> I'm adding the compositionListener to the map at the end of my createPartControl method. The upcoming process clears the map - this just happens if my view is shown on start up. I would guess, that this behavior is somehow related to the start up order of my views.
>
> Anyway, I'm adding my compositionListener instance each time the user performs a task (the map container is a set, so it does not keep duplicates).
>
> Thanks for your time.
>
> Kon
>
>
> -------- Original-Nachricht --------
>> Datum: Tue, 14 Dec 2010 12:20:34 +1000
>> Von: Jody Garnett <jody.garnett@xxxxxxxxx>
>> An: User-friendly Desktop Internet GIS <udig-devel@xxxxxxxxxxxxxxxxxxxxx>
>> Betreff: Re: [udig-devel] notify if layer was added/removed
>
>> Not sure; try going further down that page where the EMF notification
>> event system allows you access to everything.
>>
>> If you can step through the code where the IMapCompositionListener is
>> called; perhaps you can tell us where it is being missed?
>>
>> Jody
>>
>> On 14/12/2010, at 2:39 AM, konfri@xxxxxx wrote:
>>
>> > Hey,
>> >
>> > I need to perform some task if a layer was added/removed. For that, I
>> found this code snipped on
>> http://www.refractions.net:8080/confluence/display/DEV/How+to+tell+when+something+changes:
>> >
>> > ApplicationGIS.getActiveMap().addMapCompositionListener(new
>> IMapCompositionListener(){
>> >    public void changed( MapCompositionEvent event ) {
>> >        System.out.println("changed");
>> >
>> >        if (event.getType() == EventType.ADDED) {
>> >            System.out.println("Layer added");
>> >        } else if (event.getType() == EventType.REMOVED) {
>> >            System.out.println("Layer removed");
>> >        }
>> >        //..
>> >    }
>> > });
>> >
>> > Unfortunately, it is never trigged. Is there something wrong or
>> outdated? Thank you!
>> >
>> > Kon
>> > --
>> > Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
>> > Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
>> > _______________________________________________
>> > User-friendly Desktop Internet GIS (uDig)
>> > http://udig.refractions.net
>> > http://lists.refractions.net/mailman/listinfo/udig-devel
>>
>> _______________________________________________
>> User-friendly Desktop Internet GIS (uDig)
>> http://udig.refractions.net
>> http://lists.refractions.net/mailman/listinfo/udig-devel
>
> --
> GRATIS! Movie-FLAT mit über 300 Videos.
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>


Back to the top