[josm-dev] JOSM Selection
Raphael Mack
ramack at raphael-mack.de
Mon Mar 24 16:57:54 GMT 2008
Hi,
as there have been many request to edit gpx files (filter or drop nodes), I
tried to work in that direction and make GPX points (WayPoints)
selectable.
Therefore I made quite a few changes on the selection handling:
- introduction of a interface Selectable
- the current selection is stored in the layer instead of the DataSet
- DataSet.getSelected() and setSelected* are deprecated, as
Main.map.mapView.getActiveLayer().getSelected() should be used
- SelectionListDialog now can display any selectable
- Marker, OsmPrimitive and WayPoint implement new interface Selectable
- SelectionListeners are not stored and (un)-registered in DataSet, but in
Main now
- SelectAction can select all Selectables now and handles ctrl and shift to
add to/remove from existing selection, rotation is handled in the
OsmDataLayer, which is an ugly hack - feel free to suggest better ideas
Deletion of gpx points is the next step and I think it should be done the
same way (via DeleteAction) as selecting (with SelectAction). Moving and
rotation does not make sense for all selectable objects (Markers, Gpx
points, etc.), that's why I think this should be done layer-dependent.
Which lead to my kind-of-chaos implementation with rotation code in
OsmDataLayer and selection code in SelectAction.
As I won't have much time in the next few days, I wanted to publish my
current state and would be happy to get feedback and ideas, how the
interplay of Actions with layer-dependent behavior could be implemented
nicely.
A compiled josm-custom.jar and a diff against r587 can be found at:
http://files.raphael-mack.de/josm/josm-selection/
Cheers,
Rapha
More information about the josm-dev
mailing list