Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [udig-devel] Layer Selection vs Current Layer

OK,

I have not had my morning cup of tea yet, and am a bit lost.
Lets simplify things for my brain.

Q: How can I get the 'Selection View' to change it's contents to match
the currently selected layer?

Michelle

-----Original Message-----
From: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx
[mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jody
Garnett
Sent: 19 April 2006 10:15
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] Layer Selection vs Current Layer


M.S.Bachler wrote:
> Hi!
>
> "Perhaps getting interested views to ask the Map for a selection 
> manger tracking the selected view"
>
> I think that is the sort of thing I had expected.
> So when I set the selected layer using:
>
> 	((EditManager)map.getEditManager()).setSelectedLayer(layer);   
>
> I expected the layer to be selected in the Layer View (which it now is

> thanks to Jesse), and the Selection View to refresh displaying the 
> correct data. I thought the setSelectedLayer method would fire a layer

> changed event or something, and all the relevant bits would respond 
> appropriatly.
>   
I am afraid the add/remove listener model does not always match with 
what is needed. Did you
read the article I was talking about?
-
http://www.eclipse.org/articles/Article-WorkbenchSelections/article.html

We actually have two things going on here:
- we would like user interfaces to be able to respond to a layer (or 
georesource) whenever it is selected
(in say either the Layers view or Projects view). This is the subject of

the above article, they have a single SelectionService for the entire
window and each view/editor only gets to control it when that view is 
active.
- some views may want to ignore the workbench and focus on the current 
Map (if there is a current map),
I am not sure if the Map keeps a "selected layer" right now, but if it 
does you can "listen to it" using a EMF
adapter.

So you have a trade off, do you want to work against the idea of a
Layer, or explicitly against the layer selected in the current Map? This
is 
something
to be considered for each and every view ...

Jody

_______________________________________________
User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top