Ignore:
Timestamp:
2012-01-15T19:46:00+01:00 (14 years ago)
Author:
simon04
Message:

fix #5796 - remotecontrol: load_and_zoom/zoom: select relations in the relation toggle dialog

File:
1 edited

Legend:

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

    r4536 r4795  
    211211     */
    212212    public void selectRelation(Relation relation) {
    213         if (relation == null) {
     213        selectRelations(Collections.singleton(relation));
     214    }
     215
     216    /**
     217     * Selects the relations in the list of relations.
     218     * @param relations  the relations to be selected
     219     */
     220    public void selectRelations(Collection<Relation> relations) {
     221        if (relations == null || relations.isEmpty()) {
    214222            model.setSelectedRelations(null);
    215223        } else {
    216             model.setSelectedRelations(Collections.singletonList(relation));
    217             Integer i = model.getRelationIndex(relation);
     224            model.setSelectedRelations(relations);
     225            Integer i = model.getRelationIndex(relations.iterator().next());
    218226            if (i != null) { // Not all relations have to be in the list (for example when the relation list is hidden, it's not updated with new relations)
    219227                displaylist.scrollRectToVisible(displaylist.getCellBounds(i, i));
     
    740748         * @return sel the list of selected relations
    741749         */
    742         public void setSelectedRelations(List<Relation> sel) {
     750        public void setSelectedRelations(Collection<Relation> sel) {
    743751            selectionModel.clearSelection();
    744752            if (sel == null || sel.isEmpty())
Note: See TracChangeset for help on using the changeset viewer.