Ignore:
Timestamp:
2017-10-09T15:22:45+02:00 (7 years ago)
Author:
bastiK
Message:

see #15273 - more straightforward way to set up the styles for rendering

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r12876 r12964  
    6565import org.openstreetmap.josm.gui.draw.MapViewPath;
    6666import org.openstreetmap.josm.gui.draw.MapViewPositionAndRotation;
     67import org.openstreetmap.josm.gui.mappaint.ElemStyles;
     68import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
    6769import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement;
    6870import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.HorizontalTextAlignment;
     
    261263
    262264    private MapPaintSettings paintSettings;
     265    private ElemStyles styles;
    263266
    264267    private Color highlightColorTransparent;
     
    345348        Component focusOwner = FocusManager.getCurrentManager().getFocusOwner();
    346349        useWiderHighlight = !(focusOwner instanceof AbstractButton || focusOwner == nc);
     350        this.styles = MapPaintStyles.getStyles();
     351    }
     352
     353    /**
     354     * Set the {@link ElemStyles} instance to use for this renderer.
     355     * @param styles the {@code ElemStyles} instance to use
     356     */
     357    public void setStyles(ElemStyles styles) {
     358        this.styles = styles;
    347359    }
    348360
     
    16261638            // (Could be synchronized, but try to avoid this for performance reasons.)
    16271639            THREAD_POOL.invoke(new ComputeStyleListWorker(circum, nc, relations, allStyleElems,
    1628                     Math.max(20, relations.size() / THREAD_POOL.getParallelism() / 3)));
     1640                    Math.max(20, relations.size() / THREAD_POOL.getParallelism() / 3), styles));
    16291641            THREAD_POOL.invoke(new ComputeStyleListWorker(circum, nc, new CompositeList<>(nodes, ways), allStyleElems,
    1630                     Math.max(100, (nodes.size() + ways.size()) / THREAD_POOL.getParallelism() / 3)));
     1642                    Math.max(100, (nodes.size() + ways.size()) / THREAD_POOL.getParallelism() / 3), styles));
    16311643
    16321644            if (!benchmark.renderSort()) {
Note: See TracChangeset for help on using the changeset viewer.