Changeset 1922 in josm for trunk/src/org


Ignore:
Timestamp:
2009-08-07T22:33:37+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3207 again: Highlighting members in relation editor is broken

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/relation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r1920 r1922  
    14571457    class SelectionSynchronizer implements ListSelectionListener, SelectionChangedListener{
    14581458        public void valueChanged(ListSelectionEvent e) {
     1459            // as long as the model is computing the final selection it emits selection
     1460            // change events with getValueIsAdjusting() true. Ignore these events, only
     1461            // handle the final selection update. Otherwise, infinite loops of property
     1462            // change events occur.
     1463            //
    14591464            if (e.getValueIsAdjusting())
    14601465                return;
    14611466
    1462             // Avoid endless loops. memberTableModel is registered as SelectionChangeListener
    1463             // too. Only update the selection if it is not in sync with what is already
    1464             // selected.
     1467            // Avoid infinite loop.  Only update the selection if it is not in sync with what
     1468            // is already selected. Avoids infinite loops of property change events.
    14651469            //
    14661470            if (!memberTableModel.selectionsAreInSync()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java

    r1920 r1922  
    394394    public boolean selectionsAreInSync() {
    395395        HashSet<OsmPrimitive> s1 = new HashSet<OsmPrimitive>(getSelectedReferers());
    396         if (s1.size() > layer.data.getSelected().size()) return false;
     396        if (s1.size() != layer.data.getSelected().size()) return false;
    397397        s1.removeAll(layer.data.getSelected());
    398398        return s1.isEmpty();
     
    489489     */
    490490    public void selectMembersReferringTo(Collection<? extends OsmPrimitive> primitives) {
    491         if (primitives == null || primitives.isEmpty()) return;
     491        if (primitives == null) return;
    492492        getSelectionModel().setValueIsAdjusting(true);
    493493        getSelectionModel().clearSelection();
Note: See TracChangeset for help on using the changeset viewer.