Changeset 5360 in josm
- Timestamp:
- 2012-07-25T00:33:41+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
r4942 r5360 116 116 117 117 protected void launchInfoBrowsersForSelectedPrimitives() { 118 ArrayList<OsmPrimitive> primitivesToShow = new ArrayList<OsmPrimitive>(getCurrentDataSet().get Selected());118 ArrayList<OsmPrimitive> primitivesToShow = new ArrayList<OsmPrimitive>(getCurrentDataSet().getAllSelected()); 119 119 120 120 // filter out new primitives which are not yet uploaded to the server -
trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java
r4982 r5360 31 31 DataSet set = getCurrentDataSet(); 32 32 if (set != null) { 33 HistoryBrowserDialogManager.getInstance().showHistory(set.get Selected());33 HistoryBrowserDialogManager.getInstance().showHistory(set.getAllSelected()); 34 34 } 35 35 } … … 40 40 setEnabled(false); 41 41 } else { 42 updateEnabledState(getCurrentDataSet().get Selected());42 updateEnabledState(getCurrentDataSet().getAllSelected()); 43 43 } 44 44 } -
trunk/src/org/openstreetmap/josm/actions/InfoAction.java
r4982 r5360 30 30 DataSet set = getCurrentDataSet(); 31 31 if (set != null) { 32 new InspectPrimitiveDialog(set.get Selected(), Main.map.mapView.getEditLayer()).showDialog();32 new InspectPrimitiveDialog(set.getAllSelected(), Main.map.mapView.getEditLayer()).showDialog(); 33 33 } 34 34 } … … 39 39 setEnabled(false); 40 40 } else { 41 updateEnabledState(getCurrentDataSet().get Selected());41 updateEnabledState(getCurrentDataSet().getAllSelected()); 42 42 } 43 43 } -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r5265 r5360 61 61 if (!isEnabled()) 62 62 return; 63 Collection<OsmPrimitive> selection = getCurrentDataSet().get Selected();63 Collection<OsmPrimitive> selection = getCurrentDataSet().getAllSelected(); 64 64 List<Node> selectedNodes = OsmPrimitive.getFilteredList(selection, Node.class); 65 65 … … 330 330 setEnabled(false); 331 331 } else { 332 updateEnabledState(getCurrentDataSet().get Selected());332 updateEnabledState(getCurrentDataSet().getAllSelected()); 333 333 } 334 334 } -
trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java
r5233 r5360 40 40 return; 41 41 if (getEditLayer().isUploadDiscouraged() && targetLayer instanceof OsmDataLayer && !((OsmDataLayer)targetLayer).isUploadDiscouraged() 42 && getEditLayer().data.get Selected().size() > 1) {42 && getEditLayer().data.getAllSelected().size() > 1) { 43 43 if (warnMergingUploadDiscouragedObjects(targetLayer)) { 44 44 return; … … 50 50 51 51 public void actionPerformed(ActionEvent e) { 52 if (getEditLayer() == null || getEditLayer().data.get Selected().isEmpty())52 if (getEditLayer() == null || getEditLayer().data.getAllSelected().isEmpty()) 53 53 return; 54 54 mergeSelected(getEditLayer().data); … … 60 60 setEnabled(false); 61 61 } else { 62 updateEnabledState(getCurrentDataSet().get Selected());62 updateEnabledState(getCurrentDataSet().getAllSelected()); 63 63 } 64 64 } -
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r4982 r5360 89 89 return; 90 90 91 Collection<OsmPrimitive> sel = getCurrentDataSet().get Selected();91 Collection<OsmPrimitive> sel = getCurrentDataSet().getAllSelected(); 92 92 layer = Main.map.mapView.getEditLayer(); 93 93 -
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r5266 r5360 102 102 setEnabled(false); 103 103 } else { 104 updateEnabledState(getCurrentDataSet().get Selected());104 updateEnabledState(getCurrentDataSet().getAllSelected()); 105 105 } 106 106 } … … 131 131 132 132 public Collection<OsmPrimitive> getData() { 133 return getCurrentDataSet().get Selected();133 return getCurrentDataSet().getAllSelected(); 134 134 } 135 135 } -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r5025 r5360 54 54 setEnabled(false); 55 55 } else { 56 updateEnabledState(getCurrentDataSet().get Selected());56 updateEnabledState(getCurrentDataSet().getAllSelected()); 57 57 } 58 58 } … … 95 95 UploadHullBuilder builder = new UploadHullBuilder(); 96 96 UploadSelectionDialog dialog = new UploadSelectionDialog(); 97 Collection<OsmPrimitive> modifiedCandidates = getModifiedPrimitives(getEditLayer().data.get Selected());97 Collection<OsmPrimitive> modifiedCandidates = getModifiedPrimitives(getEditLayer().data.getAllSelected()); 98 98 Collection<OsmPrimitive> deletedCandidates = getDeletedPrimitives(getEditLayer().data); 99 99 if (modifiedCandidates.isEmpty() && deletedCandidates.isEmpty()) { -
trunk/src/org/openstreetmap/josm/actions/ValidateAction.java
r4982 r5360 76 76 Collection<OsmPrimitive> selection; 77 77 if (getSelectedItems) { 78 selection = Main.main.getCurrentDataSet().get Selected();78 selection = Main.main.getCurrentDataSet().getAllSelected(); 79 79 if (selection.isEmpty()) { 80 80 selection = Main.main.getCurrentDataSet().allNonDeletedPrimitives(); -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r5198 r5360 584 584 585 585 final DataSet ds = Main.main.getCurrentDataSet(); 586 Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>(ds.get Selected());586 Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>(ds.getAllSelected()); 587 587 int foundMatches = getSelection(s, sel, new Function(){ 588 588 public Boolean isSomething(OsmPrimitive o){ -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r5266 r5360 438 438 */ 439 439 public void fireSelectionChanged(){ 440 Collection<? extends OsmPrimitive> currentSelection = get Selected();440 Collection<? extends OsmPrimitive> currentSelection = getAllSelected(); 441 441 for (SelectionChangedListener l : selListeners) { 442 442 l.selectionChanged(currentSelection); … … 479 479 /** 480 480 * Replies an unmodifiable collection of primitives currently selected 481 * in this dataset . May be empty, but not null.481 * in this dataset, except deleted ones. May be empty, but not null. 482 482 * 483 483 * @return unmodifiable collection of primitives 484 484 */ 485 485 public Collection<OsmPrimitive> getSelected() { 486 return new SubclassFilteredCollection<OsmPrimitive, OsmPrimitive>(getAllSelected(), OsmPrimitive.nonDeletedPredicate); 487 } 488 489 /** 490 * Replies an unmodifiable collection of primitives currently selected 491 * in this dataset, including deleted ones. May be empty, but not null. 492 * 493 * @return unmodifiable collection of primitives 494 */ 495 public Collection<OsmPrimitive> getAllSelected() { 486 496 Collection<OsmPrimitive> currentList; 487 497 synchronized (selectionLock) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitor.java
r5266 r5360 52 52 53 53 protected boolean isInSelectionBase(OsmPrimitive primitive) { 54 return selectionBase.get Selected().contains(primitive);54 return selectionBase.getAllSelected().contains(primitive); 55 55 } 56 56 … … 184 184 185 185 public DataSet build() { 186 for (OsmPrimitive primitive: selectionBase.get Selected()) {186 for (OsmPrimitive primitive: selectionBase.getAllSelected()) { 187 187 primitive.visit(this); 188 188 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r4459 r5360 127 127 Main.main.getEditLayer().data.addDataSetListener(inActiveDataLayerModel); 128 128 inActiveDataLayerModel.initFromDataSet(Main.main.getEditLayer().data); 129 inSelectionModel.initFromPrimitives(Main.main.getEditLayer().data.get Selected());129 inSelectionModel.initFromPrimitives(Main.main.getEditLayer().data.getAllSelected()); 130 130 } 131 131 } … … 234 234 protected void initWithCurrentData() { 235 235 if (Main.main.getEditLayer() != null) { 236 inSelectionModel.initFromPrimitives(Main.main.getEditLayer().data.get Selected());236 inSelectionModel.initFromPrimitives(Main.main.getEditLayer().data.getAllSelected()); 237 237 inActiveDataLayerModel.initFromDataSet(Main.main.getEditLayer().data); 238 238 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
r5200 r5360 121 121 model.selectionChanged(null); 122 122 } else { 123 model.selectionChanged(Main.main.getCurrentDataSet().get Selected());123 model.selectionChanged(Main.main.getCurrentDataSet().getAllSelected()); 124 124 } 125 125 } … … 197 197 if (Main.main.getCurrentDataSet() == null) 198 198 return; 199 for (OsmPrimitive primitive: Main.main.getCurrentDataSet().get Selected()) {199 for (OsmPrimitive primitive: Main.main.getCurrentDataSet().getAllSelected()) { 200 200 if (primitive.isNew()) { 201 201 continue; -
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
r5328 r5360 319 319 320 320 protected void createMapPaintText() { 321 final Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().get Selected();321 final Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getAllSelected(); 322 322 ElemStyles elemstyles = MapPaintStyles.getStyles(); 323 323 NavigatableComponent nc = Main.map.mapView; -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r5266 r5360 161 161 model.editLayerChanged(null, Main.map.mapView.getEditLayer()); 162 162 if (Main.map.mapView.getEditLayer() != null) { 163 model.setJOSMSelection(Main.map.mapView.getEditLayer().data.get Selected());163 model.setJOSMSelection(Main.map.mapView.getEditLayer().data.getAllSelected()); 164 164 } 165 165 actSearch.updateEnabledState(); … … 664 664 } else { 665 665 history = newLayer.data.getSelectionHistory(); 666 setJOSMSelection(newLayer.data.get Selected());666 setJOSMSelection(newLayer.data.getAllSelected()); 667 667 } 668 668 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r4982 r5360 136 136 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 137 137 if (newLayer instanceof OsmDataLayer) { 138 refresh(((OsmDataLayer) newLayer).data.get Selected());138 refresh(((OsmDataLayer) newLayer).data.getAllSelected()); 139 139 } else { 140 140 refresh(null); … … 165 165 Layer layer = Main.main.getActiveLayer(); 166 166 if (layer instanceof OsmDataLayer) { 167 refresh(((OsmDataLayer)layer).data.get Selected());167 refresh(((OsmDataLayer)layer).data.getAllSelected()); 168 168 } 169 169 … … 275 275 Layer layer = Main.main.getActiveLayer(); 276 276 if (layer instanceof OsmDataLayer) { 277 refresh(((OsmDataLayer)layer).data.get Selected());277 refresh(((OsmDataLayer)layer).data.getAllSelected()); 278 278 } 279 279 setEnabled(false); … … 390 390 users.add(data.get(index).user); 391 391 } 392 Collection<OsmPrimitive> selected = Main.main.getCurrentDataSet().get Selected();392 Collection<OsmPrimitive> selected = Main.main.getCurrentDataSet().getAllSelected(); 393 393 Collection<OsmPrimitive> byUser = new LinkedList<OsmPrimitive>(); 394 394 for (OsmPrimitive p : selected) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r5287 r5360 168 168 DataSet ds = Main.main.getCurrentDataSet(); 169 169 if (ds != null) { 170 updateSelection(ds.get Selected());170 updateSelection(ds.getAllSelected()); 171 171 } 172 172 MapView.addLayerChangeListener(this); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetInSelectionListModel.java
r3083 r5360 30 30 setChangesets(null); 31 31 } else { 32 initFromPrimitives((newLayer).data.get Selected());32 initFromPrimitives((newLayer).data.getAllSelected()); 33 33 } 34 34 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java
r3416 r5360 64 64 } 65 65 if (newLayer == layer) { 66 cache.addAll(((OsmDataLayer)newLayer).data.get Selected());66 cache.addAll(((OsmDataLayer)newLayer).data.getAllSelected()); 67 67 } 68 68 fireTableDataChanged(); … … 102 102 */ 103 103 protected void populateSelectedPrimitives(OsmDataLayer layer) { 104 selectionChanged(layer.data.get Selected());104 selectionChanged(layer.data.getAllSelected()); 105 105 } 106 106
Note:
See TracChangeset
for help on using the changeset viewer.