[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] BBoxSelection Listener
|
That sounds perfect; if you are intending to define a region of interest then a region of interest tool is more explicit to both you and your user. You should find that your tool can store the region of interest on the map backboad; and then your other view etc can pick it up from there as needed. The coordinate tool / coordinate map graphic example in tutorials show how to do this; and it has been used by many other teams. The DIVAGIS team used this techqniue to define a region of interest "grid" and then had a bunch of operations build around doing analysis of the points that fell into each grid square.
Jody
On Tue, Feb 24, 2009 at 7:46 PM, Despres
<damien.despres@xxxxxxxxxxxx> wrote:
Thanks for your help,
The point is that the filter i
get doesn’t contain a bounding box. Indeed, I may have only one or no rasters
layer on the map.
I think what I tried to do is
impossible with the Bbox selection tool, so I developped my own Bbox tool.
The goal is just to define a Region of Interest.
Damien
|
|
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
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel