Re: [josm-dev] Cleaning MapView

2015-09-08 Thread Dirk Stöcker

On Tue, 8 Sep 2015, Michael Zangl wrote:


Currently, MapView is a collection of global flags, variables and lots
of stuff that has nothing to do with simply viewing the map. Some fields
are not even accessed by MapView itself and only used as global flag.


If you modify MapView, please keep one major goal in mind: E.g. in 
conflict resolution and relation view it would be a good idea to display 
different datasets (e.g. before, after). If the whole code can be 
capsulated enough, so that this is possible, that would be a major step 
forward, especially for conflict resolution. Mainly this means MapView 
(the view component, not the stuff around) should be reusable in 
different places and accept different data sets.


Ciao
--
http://www.dstoecker.eu/ (PGP key available)

___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


[josm-dev] Cleaning MapView

2015-09-08 Thread Michael Zangl
Hi,

Currently, MapView is a collection of global flags, variables and lots
of stuff that has nothing to do with simply viewing the map. Some fields
are not even accessed by MapView itself and only used as global flag.

I want to improve this, mostly to make the OpenGL plugin more reliable
and fix some issues I encountered there the right way (and not just work
around them).

This includes
- Moving the layer code to a new class. There is one global instance of
it holding the JOSM layers. Even if there are no layers (and there is no
MapView), this instance stays there and thus we do not need any public
static addListener() methods. This also makes plugin registration easier.
- The new classes have around 300 lines each, including documentation.
This imprives readability.
- Change event listeners to only get an event object. This allows us to
extend the events in the future without breaking everything.
- Get rid of all if(... instanceof ...) code.

Changing this requires changing a lot of things and rewriting some
management code from scratch. I added a compatibility layer for all
methods, so old code should work as it did before.

Current status:
#11637 Moves navigation code - I'll clean up this one.
#11838 Moves the layer management (new and ready to be discussed).

My Roadmap:
After #11838 is merged, I would like do the minor but unrelated
improvements:
* Move the refreshTitle()-Code out of MapView
* remove the AudioPlayer.reset()-calls
* Clean getLayerInformationForSourceTags()

For the navigation component code, I would like to modify #11637 to get
all coordinate conversion code to the ZoomData class. This would allow
us to change the map rendering code to work on a ZoomData instance
instead on the NavigationComponent and thus allow background rendering
(again, OpenGL-Plugin related).

Feel free to post any thoughts you have on this and any problems you see
;-).

Michael Zangl

___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Cleaning MapView

2015-09-08 Thread Vincent Privat
2015-09-08 15:24 GMT+02:00 Michael Zangl <
openstreet...@michael.fam-zangl.net>:

> The long term goal should be to make the MapView a real view that can be
> instanced as many times as you want (even 0 times, which allows you to
> run JOSM without a GUI).
>

This could be a nice enhancement: running the validator as a standalone
command-line application would be great.
___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Cleaning MapView

2015-09-08 Thread Michael Zangl
Am 08.09.2015 um 14:28 schrieb Dirk Stöcker:
> On Tue, 8 Sep 2015, Michael Zangl wrote:
> 
>> Currently, MapView is a collection of global flags, variables and lots
>> of stuff that has nothing to do with simply viewing the map. Some fields
>> are not even accessed by MapView itself and only used as global flag.
> 
> If you modify MapView, please keep one major goal in mind: E.g. in
> conflict resolution and relation view it would be a good idea to display
> different datasets (e.g. before, after). If the whole code can be
> capsulated enough, so that this is possible, that would be a major step
> forward, especially for conflict resolution. Mainly this means MapView
> (the view component, not the stuff around) should be reusable in
> different places and accept different data sets.

Yes, this is my main goal. I also thought of a small overview MapView in
the sidebar to not get lost when mapping details so easily. The long
term goal should be to make the MapView a real view that can be
instanced as many times as you want (even 0 times, which allows you to
run JOSM without a GUI).

The layer code I wrote already supports multiple layer sets, so you can
even have one view displaying the old OSM state + Bing and one view
displaying the new state + Bing.

Michael


___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev