Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] CRS, Map, Viewpor + preferences

Vitali Diatchkov wrote:
Hi! Some words about CRS, Map, Viewport, etc..

I have created preferences framework with some pages as examples  but didn't
add to the repository while it is unclear where to persist preferences. For
example there is a "Map" preference page where the user specifies default
CRS for all new created maps.  As I mentioned in one of old letters (see
attachment) there should be unified way to persist preferences:

-through default IPreferenceStore that AbstractUIPlugin has
-through custom IPreferenceStore if plugin class doesn't extend
AbstractUIPlugin
-whatever else

Then from different parts of code those preferences are requested..
for example ViewportModel.getDefaultCRS() actually asks preferences and
instantiates default CRS from preferences, not hard-coded WGS84, etc.


The problem: ViewportModel is in Project plugin that is not AbstractUIPlugin
, so, no default IPreferenceStore - the custom is needed (one of the
solution). Custom means the same as in Catalog plugin where "Catalog" view
content is persisted. If to save preferences in Project.Ui plugin (It
extends AbstractUIPlugin) - there is no dependency from Project.Ui plugin in
Project plugin, etc..  Always there are workarounds but the solid unified
solution is needed.

One possible solution here is to use Platform.getPreferenceManager().... It is a bit more difficult to use but might be the correct place.


As concerns CRS, from the point of view of "stupid user" the behavior should
be:

1) If the resource is added to the new map where there is no data at all and
this resource has determined CRS, then this CRS is selected as default for
the map.
2) If the resource is added to the map where there are already other
resources then nothing with map's CRS - it is already must be defined.
3) If the resource is added to the map where there is no data at all and
resource's CRS is undetermined then default CRS from preferences is chosen.

Another point of view of another "stupid user" is:

1) Always the default CRS from preferences is set to the newly created map.
That's it.


So what is the best solution that gives the most usability.. whatever. From
MY point of view the second stupid user is right.

That decision could be preference as well. Maybe with default being the second choice. I've had both choices be presented as the "correct" way.

Jesse


Back to the top