Ignore:
Timestamp:
2017-08-26T01:29:38+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - remove dependence on GUI from data.osm.search.SearchCompiler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java

    r12659 r12662  
    3636import org.openstreetmap.josm.data.osm.search.PushbackTokenizer.Range;
    3737import org.openstreetmap.josm.data.osm.search.PushbackTokenizer.Token;
    38 import org.openstreetmap.josm.gui.MainApplication;
    3938import org.openstreetmap.josm.gui.mappaint.Environment;
    4039import org.openstreetmap.josm.gui.mappaint.mapcss.Selector;
     
    124123                "changeset", "nodes", "ways", "tags", "areasize", "waylength", "modified", "deleted", "selected",
    125124                "incomplete", "untagged", "closed", "new", "indownloadedarea",
    126                 "allindownloadedarea", "inview", "allinview", "timestamp", "nth", "nth%", "hasRole", "preset");
     125                "allindownloadedarea", "timestamp", "nth", "nth%", "hasRole", "preset");
    127126
    128127        @Override
     
    147146            case "allindownloadedarea":
    148147                return new InDataSourceArea(true);
    149             case "inview":
    150                 return new InView(false);
    151             case "allinview":
    152                 return new InView(true);
    153148            default:
    154149                if (tokenizer != null) {
     
    14611456     * Matches objects within the given bounds.
    14621457     */
    1463     private abstract static class InArea extends Match {
     1458    public abstract static class InArea extends Match {
    14641459
    14651460        protected final boolean all;
     
    14681463         * @param all if true, all way nodes or relation members have to be within source area;if false, one suffices.
    14691464         */
    1470         InArea(boolean all) {
     1465        protected InArea(boolean all) {
    14711466            this.all = all;
    14721467        }
     
    15391534        public String toString() {
    15401535            return "NotOutsideDataSourceArea";
    1541         }
    1542     }
    1543 
    1544     /**
    1545      * Matches objects within current map view.
    1546      */
    1547     private static class InView extends InArea {
    1548 
    1549         InView(boolean all) {
    1550             super(all);
    1551         }
    1552 
    1553         @Override
    1554         protected Collection<Bounds> getBounds(OsmPrimitive primitive) {
    1555             if (!MainApplication.isDisplayingMapView()) {
    1556                 return null;
    1557             }
    1558             return Collections.singleton(MainApplication.getMap().mapView.getRealBounds());
    1559         }
    1560 
    1561         @Override
    1562         public String toString() {
    1563             return all ? "allinview" : "inview";
    15641536        }
    15651537    }
Note: See TracChangeset for help on using the changeset viewer.