- Timestamp:
- 2020-06-08T22:54:33+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
r16553 r16581 127 127 public static class CoreSimpleMatchFactory implements SimpleMatchFactory { 128 128 private final Collection<String> keywords = Arrays.asList("id", "version", "type", "user", "role", 129 "changeset", "nodes", "ways", " tags", "areasize", "waylength", "modified", "deleted", "selected",129 "changeset", "nodes", "ways", "members", "tags", "areasize", "waylength", "modified", "deleted", "selected", 130 130 "incomplete", "untagged", "closed", "new", "indownloadedarea", 131 131 "allindownloadedarea", "timestamp", "nth", "nth%", "hasRole", "preset"); … … 173 173 case "ways": 174 174 return new WayCountRange(tokenizer); 175 case "members": 176 return new MemberCountRange(tokenizer); 175 177 case "tags": 176 178 return new TagCountRange(tokenizer); … … 1435 1437 } 1436 1438 1439 /* 1440 * Matches relations with a certain number of members 1441 */ 1442 private static class MemberCountRange extends RangeMatch { 1443 MemberCountRange(Range range) { 1444 super(range); 1445 } 1446 1447 MemberCountRange(PushbackTokenizer tokenizer) throws SearchParseError { 1448 this(tokenizer.readRange(tr("Range of numbers expected"))); 1449 } 1450 1451 @Override 1452 protected Long getNumber(OsmPrimitive osm) { 1453 if (osm instanceof Relation) { 1454 Relation r = (Relation) osm; 1455 return (long) r.getMembersCount(); 1456 } else { 1457 return null; 1458 } 1459 } 1460 1461 @Override 1462 protected String getString() { 1463 return "members"; 1464 } 1465 } 1466 1437 1467 /** 1438 1468 * Matches objects with a number of tags in given range -
trunk/src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java
r16354 r16581 383 383 .addKeyword("ways:<i>3-</i>", "ways:", tr("nodes with at least 3 referring ways, or relations containing at least 3 ways")) 384 384 .addKeyword("tags:<i>5-10</i>", "tags:", tr("objects having 5 to 10 tags")) 385 .addKeyword(" role:", "role:", tr("objects with given role in a relation"))385 .addKeyword("members:<i>2</i>", "members:", tr("relations with 2 members")) 386 386 .addKeyword("areasize:<i>-100</i>", "areasize:", tr("closed ways with an area of 100 m\u00b2")) 387 387 .addKeyword("waylength:<i>200-</i>", "waylength:", tr("ways with a length of 200 m or more")), … … 399 399 .addKeyword("child <i>expr</i>", "child ", tr("all children of objects matching the expression"), "child building") 400 400 .addKeyword("parent <i>expr</i>", "parent ", tr("all parents of objects matching the expression"), "parent bus_stop") 401 .addKeyword("role:", "role:", tr("objects with given role in a relation")) 401 402 .addKeyword("hasRole:<i>stop</i>", "hasRole:", tr("relation containing a member of role <i>stop</i>")) 402 403 .addKeyword("role:<i>stop</i>", "role:", tr("objects being part of a relation as role <i>stop</i>"))
Note:
See TracChangeset
for help on using the changeset viewer.