Ignore:
Timestamp:
2010-03-10T10:00:20+01:00 (16 years ago)
Author:
Gubaer
Message:

fixed #4651: Ability to download incomplete relation from selection
fixed #4098: Popup Menu entry "download relation members" in relation dialog should be "download incomplete relation members"
fixed two NPEs in RelationListDialog and SelectionListDialog
refactored SelectionListDialog to support better user feedback (enabled/disabled buttons and menu items)
Finally removed the sort() method on DataSet, marked as FIXME since a long time.

CAVEAT: DataSet.getSelected() now returns an unmodifiable list instead of a copy of the selection list. This may lead to UnsupportedOperationExceptions in the next few days. I tried to make sure the JOSM core uses getSelected() only for reading, but I didn't check the plugins.

File:
1 edited

Legend:

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

    r3032 r3102  
    398398        }
    399399    }
     400
     401    /**
     402     * Replies true if at least one child primitive is incomplete
     403     *
     404     * @return true if at least one child primitive is incomplete
     405     */
     406    public boolean hasIncompleteMembers() {
     407        for (RelationMember rm: members) {
     408            if (rm.getMember().isIncomplete()) return true;
     409        }
     410        return false;
     411    }
     412
     413    /**
     414     * Replies a collection with the incomplete children this relation
     415     * refers to
     416     *
     417     * @return the incomplete children. Empty collection if no children are incomplete.
     418     */
     419    public Collection<OsmPrimitive> getIncompleteMembers() {
     420        Set<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
     421        for (RelationMember rm: members) {
     422            if (!rm.getMember().isIncomplete()) {
     423                continue;
     424            }
     425            ret.add(rm.getMember());
     426        }
     427        return ret;
     428    }
    400429}
Note: See TracChangeset for help on using the changeset viewer.