Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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





Back to the top