[josm-dev] Plugin help - change topbar toolbar josm...

Dirk Stöcker openstreetmap at dstoecker.de
Mon Jan 11 16:43:38 GMT 2010


On Mon, 11 Jan 2010, Minh Quang wrote:

> I read project's code source several times. I discovered some 
> interesting classes which I will override in my plugin. We defined our 
> "Indoor" group tags (presets) and we modified your presets.xml.

You do not need to modify the XML. You can simply add another source to 
the list of preset sources. This can either be done using the JOSM webpage 
or a plugin as you suggest.

> Now I woud like to do is to create a top icon button on the topbar 
> toolbar as a shortcut to this tag presets (Indoor) 
> "tagginggroup_Highways/Waypoints". After, I would like to create a 
> button to draw room and then, add our "room" tag inside that.

These are two different things. First is adding the preset. This is easy. 
Add the presets-code to the toolbar-icon-list (use gui to do it once and 
look at result when you do not know the method how the unique name is 
built).

> ToolbarPreference is the class implementing the JOSM's toolbar?
> How you fill your two maps for the button actions?

When you create a JOSM action you can tell whether it is registered or 
not. Every registered action can be added to toolbar (as well as any 
action in menu - as long as the naming code is individual, so josm can 
distinguish the actions - I don't know 100% how unique name is built, but 
I think the action icon name is a part of it).

> How you can create a button pointing just to a group of tag (our group)?

Like above. Use GUI to try once until you understand the naming scheme. 
JOSMs tagging presets actions handlings menus and single entries 
correctly.

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


More information about the josm-dev mailing list