Changeset 7109 in josm for trunk/src/org


Ignore:
Timestamp:
2014-05-12T00:40:09+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8671 - some code refactoring done in an unsuccessful attempt to reproduce error, but worth keeping

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  
    2525import java.awt.geom.Point2D;
    2626import java.awt.geom.Rectangle2D;
    27 import java.util.AbstractList;
    2827import java.util.ArrayList;
    2928import java.util.Collection;
     
    7170import org.openstreetmap.josm.gui.mappaint.StyleCache.StyleList;
    7271import org.openstreetmap.josm.gui.mappaint.TextElement;
     72import org.openstreetmap.josm.tools.CompositeList;
    7373import org.openstreetmap.josm.tools.ImageProvider;
    7474import org.openstreetmap.josm.tools.Utils;
     
    237237
    238238            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 list
    254          * @param b Second list
    255          */
    256         public CompositeList(List<? extends T> a, List<? extends T> b) {
    257             this.a = a;
    258             this.b = b;
    259         }
    260 
    261         @Override
    262         public T get(int index) {
    263             return index < a.size() ? a.get(index) : b.get(index - a.size());
    264         }
    265 
    266         @Override
    267         public int size() {
    268             return a.size() + b.size();
    269239        }
    270240    }
     
    13601330
    13611331        /**
    1362          * Constructor for CreateStyleRecordsWorker.
     1332         * Constructs a new {@code ComputeStyleListWorker}.
    13631333         * @param input the primitives to process
    13641334         * @param from first index of <code>input</code> to use
    13651335         * @param to last index + 1
     1336         * @param output the list of styles to which styles will be added
     1337         * @param data the data set
    13661338         */
    13671339        public ComputeStyleListWorker(final List<? extends OsmPrimitive> input, int from, int to, List<StyleRecord> output, DataSet data) {
     
    15161488            List<Way> ways = data.searchWays(bbox);
    15171489            List<Relation> relations = data.searchRelations(bbox);
    1518 
     1490   
    15191491            final List<StyleRecord> allStyleElems = new ArrayList<>(nodes.size()+ways.size()+relations.size());
    1520 
     1492   
    15211493            ConcurrentTasksHelper helper = new ConcurrentTasksHelper(allStyleElems, data);
    15221494
     
    15451517                );
    15461518            }
    1547 
     1519   
    15481520            if (Main.isTraceEnabled()) {
    15491521                timeFinished = System.currentTimeMillis();
    15501522                System.err.println("; phase 2 (draw): " + (timeFinished - timePhase1) + " ms; total: " + (timeFinished - timeStart) + " ms");
    15511523            }
    1552 
     1524   
    15531525            drawVirtualNodes(data, bbox);
    15541526        } finally {
Note: See TracChangeset for help on using the changeset viewer.