Changeset 3146 in josm for trunk/src/org
- Timestamp:
- 2010-03-19T22:05:48+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r3124 r3146 80 80 /** 81 81 * A small tool dialog for displaying the current selection. 82 * 82 * 83 83 */ 84 84 public class SelectionListDialog extends ToggleDialog { … … 96 96 /** 97 97 * Builds the panel with the list of selected OSM primitives 98 * 98 * 99 99 * @return the panel with the list of selected OSM primitives 100 100 */ … … 114 114 /** 115 115 * Builds the row of action buttons at the bottom of this dialog 116 * 116 * 117 117 * @return the panel 118 118 */ … … 147 147 /** 148 148 * Builds the content panel for this dialog 149 * 149 * 150 150 * @return the content panel 151 151 */ … … 326 326 /** 327 327 * The action for zooming to the primitives in the current JOSM selection 328 * 328 * 329 329 */ 330 330 class ZoomToJOSMSelectionAction extends AbstractAction implements ListDataListener { … … 361 361 * The action for zooming to the primitives which are currently selected in 362 362 * the list displaying the JOSM selection 363 * 363 * 364 364 */ 365 365 class ZoomToListSelection extends AbstractAction implements ListSelectionListener{ … … 393 393 /** 394 394 * The list model for the list of OSM primitives in the current JOSM selection. 395 * 395 * 396 396 * The model also maintains a history of the last {@see SelectionListModel#SELECTION_HISTORY_SIZE} 397 397 * JOSM selection. 398 * 398 * 399 399 */ 400 400 static private class SelectionListModel extends AbstractListModel implements EditLayerChangeListener, SelectionChangedListener, DataSetListener{ … … 416 416 /** 417 417 * Replies a summary of the current JOSM selection 418 * 418 * 419 419 * @return a summary of the current JOSM selection 420 420 */ … … 436 436 /** 437 437 * Remembers a JOSM selection the history of JOSM selections 438 * 438 * 439 439 * @param selection the JOSM selection. Ignored if null or empty. 440 440 */ … … 455 455 /** 456 456 * Replies the history of JOSM selections 457 * 457 * 458 458 * @return 459 459 */ … … 473 473 * Replies the collection of OSM primitives currently selected in the view 474 474 * of this model 475 * 475 * 476 476 * @return 477 477 */ … … 488 488 /** 489 489 * Sets the OSM primitives to be selected in the view of this model 490 * 490 * 491 491 * @param sel the collection of primitives to select 492 492 */ … … 511 511 /** 512 512 * Sets the collection of currently selected OSM objects 513 * 513 * 514 514 * @param selection the collection of currently selected OSM objects 515 515 */ … … 529 529 * Triggers a refresh of the view for all primitives in {@code toUpdate} 530 530 * which are currently displayed in the view 531 * 531 * 532 532 * @param toUpdate the collection of primitives to update 533 533 */ … … 547 547 /** 548 548 * Replies the list of selected relations with incomplete members 549 * 549 * 550 550 * @return the list of selected relations with incomplete members 551 551 */ … … 654 654 /** 655 655 * The popup menu for the search history entries 656 * 656 * 657 657 */ 658 658 protected static class SearchPopupMenu extends JPopupMenu { … … 738 738 /** 739 739 * Action for downloading incomplete members of selected relations 740 * 740 * 741 741 */ 742 742 class DownloadSelectedIncompleteMembersAction extends AbstractAction implements ListSelectionListener{ … … 778 778 779 779 static private class OsmPrimitiveComparator implements Comparator<OsmPrimitive> { 780 final private HashMap<O bject, String> cache= new HashMap<Object, String>();780 final private HashMap<OsmPrimitive, String> cache= new HashMap<OsmPrimitive, String>(); 781 781 final private DefaultNameFormatter df = DefaultNameFormatter.getInstance(); 782 782 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r2951 r3146 267 267 value = null; // delete the key instead 268 268 } 269 if (key.equals(newkey) && tr("<different>").equals(value)) {269 if (key.equals(newkey) && tr("<different>").equals(value)) 270 270 return; 271 }272 271 if (key.equals(newkey) || value == null) { 273 272 Main.main.undoRedo.add(new ChangePropertyCommand(sel, newkey, value)); … … 763 762 764 763 Map<Relation, Collection<RelationMember>> roles = new HashMap<Relation, Collection<RelationMember>>(); 765 if (Main.main.getCurrentDataSet() != null) { 766 for (Relation r : Main.main.getCurrentDataSet().getRelations()) { 767 if (!r.isFiltered() && !r.isIncomplete() && !r.isDeleted()) { 764 for (OsmPrimitive primitive: newSelection) { 765 for (OsmPrimitive ref: primitive.getReferrers()) { 766 if (ref instanceof Relation && !ref.isFiltered() && !ref.isIncomplete() && !ref.isDeleted()) { 767 Relation r = (Relation) ref; 768 768 for (RelationMember m : r.getMembers()) { 769 if ( newSelection.contains(m.getMember())) {769 if (m.getMember() == primitive) { 770 770 Collection<RelationMember> value = roles.get(r); 771 771 if (value == null) { … … 779 779 } 780 780 } 781 781 782 for (Entry<Relation, Collection<RelationMember>> e : roles.entrySet()) { 782 783 membershipData.addRow(new Object[]{e.getKey(), e.getValue()});
Note:
See TracChangeset
for help on using the changeset viewer.