Changeset 7109 in josm for trunk/src/org
- Timestamp:
- 2014-05-12T00:40:09+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r7108 r7109 25 25 import java.awt.geom.Point2D; 26 26 import java.awt.geom.Rectangle2D; 27 import java.util.AbstractList;28 27 import java.util.ArrayList; 29 28 import java.util.Collection; … … 71 70 import org.openstreetmap.josm.gui.mappaint.StyleCache.StyleList; 72 71 import org.openstreetmap.josm.gui.mappaint.TextElement; 72 import org.openstreetmap.josm.tools.CompositeList; 73 73 import org.openstreetmap.josm.tools.ImageProvider; 74 74 import org.openstreetmap.josm.tools.Utils; … … 237 237 238 238 return Float.compare(this.style.object_z_index, other.style.object_z_index); 239 }240 }241 242 /**243 * Joined List build from two Lists (read-only).244 *245 * Extremely simple single-purpose implementation.246 * @param <T>247 */248 public static class CompositeList<T> extends AbstractList<T> {249 List<? extends T> a,b;250 251 /**252 * Constructs a new {@code CompositeList} from two lists.253 * @param a First list254 * @param b Second list255 */256 public CompositeList(List<? extends T> a, List<? extends T> b) {257 this.a = a;258 this.b = b;259 }260 261 @Override262 public T get(int index) {263 return index < a.size() ? a.get(index) : b.get(index - a.size());264 }265 266 @Override267 public int size() {268 return a.size() + b.size();269 239 } 270 240 } … … 1360 1330 1361 1331 /** 1362 * Construct or for CreateStyleRecordsWorker.1332 * Constructs a new {@code ComputeStyleListWorker}. 1363 1333 * @param input the primitives to process 1364 1334 * @param from first index of <code>input</code> to use 1365 1335 * @param to last index + 1 1336 * @param output the list of styles to which styles will be added 1337 * @param data the data set 1366 1338 */ 1367 1339 public ComputeStyleListWorker(final List<? extends OsmPrimitive> input, int from, int to, List<StyleRecord> output, DataSet data) { … … 1516 1488 List<Way> ways = data.searchWays(bbox); 1517 1489 List<Relation> relations = data.searchRelations(bbox); 1518 1490 1519 1491 final List<StyleRecord> allStyleElems = new ArrayList<>(nodes.size()+ways.size()+relations.size()); 1520 1492 1521 1493 ConcurrentTasksHelper helper = new ConcurrentTasksHelper(allStyleElems, data); 1522 1494 … … 1545 1517 ); 1546 1518 } 1547 1519 1548 1520 if (Main.isTraceEnabled()) { 1549 1521 timeFinished = System.currentTimeMillis(); 1550 1522 System.err.println("; phase 2 (draw): " + (timeFinished - timePhase1) + " ms; total: " + (timeFinished - timeStart) + " ms"); 1551 1523 } 1552 1524 1553 1525 drawVirtualNodes(data, bbox); 1554 1526 } finally {
Note:
See TracChangeset
for help on using the changeset viewer.