Changeset 4795 in josm
- Timestamp:
- 2012-01-15T19:46:00+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r4536 r4795 211 211 */ 212 212 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()) { 214 222 model.setSelectedRelations(null); 215 223 } 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()); 218 226 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) 219 227 displaylist.scrollRectToVisible(displaylist.getCellBounds(i, i)); … … 740 748 * @return sel the list of selected relations 741 749 */ 742 public void setSelectedRelations( List<Relation> sel) {750 public void setSelectedRelations(Collection<Relation> sel) { 743 751 selectionModel.clearSelection(); 744 752 if (sel == null || sel.isEmpty()) -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r4791 r4795 25 25 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 26 26 import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog; 27 import org.openstreetmap.josm.tools.Utils; 27 28 28 29 /** … … 173 174 new AutoScaleAction("selection").actionPerformed(null); 174 175 } 176 if (Main.map != null && Main.map.relationListDialog != null) { 177 Main.map.relationListDialog.dataChanged(null); 178 Main.map.relationListDialog.selectRelations(Utils.filteredCollection(newSel, Relation.class)); 179 } 175 180 } 176 181 });
Note:
See TracChangeset
for help on using the changeset viewer.