Changeset 2279 in josm for trunk/src/org


Ignore:
Timestamp:
2009-10-12T20:39:13+02:00 (15 years ago)
Author:
Gubaer
Message:

see #3697: way member of relation can't be selected in version 2276 SVN

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

Legend:

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

    r2265 r2279  
    243243    }
    244244
    245     public void setSelected(Collection<? extends OsmPrimitive> selection) {
     245    /**
     246     * Sets the current selection to the primitives in <code>selection</code>.
     247     * Notifies all {@see SelectionChangedListener} if <code>fireSelectionChangeEvent</code> is true.
     248     *
     249     * @param selection the selection
     250     * @param fireSelectionChangeEvent true, if the selection change listeners are to be notified; false, otherwise
     251     */
     252    public void setSelected(Collection<? extends OsmPrimitive> selection, boolean fireSelectionChangeEvent) {
    246253        clearSelection(nodes);
    247254        clearSelection(ways);
     
    250257            osm.setSelected(true);
    251258        }
    252         fireSelectionChanged(selection);
    253     }
     259        if (fireSelectionChangeEvent) {
     260            fireSelectionChanged(selection);
     261        }
     262    }
     263
     264    /**
     265     * Sets the current selection to the primitives in <code>selection</code>
     266     * and notifies all {@see SelectionChangedListener}.
     267     *
     268     * @param selection the selection
     269     */
     270    public void setSelected(Collection<? extends OsmPrimitive> selection) {
     271        setSelected(selection, true /* fire selection change event */);
     272    }
     273
    254274
    255275    public void setSelected(OsmPrimitive... osm) {
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java

    r2264 r2279  
    1919import java.util.Arrays;
    2020import java.util.Collection;
     21import java.util.Collections;
    2122import java.util.Iterator;
    2223import java.util.LinkedList;
     
    474475                w = new Way(w);
    475476                w.setNodes(n);
    476                 if (selected)
    477                     data.setSelected(w);
    478                 else
     477                if (selected) {
     478                    data.setSelected(Collections.singleton(w),false /* don't notify listeners */);
     479                } else {
    479480                    data.clearSelection(w);
     481                }
    480482            }
    481483            if(!w.isClosed())
     
    680682                    firstNode = lastNode;
    681683                    lastNode = firstNode;
    682                 }
    683                 else
     684                } else {
    684685                    onewayvia = OsmUtils.getOsmBoolean(onewayviastr);
     686                }
    685687            }
    686688
Note: See TracChangeset for help on using the changeset viewer.