Changeset 2282 in josm for trunk


Ignore:
Timestamp:
2009-10-13T05:04:53+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3697: selected multipolygon not always rendered in selected state

Location:
trunk/src/org/openstreetmap/josm/data/osm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r2279 r2282  
    270270    public void setSelected(Collection<? extends OsmPrimitive> selection) {
    271271        setSelected(selection, true /* fire selection change event */);
     272    }
     273
     274    /**
     275     * Adds   the primitives in <code>selection</code> to the current selection
     276     * and notifies all {@see SelectionChangedListener}.
     277     *
     278     * @param selection the selection
     279     */
     280    public void addSelected(Collection<? extends OsmPrimitive> selection) {
     281        addSelected(selection, true /* fire selection change event */);
     282    }
     283
     284    /**
     285     * Adds the primitives in <code>selection</code> to the current selection.
     286     * Notifies all {@see SelectionChangedListener} if <code>fireSelectionChangeEvent</code> is true.
     287     *
     288     * @param selection the selection
     289     * @param fireSelectionChangeEvent true, if the selection change listeners are to be notified; false, otherwise
     290     */
     291    public void addSelected(Collection<? extends OsmPrimitive> selection, boolean fireSelectionChangeEvent) {
     292        for (OsmPrimitive osm : selection) {
     293            osm.setSelected(true);
     294        }
     295        if (fireSelectionChangeEvent) {
     296            fireSelectionChanged(selection);
     297        }
    272298    }
    273299
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java

    r2279 r2282  
    476476                w.setNodes(n);
    477477                if (selected) {
    478                     data.setSelected(Collections.singleton(w),false /* don't notify listeners */);
     478                    data.addSelected(Collections.singleton(w),false /* don't notify listeners */);
    479479                } else {
    480480                    data.clearSelection(w);
Note: See TracChangeset for help on using the changeset viewer.