Last change
on this file since 13312 was 12662, checked in by Don-vip, 7 years ago |
see #15182 - remove dependence on GUI from data.osm.search.SearchCompiler
|
-
Property svn:eol-style
set to
native
|
File size:
930 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions.search;
|
---|
3 |
|
---|
4 | import java.util.Collection;
|
---|
5 | import java.util.Collections;
|
---|
6 |
|
---|
7 | import org.openstreetmap.josm.data.Bounds;
|
---|
8 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
9 | import org.openstreetmap.josm.data.osm.search.SearchCompiler.InArea;
|
---|
10 | import org.openstreetmap.josm.gui.MainApplication;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * Matches objects within current map view.
|
---|
14 | * @since 12662 (extracted from {@code SearchCompiler})
|
---|
15 | */
|
---|
16 | class InView extends InArea {
|
---|
17 |
|
---|
18 | InView(boolean all) {
|
---|
19 | super(all);
|
---|
20 | }
|
---|
21 |
|
---|
22 | @Override
|
---|
23 | protected Collection<Bounds> getBounds(OsmPrimitive primitive) {
|
---|
24 | if (!MainApplication.isDisplayingMapView()) {
|
---|
25 | return null;
|
---|
26 | }
|
---|
27 | return Collections.singleton(MainApplication.getMap().mapView.getRealBounds());
|
---|
28 | }
|
---|
29 |
|
---|
30 | @Override
|
---|
31 | public String toString() {
|
---|
32 | return all ? "allinview" : "inview";
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.