Changeset 10383 in josm
- Timestamp:
- 2016-06-15T13:00:16+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
r10382 r10383 160 160 protected void updateEnabledState() { 161 161 DataSet ds = getLayerManager().getEditDataSet(); 162 setEnabled(ds != null && !ds. getSelected().isEmpty());162 setEnabled(ds != null && !ds.selectionEmpty()); 163 163 } 164 164 -
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r10382 r10383 376 376 protected void updateEnabledState() { 377 377 DataSet ds = getLayerManager().getEditDataSet(); 378 setEnabled(ds != null && !ds. getSelected().isEmpty());378 setEnabled(ds != null && !ds.selectionEmpty()); 379 379 } 380 380 -
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r10382 r10383 418 418 protected void updateEnabledState() { 419 419 DataSet ds = getLayerManager().getEditDataSet(); 420 setEnabled(ds != null && !ds. getSelected().isEmpty());420 setEnabled(ds != null && !ds.selectionEmpty()); 421 421 } 422 422 -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r10382 r10383 344 344 switch (mode) { 345 345 case "selection": 346 setEnabled(ds != null && !ds. getSelected().isEmpty());346 setEnabled(ds != null && !ds.selectionEmpty()); 347 347 break; 348 348 case "layer": -
trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java
r10382 r10383 38 38 public void actionPerformed(ActionEvent ae) { 39 39 DataSet set = getLayerManager().getEditDataSet(); 40 if (set != null && !set. getAllSelected().isEmpty()) {40 if (set != null && !set.selectionEmpty()) { 41 41 HistoryBrowserDialogManager.getInstance().showHistory(set.getAllSelected()); 42 42 } else { -
trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java
r10382 r10383 64 64 public void actionPerformed(ActionEvent e) { 65 65 OsmDataLayer editLayer = getLayerManager().getEditLayer(); 66 if (editLayer == null || editLayer.data. getAllSelected().isEmpty())66 if (editLayer == null || editLayer.data.selectionEmpty()) 67 67 return; 68 68 mergeSelected(); -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r10382 r10383 619 619 protected void updateEnabledState() { 620 620 DataSet ds = getLayerManager().getEditDataSet(); 621 setEnabled(ds != null && !ds. getSelected().isEmpty());621 setEnabled(ds != null && !ds.selectionEmpty()); 622 622 } 623 623 -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r10382 r10383 337 337 } 338 338 // buffer listening slows down the program and is not very good for arbitrary text in buffer 339 setEnabled(!ds. getSelected().isEmpty());339 setEnabled(!ds.selectionEmpty()); 340 340 } 341 341 -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r10382 r10383 186 186 // update selection to reflect which way being modified 187 187 DataSet currentDataSet = getLayerManager().getEditDataSet(); 188 if (getCurrentBaseNode() != null && currentDataSet != null && !currentDataSet. getSelected().isEmpty()) {188 if (getCurrentBaseNode() != null && currentDataSet != null && !currentDataSet.selectionEmpty()) { 189 189 Way continueFrom = getWayForNode(getCurrentBaseNode()); 190 190 if (alt && continueFrom != null && (!getCurrentBaseNode().isSelected() || continueFrom.isSelected())) { … … 1085 1085 1086 1086 // This happens when nothing is selected, but we still want to highlight the "target node" 1087 if (mouseOnExistingNode == null && getLayerManager().getEditDataSet().getSelected().isEmpty() 1088 && mousePos != null) { 1087 if (mouseOnExistingNode == null && getLayerManager().getEditDataSet().selectionEmpty() && mousePos != null) { 1089 1088 mouseOnExistingNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate); 1090 1089 } … … 1249 1248 DataSet ds = getLayerManager().getEditDataSet(); 1250 1249 if (ds == null) return null; 1251 if (getCurrentBaseNode() != null && !ds. getSelected().isEmpty()) {1250 if (getCurrentBaseNode() != null && !ds.selectionEmpty()) { 1252 1251 Way continueFrom = getWayForNode(getCurrentBaseNode()); 1253 1252 if (continueFrom != null) -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r10382 r10383 428 428 // if nothing was selected, select primitive under cursor for scaling or rotating 429 429 DataSet ds = getLayerManager().getEditDataSet(); 430 if (ds. getSelected().isEmpty()) {430 if (ds.selectionEmpty()) { 431 431 ds.setSelected(asColl(nearestPrimitive)); 432 432 } … … 594 594 595 595 // Select Draw Tool if no selection has been made 596 if (getLayerManager().getEditDataSet(). getSelected().isEmpty() && !cancelDrawMode) {596 if (getLayerManager().getEditDataSet().selectionEmpty() && !cancelDrawMode) { 597 597 Main.map.selectDrawTool(true); 598 598 updateStatusLine(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r10378 r10383 342 342 343 343 protected void updateEnabledState() { 344 setEnabled(!model. getSelected().isEmpty());344 setEnabled(!model.isSelectionEmpty()); 345 345 } 346 346 … … 378 378 protected void updateEnabledState(int osmSelectionSize) { 379 379 // See #10830 - allow to click on history button is a single object is selected, even if not selected again in the list 380 setEnabled(!model. getSelected().isEmpty() || osmSelectionSize == 1);380 setEnabled(!model.isSelectionEmpty() || osmSelectionSize == 1); 381 381 } 382 382 … … 459 459 460 460 protected void updateEnabledState() { 461 setEnabled(!model. getSelected().isEmpty());461 setEnabled(!model.isSelectionEmpty()); 462 462 } 463 463 … … 561 561 562 562 /** 563 * Replies the collection of OSM primitives currently selected in the view 564 * of this model 563 * Determines if no OSM primitives are currently selected. 564 * @return {@code true} if no OSM primitives are currently selected 565 * @since 10383 566 */ 567 public boolean isSelectionEmpty() { 568 return selectionModel.isSelectionEmpty(); 569 } 570 571 /** 572 * Replies the collection of OSM primitives currently selected in the view of this model 565 573 * 566 574 * @return choosen elements in the view -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveSelectedAction.java
r9665 r10383 34 34 protected void updateEnabledState() { 35 35 DataSet ds = layer.data; 36 if (ds == null || ds. getSelected().isEmpty()) {36 if (ds == null || ds.selectionEmpty()) { 37 37 setEnabled(false); 38 38 return;
Note:
See TracChangeset
for help on using the changeset viewer.