Ignore:
Timestamp:
2009-11-08T13:38:44+01:00 (14 years ago)
Author:
jttt
Message:

Added support for referrers

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

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

    r2402 r2407  
    543543
    544544            newSelection.add(n);
    545             ds.setSelected(n);
    546545        } else if (!newNode) {
    547546            title = tr("Connect existing way to node");
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r2357 r2407  
    3939        this.regexSearch = regexSearch;
    4040        this.tokenizer = tokenizer;
    41         childBackRefs = new CollectBackReferencesVisitor(Main.main.getCurrentDataSet());
     41        childBackRefs = new CollectBackReferencesVisitor(true);
    4242    }
    4343
     
    230230
    231231            switch (mode) {
    232                 case NONE:
    233                     return false;
    234                 case MISSING_KEY:
    235                     return osm.get(key) == null;
    236                 case ANY:
    237                     return true;
    238                 case ANY_VALUE:
    239                     return osm.get(key) != null;
    240                 case ANY_KEY:
    241                     for (String v:osm.getKeys().values()) {
    242                         if (v.equals(value))
     232            case NONE:
     233                return false;
     234            case MISSING_KEY:
     235                return osm.get(key) == null;
     236            case ANY:
     237                return true;
     238            case ANY_VALUE:
     239                return osm.get(key) != null;
     240            case ANY_KEY:
     241                for (String v:osm.getKeys().values()) {
     242                    if (v.equals(value))
     243                        return true;
     244                }
     245                return false;
     246            case EXACT:
     247                return value.equals(osm.get(key));
     248            case ANY_KEY_REGEXP:
     249                for (String v:osm.getKeys().values()) {
     250                    if (valuePattern.matcher(v).matches())
     251                        return true;
     252                }
     253                return false;
     254            case ANY_VALUE_REGEXP:
     255            case EXACT_REGEXP:
     256                for (Entry<String, String> entry:osm.entrySet()) {
     257                    if (keyPattern.matcher(entry.getKey()).matches()) {
     258                        if (mode == Mode.ANY_VALUE_REGEXP
     259                                || valuePattern.matcher(entry.getValue()).matches())
    243260                            return true;
    244261                    }
    245                     return false;
    246                 case EXACT:
    247                     return value.equals(osm.get(key));
    248                 case ANY_KEY_REGEXP:
    249                     for (String v:osm.getKeys().values()) {
    250                         if (valuePattern.matcher(v).matches())
    251                             return true;
    252                     }
    253                     return false;
    254                 case ANY_VALUE_REGEXP:
    255                 case EXACT_REGEXP:
    256                     for (Entry<String, String> entry:osm.entrySet()) {
    257                         if (keyPattern.matcher(entry.getKey()).matches()) {
    258                             if (mode == Mode.ANY_VALUE_REGEXP
    259                                     || valuePattern.matcher(entry.getValue()).matches())
    260                                 return true;
    261                         }
    262                     }
    263                     return false;
    264                 case MISSING_KEY_REGEXP:
    265                     for (String k:osm.keySet()) {
    266                         if (keyPattern.matcher(k).matches())
    267                             return false;
    268                     }
    269                     return true;
     262                }
     263                return false;
     264            case MISSING_KEY_REGEXP:
     265                for (String k:osm.keySet()) {
     266                    if (keyPattern.matcher(k).matches())
     267                        return false;
     268                }
     269                return true;
    270270            }
    271271            throw new AssertionError("Missed state");
Note: See TracChangeset for help on using the changeset viewer.