Changeset 10383 in josm


Ignore:
Timestamp:
2016-06-15T13:00:16+02:00 (3 years ago)
Author:
Don-vip
Message:

replace .get*Selected().isEmpty() by .selectionEmpty()

Location:
trunk/src/org/openstreetmap/josm
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java

    r10382 r10383  
    160160    protected void updateEnabledState() {
    161161        DataSet ds = getLayerManager().getEditDataSet();
    162         setEnabled(ds != null && !ds.getSelected().isEmpty());
     162        setEnabled(ds != null && !ds.selectionEmpty());
    163163    }
    164164
  • trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java

    r10382 r10383  
    376376    protected void updateEnabledState() {
    377377        DataSet ds = getLayerManager().getEditDataSet();
    378         setEnabled(ds != null && !ds.getSelected().isEmpty());
     378        setEnabled(ds != null && !ds.selectionEmpty());
    379379    }
    380380
  • trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java

    r10382 r10383  
    418418    protected void updateEnabledState() {
    419419        DataSet ds = getLayerManager().getEditDataSet();
    420         setEnabled(ds != null && !ds.getSelected().isEmpty());
     420        setEnabled(ds != null && !ds.selectionEmpty());
    421421    }
    422422
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r10382 r10383  
    344344        switch (mode) {
    345345        case "selection":
    346             setEnabled(ds != null && !ds.getSelected().isEmpty());
     346            setEnabled(ds != null && !ds.selectionEmpty());
    347347            break;
    348348        case "layer":
  • trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java

    r10382 r10383  
    3838    public void actionPerformed(ActionEvent ae) {
    3939        DataSet set = getLayerManager().getEditDataSet();
    40         if (set != null && !set.getAllSelected().isEmpty()) {
     40        if (set != null && !set.selectionEmpty()) {
    4141            HistoryBrowserDialogManager.getInstance().showHistory(set.getAllSelected());
    4242        } else {
  • trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java

    r10382 r10383  
    6464    public void actionPerformed(ActionEvent e) {
    6565        OsmDataLayer editLayer = getLayerManager().getEditLayer();
    66         if (editLayer == null || editLayer.data.getAllSelected().isEmpty())
     66        if (editLayer == null || editLayer.data.selectionEmpty())
    6767            return;
    6868        mergeSelected();
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r10382 r10383  
    619619    protected void updateEnabledState() {
    620620        DataSet ds = getLayerManager().getEditDataSet();
    621         setEnabled(ds != null && !ds.getSelected().isEmpty());
     621        setEnabled(ds != null && !ds.selectionEmpty());
    622622    }
    623623
  • trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java

    r10382 r10383  
    337337        }
    338338        // 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());
    340340    }
    341341
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r10382 r10383  
    186186        // update selection to reflect which way being modified
    187187        DataSet currentDataSet = getLayerManager().getEditDataSet();
    188         if (getCurrentBaseNode() != null && currentDataSet != null && !currentDataSet.getSelected().isEmpty()) {
     188        if (getCurrentBaseNode() != null && currentDataSet != null && !currentDataSet.selectionEmpty()) {
    189189            Way continueFrom = getWayForNode(getCurrentBaseNode());
    190190            if (alt && continueFrom != null && (!getCurrentBaseNode().isSelected() || continueFrom.isSelected())) {
     
    10851085
    10861086        // 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) {
    10891088            mouseOnExistingNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate);
    10901089        }
     
    12491248        DataSet ds = getLayerManager().getEditDataSet();
    12501249        if (ds == null) return null;
    1251         if (getCurrentBaseNode() != null && !ds.getSelected().isEmpty()) {
     1250        if (getCurrentBaseNode() != null && !ds.selectionEmpty()) {
    12521251            Way continueFrom = getWayForNode(getCurrentBaseNode());
    12531252            if (continueFrom != null)
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r10382 r10383  
    428428            //  if nothing was selected, select primitive under cursor for scaling or rotating
    429429            DataSet ds = getLayerManager().getEditDataSet();
    430             if (ds.getSelected().isEmpty()) {
     430            if (ds.selectionEmpty()) {
    431431                ds.setSelected(asColl(nearestPrimitive));
    432432            }
     
    594594
    595595            // Select Draw Tool if no selection has been made
    596             if (getLayerManager().getEditDataSet().getSelected().isEmpty() && !cancelDrawMode) {
     596            if (getLayerManager().getEditDataSet().selectionEmpty() && !cancelDrawMode) {
    597597                Main.map.selectDrawTool(true);
    598598                updateStatusLine();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r10378 r10383  
    342342
    343343        protected void updateEnabledState() {
    344             setEnabled(!model.getSelected().isEmpty());
     344            setEnabled(!model.isSelectionEmpty());
    345345        }
    346346
     
    378378        protected void updateEnabledState(int osmSelectionSize) {
    379379            // 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);
    381381        }
    382382
     
    459459
    460460        protected void updateEnabledState() {
    461             setEnabled(!model.getSelected().isEmpty());
     461            setEnabled(!model.isSelectionEmpty());
    462462        }
    463463
     
    561561
    562562        /**
    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
    565573         *
    566574         * @return choosen elements in the view
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveSelectedAction.java

    r9665 r10383  
    3434    protected void updateEnabledState() {
    3535        DataSet ds = layer.data;
    36         if (ds == null || ds.getSelected().isEmpty()) {
     36        if (ds == null || ds.selectionEmpty()) {
    3737            setEnabled(false);
    3838            return;
Note: See TracChangeset for help on using the changeset viewer.