Changeset 8141 in josm
- Timestamp:
- 2015-03-15T19:19:06+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r8130 r8141 13 13 import java.text.MessageFormat; 14 14 import java.util.ArrayList; 15 import java.util.Collection;16 15 import java.util.Collections; 17 16 import java.util.HashMap; … … 20 19 import java.util.Map; 21 20 import java.util.Map.Entry; 21 import java.util.PriorityQueue; 22 22 import java.util.Set; 23 23 import java.util.concurrent.locks.ReadWriteLock; … … 137 137 public final Map<String,Map<String,Set<MapCSSRule>>> index = new HashMap<>(); 138 138 /* rules without SimpleKeyValueCondition */ 139 public final Set<MapCSSRule> remaining = newHashSet<>();139 public final ArrayList<MapCSSRule> remaining = new ArrayList<>(); 140 140 141 141 public void add(MapCSSRule rule) { … … 178 178 rulesWithMatchingKeyValue.add(r); 179 179 } 180 Collections.sort(remaining); 180 181 } 181 182 … … 188 189 * You must have a read lock of STYLE_SOURCE_LOCK when calling this method. 189 190 */ 190 public Collection<MapCSSRule> getRuleCandidates(OsmPrimitive osm) {191 List<MapCSSRule> ruleCandidates = newArrayList<>(remaining);191 public PriorityQueue<MapCSSRule> getRuleCandidates(OsmPrimitive osm) { 192 PriorityQueue<MapCSSRule> ruleCandidates = new PriorityQueue<>(remaining); 192 193 for (Map.Entry<String,String> e : osm.getKeys().entrySet()) { 193 194 Map<String,Set<MapCSSRule>> v = index.get(e.getKey()); … … 199 200 } 200 201 } 201 Collections.sort(ruleCandidates);202 202 return ruleCandidates; 203 203 } … … 489 489 int lastDeclUsed = -1; 490 490 491 for (MapCSSRule r : matchingRuleIndex.getRuleCandidates(osm)) { 491 PriorityQueue<MapCSSRule> candidates = matchingRuleIndex.getRuleCandidates(osm); 492 MapCSSRule r; 493 while ((r = candidates.poll()) != null) { 492 494 env.clearSelectorMatchingInformation(); 493 495 env.layer = null;
Note:
See TracChangeset
for help on using the changeset viewer.