[OSM-dev] elemstyles.xml file, icons

Ulf Lamping ulf.lamping at web.de
Tue Jul 3 23:59:25 BST 2007


Hi!

While thinking about the current implementation of the mappaint styles:

This is how it's currently working:

a) the "standard" style is included in the mappaint.jar
b) user styles go to "<josm-profile>/plugins/mappaint/<stylename>

To currently create your own user style, the user has to copy the 
"standard" style content from svn to b) and then edit the preferences 
file mappaint.style=<stylename> accordingly.

This has some disadvantages:
1) we currently cannot use applications/share/map-icons for mappaint, as 
we need the collection of icons and the xml file in svn exactly as it 
has to be for the plugin dir
2) user has to copy stuff from svn, that makes the process much more 
complicated than necessary (which is BTW a bit strange, as the required 
files are already in the jar file)


A better solution could be:
When JOSM is started and there's a mappaint.style setting in the 
preferences and no corresponding style dir in the profile, raise a 
dialog box: "The mappaint style xyz does not exist. Do you want me to 
create it with default settings and icons?". If answered yes, a new 
style dir is created in b) and the standard dir (including xml and 
icons) from the jar file is copied into it.

This has the following advantages:
- make it easier (and therefore less error prone) for users to create 
new styles
- remove the "dependency" between user interaction and svn - making the 
build process potentially more flexible
- existing user styles won't be touched - it hopefully won't break anything

As a next step we could then remove the standard style from the svn 
mappaint dir completely and directly build/use (or at least copy) the 
required files from /applications/etc/elemstyles.xml and 
applications/share/map-icons while building the jar file.


Or do I miss something?

Regards, ULFL




More information about the dev mailing list