Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] BBoxSelection Listener

The filter geneated by the BBoxSelectionCommand is available for you .... layer.getFilter().

You can look at this data structure and get the bounding box if you like; altough the selection for a layer (ie the filter) is not always done as a bounding box.

I hope this helps.

If you need to listen to any random part of the project/map/layer/viewport model you can - the magic word you need to know is "adapters"; the best way to figure out how is to look at some of the existing add/remove listener implementations and watch how they translate a Notification (ie what adapters "listen to") into a layer change event.

I am still not sure if the various map changed, and layer changed events are worth while or if it would be easier just to use this Notification thing everywhere.

Jody

On Wed, Feb 18, 2009 at 4:35 AM, Despres <damien.despres@xxxxxxxxxxxx> 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



Back to the top