Changeset 15378 in josm for trunk


Ignore:
Timestamp:
2019-09-26T22:40:50+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #13592 - refresh relation member table connectivity after a change of member ways nodes

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

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

    r14835 r15378  
    930930    private void fireEventToListeners(AbstractDatasetChangedEvent event) {
    931931        for (DataSetListener listener : listeners) {
     932            Logging.trace("Firing {0} to {1} (dataset)", event, listener);
    932933            event.fire(listener);
    933934        }
  • trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java

    r13434 r15378  
    1717import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
    1818import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
     19import org.openstreetmap.josm.tools.Logging;
    1920
    2021/**
     
    197198        for (ListenerInfo listener: listeners) {
    198199            if (!listener.consolidate) {
     200                Logging.trace("Firing {0} to {1} (normal)", event, listener.listener);
    199201                event.fire(listener.listener);
    200202            }
     
    205207        for (ListenerInfo listener: listeners) {
    206208            if (listener.consolidate) {
     209                Logging.trace("Firing {0} to {1} (consolidated)", event, listener.listener);
    207210                event.fire(listener.listener);
    208211            }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java

    r15278 r15378  
    174174    @Override
    175175    public void wayNodesChanged(WayNodesChangedEvent event) {
    176         // ignore
     176        if (hasMembersReferringTo(Collections.singleton(event.getChangedWay()))) {
     177            // refresh connectivity
     178            for (int i = 0; i < members.size(); i++) {
     179                fireTableCellUpdated(i, 2 /* the column with the connectivity arrow */);
     180            }
     181        }
    177182    }
    178183
     
    666671        if (primitives == null || primitives.isEmpty())
    667672            return false;
    668         Set<OsmPrimitive> referrers = new HashSet<>();
    669         for (RelationMember member : members) {
    670             referrers.add(member.getMember());
    671         }
    672         for (OsmPrimitive referred : primitives) {
    673             if (referrers.contains(referred))
    674                 return true;
    675         }
    676         return false;
     673        Set<OsmPrimitive> referrers = members.stream().map(RelationMember::getMember).collect(Collectors.toSet());
     674        return primitives.stream().anyMatch(referrers::contains);
    677675    }
    678676
Note: See TracChangeset for help on using the changeset viewer.