Ignore:
Timestamp:
2009-09-02T21:17:52+02:00 (17 years ago)
Author:
Gubaer
Message:

new: improved dialog for uploading/saving modified layers on exit
new: improved dialog for uploading/saving modified layers if layers are deleted
new: new progress monitor which can delegate rendering to any Swing component
more setters/getters for properties in OSM data classes (fields are @deprecated); started to update references in the code base

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

Legend:

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

    r1938 r2025  
    227227
    228228            switch (mode) {
    229             case NONE:
    230                 return false;
    231             case MISSING_KEY:
    232                 return osm.get(key) == null;
    233             case ANY:
    234                 return true;
    235             case ANY_VALUE:
    236                 return osm.get(key) != null;
    237             case ANY_KEY:
    238                 for (String v:osm.getKeys().values()) {
    239                     if (v.equals(value))
    240                         return true;
    241                 }
    242                 return false;
    243             case EXACT:
    244                 return value.equals(osm.get(key));
    245             case ANY_KEY_REGEXP:
    246                 for (String v:osm.getKeys().values()) {
    247                     if (valuePattern.matcher(v).matches())
    248                         return true;
    249                 }
    250                 return false;
    251             case ANY_VALUE_REGEXP:
    252             case EXACT_REGEXP:
    253                 for (Entry<String, String> entry:osm.entrySet()) {
    254                     if (keyPattern.matcher(entry.getKey()).matches()) {
    255                         if (mode == Mode.ANY_VALUE_REGEXP
    256                                 || valuePattern.matcher(entry.getValue()).matches())
     229                case NONE:
     230                    return false;
     231                case MISSING_KEY:
     232                    return osm.get(key) == null;
     233                case ANY:
     234                    return true;
     235                case ANY_VALUE:
     236                    return osm.get(key) != null;
     237                case ANY_KEY:
     238                    for (String v:osm.getKeys().values()) {
     239                        if (v.equals(value))
    257240                            return true;
    258241                    }
    259                 }
    260                 return false;
    261             case MISSING_KEY_REGEXP:
    262                 for (String k:osm.keySet()) {
    263                     if (keyPattern.matcher(k).matches())
    264                         return false;
    265                 }
    266                 return true;
     242                    return false;
     243                case EXACT:
     244                    return value.equals(osm.get(key));
     245                case ANY_KEY_REGEXP:
     246                    for (String v:osm.getKeys().values()) {
     247                        if (valuePattern.matcher(v).matches())
     248                            return true;
     249                    }
     250                    return false;
     251                case ANY_VALUE_REGEXP:
     252                case EXACT_REGEXP:
     253                    for (Entry<String, String> entry:osm.entrySet()) {
     254                        if (keyPattern.matcher(entry.getKey()).matches()) {
     255                            if (mode == Mode.ANY_VALUE_REGEXP
     256                                    || valuePattern.matcher(entry.getValue()).matches())
     257                                return true;
     258                        }
     259                    }
     260                    return false;
     261                case MISSING_KEY_REGEXP:
     262                    for (String k:osm.keySet()) {
     263                        if (keyPattern.matcher(k).matches())
     264                            return false;
     265                    }
     266                    return true;
    267267            }
    268268            throw new AssertionError("Missed state");
     
    402402    private static class Modified extends Match {
    403403        @Override public boolean match(OsmPrimitive osm) {
    404             return osm.modified || osm.id == 0;
     404            return osm.isModified() || osm.getId() == 0;
    405405        }
    406406        @Override public String toString() {return "modified";}
  • trunk/src/org/openstreetmap/josm/actions/search/SelectionWebsiteLoader.java

    r2017 r2025  
    4848            Map<Long, String> ids = idReader.parseIds(in);
    4949            for (OsmPrimitive osm : Main.main.getCurrentDataSet().allNonDeletedPrimitives()) {
    50                 if (ids.containsKey(osm.id) && osm.getClass().getName().toLowerCase().endsWith(ids.get(osm.id))) {
     50                if (ids.containsKey(osm.getId()) && osm.getClass().getName().toLowerCase().endsWith(ids.get(osm.getId()))) {
    5151                    if (mode == SearchAction.SearchMode.remove) {
    5252                        sel.remove(osm);
Note: See TracChangeset for help on using the changeset viewer.