GSoC-Core: Status after 4 weeks

Michael Zangl openstreetmap at
Sat Jun 18 15:16:45 UTC 2016


A short note on the current GSoC progress for plugin writers and
interested users.

4 weeks ago I started to restructure some of JOSM main classes. A lot
has changed in the last few weeks. Some of the changes are affecting
plugins and large parts of JOSM, this is a short summary.
- Main.getLayerManager() should be used to access all layers. You can
add and remove layers there. Listeners fire in EDT now so this should
save you some code. You don't have to check if the map frame is
displayed, the layer manager will then simply be empty.
- The initializeMapFrame(old, new) calls should only be used to make
things on the map view (add listeners, modify UI).
- initializeMapFrame(...) is called after the first layer was added.
- Layer listeners are not that tolerant any more. Add them only once and
only remove the ones you added (and remember to remove them...)
- JOSM Tests are changing to use the new JOSMTestRules class. It allows
more control over the environment your test is run in and needs less
time to set it up.
- You should trigger a repaint for a single layer by calling

Old methods are deprecated and have a javadoc comment explaining how to
migrate. Although I try to provide as much compatibility as possible
there may be some bugs due to changes in the code.

What will change:
- Layers get a new paint() method. You can then directly access the
MapViewState during that paint call. This will allow us to do
parallel/asynchronous/partial draws in the future.
- Layers get a replacement for hookUpMapView() that will allow them to
support multiple MapView instances.
- The pasteBuffer will be removed since we can use the system clipboard
for that (note for users: You can copy+paste between two different JOSM
windows then)

Methods/fields will be deprecated until the end of the year.

Feel free to post your thoughts on the changes. You can find the things
I am currently working on there:


More information about the josm-dev mailing list