Thanks for your quick answer.

It seems to me that a Filter is to get features. I may have no layer on the
map or only a raster layer, i just want to get the bbox produced when using
the tool.

 
Cheers,

DESPRES Damien
        
-----Message d'origine-----
De : [email protected]
[mailto:[email protected]] De la part de Aritz Dávila
Envoyé : mardi 17 février 2009 19:19
À : User-friendly Desktop Internet GIS
Objet : Re: [udig-devel] BBoxSelection Listener

Hi,

You have to create a layerListener:

                this.layerListener = new ILayerListener() {

                        public void refresh(LayerEvent event) {

                                updateLayerActions(event);
                        }
                };

Then on refresh event, catch the event.

with  ILayer modifiedLayer = event.getSource(); 
you get the layer that throws the event, and with LayerEvent.EventType type
= 
event.getType(); you should get the event type. Then on the case that the 
event is this type: FILTER, 
obtain the filter of the layer which is this : Filter newFilter = 
modifiedLayer.getFilter();

Cheers,
-- 
Aritz Dávila
www.axios.es


On Tuesday 17 February 2009 18:35:40 Despres wrote:
> Hi all,
>
>
>
>
>
> I'm trying to develop a plug-in that could listen to the
> BBoxSelectionCommand and get the bbox that have been drawn by the user
with
> the bbox tool.
>
> I've tried to add a MapListener, I catch an event but it doesn't help:
>
>
>
>
>
>
>
> activeMap.addMapListener(new IMapListener(){
>
>             public void changed(MapEvent event)
>
>             {
>
>               System.out.println("change");
>
>               if(event.getType() == MapEvent.MapEventType.MAP_COMMAND){
>
>                 CommandManager val = (CommandManager)event.getNewValue();
>
>                 Object old=event.getOldValue();
>
>                 System.out.println(val.getMaxHistorySize());
>
>               }
>
>             }});
>
>               }
>
>
>
>
>
> Thanks in advance for your help, I'm really lost here.
>
>
>
>
>
> DESPRES Damien



_______________________________________________
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

Reply via email to