Ticket #24637: urbaneye3d-MapCSS.patch

File urbaneye3d-MapCSS.patch, 42.7 KB (added by zkir, 3 days ago)

patch including both code changes and autotests uplift

  • src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    diff --git a/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java b/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
    index fa085ae97c..516ab0d3f8 100644
    a b import java.util.Locale;  
    1212import java.util.Map;
    1313import java.util.Objects;
    1414import java.util.Set;
     15import java.util.HashMap;
    1516import java.util.function.Consumer;
    1617import java.util.stream.Collectors;
    1718import java.util.stream.IntStream;
    import org.openstreetmap.josm.data.osm.search.SearchCompiler.Match;  
    2223import org.openstreetmap.josm.data.osm.search.SearchParseError;
    2324import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
    2425import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor;
     26import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2527import org.openstreetmap.josm.gui.mappaint.StyleCache;
    2628import org.openstreetmap.josm.spi.preferences.Config;
    2729import org.openstreetmap.josm.tools.CheckParameterUtil;
    public abstract class OsmPrimitive extends AbstractPrimitive implements Template  
    143145    /*----------
    144146     * MAPPAINT
    145147     *--------*/
    146     private StyleCache mappaintStyle;
     148    private final Map<ElemStyles, StyleCache> mappaintStyle = new HashMap<>();
    147149
    148150    @Override
    149     public final StyleCache getCachedStyle() {
    150         return mappaintStyle;
     151    public final StyleCache getCachedStyle(ElemStyles elemStyles) {
     152        return mappaintStyle.get(elemStyles);
    151153    }
    152154
    153155    @Override
    154     public final void setCachedStyle(StyleCache mappaintStyle) {
    155         this.mappaintStyle = mappaintStyle;
     156    public final void setCachedStyle(ElemStyles elemStyles, StyleCache mappaintStyle) {
     157        this.mappaintStyle.put(elemStyles, mappaintStyle);
    156158    }
    157159
    158160    @Override
    159     public final boolean isCachedStyleUpToDate() {
    160         return mappaintStyle != null && mappaintCacheIdx == dataSet.getMappaintCacheIndex();
     161    public final boolean isCachedStyleUpToDate(ElemStyles elemStyles) {
     162        return mappaintStyle.get(elemStyles) != null && mappaintCacheIdx == dataSet.getMappaintCacheIndex();
    161163    }
    162164
    163165    @Override
    164     public final void declareCachedStyleUpToDate() {
     166    public final void declareCachedStyleUpToDate(ElemStyles styles) {
    165167        this.mappaintCacheIdx = dataSet.getMappaintCacheIndex();
    166168    }
    167169
     170    @Override
     171    public void clearCachedStyle() {
     172        this.mappaintStyle.clear();
     173    }
     174
    168175    /* end of mappaint data */
    169176
    170177    /*---------
  • src/org/openstreetmap/josm/data/osm/PrimitiveData.java

    diff --git a/src/org/openstreetmap/josm/data/osm/PrimitiveData.java b/src/org/openstreetmap/josm/data/osm/PrimitiveData.java
    index c5c2775a60..5a34ddbdb8 100644
    a b import java.util.List;  
    1111import java.util.Map;
    1212
    1313import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor;
     14import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1415import org.openstreetmap.josm.gui.mappaint.StyleCache;
    1516
    1617/**
    public abstract class PrimitiveData extends AbstractPrimitive implements Seriali  
    151152    }
    152153
    153154    @Override
    154     public StyleCache getCachedStyle() {
     155    public StyleCache getCachedStyle(ElemStyles styles) {
    155156        return null;
    156157    }
    157158
    158159    @Override
    159     public void setCachedStyle(StyleCache mappaintStyle) {
     160    public void setCachedStyle(ElemStyles styles, StyleCache mappaintStyle) {
    160161        // Override if needed
    161162    }
    162163
    163164    @Override
    164     public boolean isCachedStyleUpToDate() {
     165    public boolean isCachedStyleUpToDate(ElemStyles styles) {
    165166        return false;
    166167    }
    167168
    168169    @Override
    169     public void declareCachedStyleUpToDate() {
     170    public void declareCachedStyleUpToDate(ElemStyles styles) {
     171        // Override if needed
     172    }
     173
     174    @Override
     175    public void clearCachedStyle(){
    170176        // Override if needed
    171177    }
    172178}
  • src/org/openstreetmap/josm/data/osm/Stylable.java

    diff --git a/src/org/openstreetmap/josm/data/osm/Stylable.java b/src/org/openstreetmap/josm/data/osm/Stylable.java
    index 38bbdd4a31..66179a0092 100644
    a b  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.osm;
    33
     4import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    45import org.openstreetmap.josm.gui.mappaint.StyleCache;
    56
    67/**
    public interface Stylable {  
    1314     * Returns the cached style.
    1415     * @return the cached style
    1516     */
    16     StyleCache getCachedStyle();
     17    StyleCache getCachedStyle(ElemStyles styles);
    1718
    1819    /**
    1920     * Sets the cached style.
    2021     * @param mappaintStyle the cached style
    2122     */
    22     void setCachedStyle(StyleCache mappaintStyle);
     23    void setCachedStyle(ElemStyles styles, StyleCache mappaintStyle);
    2324
    2425    /**
    2526     * Clears the cached style.
    public interface Stylable {  
    2728     * get/set functions calling this implicitly is preferred, so we can have
    2829     * transparent cache handling in the future.
    2930     */
    30     default void clearCachedStyle() {
    31         setCachedStyle(null);
    32     }
     31    void clearCachedStyle();
    3332
    3433    /**
    3534     * Check if the cached style for this primitive is up to date.
    3635     * @return true if the cached style for this primitive is up to date
    3736     * @since 13420
    3837     */
    39     boolean isCachedStyleUpToDate();
     38    boolean isCachedStyleUpToDate(ElemStyles styles);
    4039
    4140    /**
    4241     * Declare that the cached style for this primitive is up to date.
    4342     * @since 13420
    4443     */
    45     void declareCachedStyleUpToDate();
     44    void declareCachedStyleUpToDate(ElemStyles styles);
    4645}
  • src/org/openstreetmap/josm/data/vector/VectorPrimitive.java

    diff --git a/src/org/openstreetmap/josm/data/vector/VectorPrimitive.java b/src/org/openstreetmap/josm/data/vector/VectorPrimitive.java
    index 86af9156b5..62a0970c38 100644
    a b import java.util.Arrays;  
    55import java.util.Collections;
    66import java.util.List;
    77import java.util.Map;
     8import java.util.HashMap;
    89import java.util.function.Consumer;
    910import java.util.stream.Collectors;
    1011import java.util.stream.IntStream;
    import java.util.stream.Stream;  
    1314import org.openstreetmap.josm.data.osm.AbstractPrimitive;
    1415import org.openstreetmap.josm.data.osm.IPrimitive;
    1516import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor;
     17import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1618import org.openstreetmap.josm.gui.mappaint.StyleCache;
    1719import org.openstreetmap.josm.tools.Utils;
    1820
    import org.openstreetmap.josm.tools.Utils;  
    2426public abstract class VectorPrimitive extends AbstractPrimitive implements DataLayer<String> {
    2527    private VectorDataSet dataSet;
    2628    private boolean highlighted;
    27     private StyleCache mappaintStyle;
     29    private final Map<ElemStyles, StyleCache> mappaintStyle = new HashMap<>();
    2830    private final String layer;
    2931
    3032    /**
    public abstract class VectorPrimitive extends AbstractPrimitive implements DataL  
    7779     *--------*/
    7880
    7981    @Override
    80     public final StyleCache getCachedStyle() {
    81         return mappaintStyle;
     82    public final StyleCache getCachedStyle(ElemStyles elemStyles) {
     83        return mappaintStyle.get(elemStyles);
    8284    }
    8385
    8486    @Override
    85     public final void setCachedStyle(StyleCache mappaintStyle) {
    86         this.mappaintStyle = mappaintStyle;
     87    public final void setCachedStyle(ElemStyles elemStyles, StyleCache mappaintStyle) {
     88        this.mappaintStyle.put(elemStyles, mappaintStyle);
    8789    }
    8890
    8991    @Override
    90     public final boolean isCachedStyleUpToDate() {
    91         return mappaintStyle != null && mappaintCacheIdx == dataSet.getMappaintCacheIndex();
     92    public final boolean isCachedStyleUpToDate(ElemStyles elemStyles) {
     93        return mappaintStyle.get(elemStyles) != null && mappaintCacheIdx == dataSet.getMappaintCacheIndex();
    9294    }
    9395
    9496    @Override
    95     public final void declareCachedStyleUpToDate() {
     97    public final void declareCachedStyleUpToDate(ElemStyles elemStyles) {
    9698        this.mappaintCacheIdx = dataSet.getMappaintCacheIndex();
    9799    }
    98100
     101    public void clearCachedStyle() {
     102        this.mappaintStyle.clear();
     103    }
     104
    99105    @Override
    100106    public boolean hasDirectionKeys() {
    101107        return false;
  • src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java b/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
    index c5d417df1e..24bd541add 100644
    a b public class InspectPrimitiveDialog extends ExtendedDialog {  
    163163        }
    164164        if (sel.size() == 2) {
    165165            List<IPrimitive> selList = new ArrayList<>(sel);
    166             StyleCache sc1 = selList.get(0).getCachedStyle();
    167             StyleCache sc2 = selList.get(1).getCachedStyle();
     166            StyleCache sc1 = selList.get(0).getCachedStyle(elemstyles);
     167            StyleCache sc2 = selList.get(1).getCachedStyle(elemstyles);
    168168            if (sc1 == sc2) {
    169169                txtMappaint.println(tr("The 2 selected objects have identical style caches."));
    170170            }
  • src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    diff --git a/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java b/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
    index 83269f84fb..3a56a779bb 100644
    a b public class ElemStyles implements PreferenceChangedListener {  
    163163     */
    164164    public Pair<StyleElementList, Range> getStyleCacheWithRange(IPrimitive osm, double scale, NavigatableComponent nc) {
    165165        synchronized (osm.getStyleCacheSyncObject()) {
    166             if (!osm.isCachedStyleUpToDate() || scale <= 0) {
    167                 osm.setCachedStyle(StyleCache.EMPTY_STYLECACHE);
     166            if (!osm.isCachedStyleUpToDate(this) || scale <= 0) {
     167                osm.setCachedStyle(this, StyleCache.EMPTY_STYLECACHE);
    168168            } else {
    169                 Pair<StyleElementList, Range> lst = osm.getCachedStyle().getWithRange(scale, osm.isSelected());
     169                Pair<StyleElementList, Range> lst = osm.getCachedStyle(this).getWithRange(scale, osm.isSelected());
    170170                if (lst.a != null)
    171171                    return lst;
    172172            }
    public class ElemStyles implements PreferenceChangedListener {  
    216216                    p.a = new StyleElementList(p.a, line);
    217217                }
    218218            }
    219             StyleCache style = osm.getCachedStyle() != null ? osm.getCachedStyle() : StyleCache.EMPTY_STYLECACHE;
     219            StyleCache style = osm.getCachedStyle(this) != null ? osm.getCachedStyle(this) : StyleCache.EMPTY_STYLECACHE;
    220220            try {
    221                 osm.setCachedStyle(style.put(p.a, p.b, osm.isSelected()));
     221                osm.setCachedStyle(this, style.put(p.a, p.b, osm.isSelected()));
    222222            } catch (RangeViolatedError e) {
    223223                throw new AssertionError("Range violated: " + e.getMessage()
    224                   + " (object: " + osm.getPrimitiveId() + ", current style: " + osm.getCachedStyle()
     224                  + " (object: " + osm.getPrimitiveId() + ", current style: " + osm.getCachedStyle(this)
    225225                  + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b + ')', e);
    226226            }
    227             osm.declareCachedStyleUpToDate();
     227            osm.declareCachedStyleUpToDate(this);
    228228            return p;
    229229        }
    230230    }
  • test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java

    diff --git a/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java b/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java
    index 745bac76f4..8177c7b25e 100644
    a b class StyleCacheTest {  
    153153        Rendering visitor = new StyledMapRenderer(g, nc, false);
    154154        nc.zoomTo(bounds);
    155155        visitor.render(dsCity2, true, bounds);
     156        ElemStyles elemStyles = MapPaintStyles.getStyles();
    156157
    157158        IdentityHashMap<StyleElementList, Integer> counter = new IdentityHashMap<>();
    158159        int noPrimitives = 0;
    159160        for (OsmPrimitive osm : dsCity2.allPrimitives()) {
    160161            // primitives, that have been rendered, should have the cache populated
    161             if (osm.getCachedStyle() != null) {
     162            if (osm.getCachedStyle(elemStyles) != null) {
    162163                noPrimitives++;
    163                 Pair<StyleElementList, Range> p = osm.getCachedStyle().getWithRange(nc.getDist100Pixel(), false);
     164                Pair<StyleElementList, Range> p = osm.getCachedStyle(elemStyles).getWithRange(nc.getDist100Pixel(), false);
    164165                StyleElementList sel = p.a;
    165166                assertNotNull(sel);
    166167                counter.merge(sel, 1, Integer::sum);
  • test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java b/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java
    index 7ea4e45537..ee0f43fb06 100644
    a b import org.openstreetmap.josm.data.osm.User;  
    2323import org.openstreetmap.josm.data.osm.Way;
    2424import org.openstreetmap.josm.data.osm.WayData;
    2525import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     26import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2627import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2728import org.openstreetmap.josm.testutils.annotations.I18n;
    2829
    class AddPrimitivesCommandTest {  
    366367                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    367368            .withPrefabValues(OsmDataLayer.class,
    368369                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     370            .withPrefabValues(ElemStyles.class,
     371                new ElemStyles(), new ElemStyles())
    369372            .suppress(Warning.NONFINAL_FIELDS)
    370373            .verify();
    371374    }
  • test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java
    index 672fa6b5c0..be942391f2 100644
    a b import org.openstreetmap.josm.data.osm.OsmPrimitive;  
    1515import org.openstreetmap.josm.data.osm.RelationMember;
    1616import org.openstreetmap.josm.data.osm.User;
    1717import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     18import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1819import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1920import org.openstreetmap.josm.testutils.annotations.I18n;
    2021
    class ChangeMembersCommandTest {  
    102103                new Node(1), new Node(2))
    103104            .withPrefabValues(OsmDataLayer.class,
    104105                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     106            .withPrefabValues(ElemStyles.class,
     107                new ElemStyles(), new ElemStyles())
    105108            .suppress(Warning.NONFINAL_FIELDS)
    106109            .verify();
    107110    }
  • test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java
    index 673ef37792..64fc0c9b82 100644
    a b import org.openstreetmap.josm.data.osm.OsmPrimitive;  
    2121import org.openstreetmap.josm.data.osm.User;
    2222import org.openstreetmap.josm.data.osm.Way;
    2323import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     24import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2425import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2526import org.openstreetmap.josm.testutils.annotations.I18n;
    2627
    class ChangeNodesCommandTest {  
    131132                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    132133            .withPrefabValues(OsmDataLayer.class,
    133134                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     135            .withPrefabValues(ElemStyles.class,
     136                    new ElemStyles(), new ElemStyles())
    134137            .suppress(Warning.NONFINAL_FIELDS)
    135138            .verify();
    136139    }
  • test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java
    index a9eabd7949..1809099875 100644
    a b import org.openstreetmap.josm.data.osm.TagMap;  
    2323import org.openstreetmap.josm.data.osm.User;
    2424import org.openstreetmap.josm.data.osm.Way;
    2525import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     26import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2627import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2728import org.openstreetmap.josm.testutils.annotations.I18n;
    2829
    class ChangePropertyCommandTest {  
    281282                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    282283            .withPrefabValues(OsmDataLayer.class,
    283284                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     285            .withPrefabValues(ElemStyles.class,
     286                new ElemStyles(), new ElemStyles())
    284287            .suppress(Warning.NONFINAL_FIELDS)
    285288            .verify();
    286289    }
  • test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java
    index 876fc20318..84a078420d 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    1717import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1818import org.openstreetmap.josm.data.osm.User;
    1919import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     20import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2021import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2122import org.openstreetmap.josm.testutils.annotations.I18n;
    2223
    class ChangePropertyKeyCommandTest {  
    152153                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    153154            .withPrefabValues(OsmDataLayer.class,
    154155                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     156            .withPrefabValues(ElemStyles.class,
     157                new ElemStyles(), new ElemStyles())
    155158            .suppress(Warning.NONFINAL_FIELDS)
    156159            .verify();
    157160    }
  • test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java
    index 80a7921537..37cf1c3ed9 100644
    a b import org.openstreetmap.josm.data.osm.OsmPrimitive;  
    1616import org.openstreetmap.josm.data.osm.Relation;
    1717import org.openstreetmap.josm.data.osm.User;
    1818import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     19import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1920import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2021import org.openstreetmap.josm.testutils.annotations.I18n;
    2122
    class ChangeRelationMemberRoleCommandTest {  
    151152                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    152153            .withPrefabValues(OsmDataLayer.class,
    153154                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     155            .withPrefabValues(ElemStyles.class,
     156                new ElemStyles(), new ElemStyles())
    154157            .suppress(Warning.NONFINAL_FIELDS)
    155158            .verify();
    156159    }
  • test/unit/org/openstreetmap/josm/command/CommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/CommandTest.java b/test/unit/org/openstreetmap/josm/command/CommandTest.java
    index 7c166fee99..49f4a9a861 100644
    a b import org.openstreetmap.josm.data.osm.User;  
    1414import org.openstreetmap.josm.data.osm.Way;
    1515import org.openstreetmap.josm.gui.MainApplication;
    1616import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     17import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1718import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1819import org.openstreetmap.josm.testutils.annotations.I18n;
    1920
    public class CommandTest {  
    4041                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    4142            .withPrefabValues(OsmDataLayer.class,
    4243                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     44            .withPrefabValues(ElemStyles.class,
     45                new ElemStyles(), new ElemStyles())
    4346            .suppress(Warning.NONFINAL_FIELDS)
    4447            .verify();
    4548    }
  • test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java b/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java
    index 02e541e7a5..67907b5097 100644
    a b import org.openstreetmap.josm.data.osm.User;  
    2323import org.openstreetmap.josm.data.osm.Way;
    2424import org.openstreetmap.josm.data.osm.WaySegment;
    2525import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     26import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2627import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2728import org.openstreetmap.josm.testutils.annotations.I18n;
    2829
    class DeleteCommandTest {  
    382383                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    383384            .withPrefabValues(OsmDataLayer.class,
    384385                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     386            .withPrefabValues(ElemStyles.class,
     387                new ElemStyles(), new ElemStyles())
    385388            .suppress(Warning.NONFINAL_FIELDS)
    386389            .verify();
    387390    }
  • test/unit/org/openstreetmap/josm/command/MoveCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java b/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java
    index 2097e329af..eff2aa6e56 100644
    a b import org.openstreetmap.josm.data.osm.OsmPrimitive;  
    2323import org.openstreetmap.josm.data.osm.User;
    2424import org.openstreetmap.josm.data.projection.ProjectionRegistry;
    2525import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     26import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2627import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2728import org.openstreetmap.josm.testutils.annotations.I18n;
    2829import org.openstreetmap.josm.testutils.annotations.Projection;
    class MoveCommandTest {  
    268269                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    269270            .withPrefabValues(OsmDataLayer.class,
    270271                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     272            .withPrefabValues(ElemStyles.class,
     273                new ElemStyles(), new ElemStyles())
    271274            .suppress(Warning.NONFINAL_FIELDS)
    272275            .verify();
    273276    }
  • test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java b/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java
    index 2d65a63682..de8532c64c 100644
    a b import org.openstreetmap.josm.data.osm.RelationMember;  
    2424import org.openstreetmap.josm.data.osm.Storage;
    2525import org.openstreetmap.josm.data.osm.User;
    2626import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     27import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2728import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2829
    2930import nl.jqno.equalsverifier.EqualsVerifier;
    class PurgeCommandTest {  
    150151                    new Conflict<>(new Node(1, 1), new Node(3, 1)))
    151152            .withPrefabValues(OsmDataLayer.class,
    152153                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     154            .withPrefabValues(ElemStyles.class,
     155                new ElemStyles(), new ElemStyles())
    153156            .withPrefabValues(Hash.class,
    154157                Storage.<OsmPrimitive>defaultHash(), Storage.<OsmPrimitive>defaultHash())
    155158            .suppress(Warning.NONFINAL_FIELDS)
  • test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java b/test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java
    index 4dacadcbe0..5e19b34cde 100644
    a b import org.openstreetmap.josm.data.osm.OsmPrimitive;  
    1515import org.openstreetmap.josm.data.osm.User;
    1616import org.openstreetmap.josm.data.osm.Way;
    1717import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     18import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1819import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1920
    2021import nl.jqno.equalsverifier.EqualsVerifier;
    class RemoveNodesCommandTest {  
    126127                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    127128            .withPrefabValues(OsmDataLayer.class,
    128129                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     130            .withPrefabValues(ElemStyles.class,
     131                    new ElemStyles(), new ElemStyles())
    129132            .suppress(Warning.NONFINAL_FIELDS)
    130133            .verify();
    131134    }
  • test/unit/org/openstreetmap/josm/command/RotateCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java b/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java
    index 445f33717d..6189700a97 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    1919import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2020import org.openstreetmap.josm.data.osm.User;
    2121import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     22import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2223import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2324import org.openstreetmap.josm.testutils.annotations.Projection;
    2425
    class RotateCommandTest {  
    138139                .withPrefabValues(User.class, User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    139140                .withPrefabValues(OsmDataLayer.class, new OsmDataLayer(new DataSet(), "1", null),
    140141                        new OsmDataLayer(new DataSet(), "2", null))
     142                .withPrefabValues(ElemStyles.class,
     143                        new ElemStyles(), new ElemStyles())
    141144                .suppress(Warning.NONFINAL_FIELDS).verify();
    142145    }
    143146}
  • test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java b/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java
    index eff1559a15..5784b6a85f 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    1919import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2020import org.openstreetmap.josm.data.osm.User;
    2121import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     22import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2223import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2324import org.openstreetmap.josm.testutils.annotations.Projection;
    2425
    class ScaleCommandTest {  
    141142                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    142143            .withPrefabValues(OsmDataLayer.class,
    143144                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     145            .withPrefabValues(ElemStyles.class,
     146                new ElemStyles(), new ElemStyles())
    144147            .suppress(Warning.NONFINAL_FIELDS)
    145148            .verify();
    146149    }
  • test/unit/org/openstreetmap/josm/command/SelectCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java b/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java
    index c61e85892e..b29f12cc79 100644
    a b import org.openstreetmap.josm.data.osm.DataSet;  
    1616import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1717import org.openstreetmap.josm.data.osm.User;
    1818import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     19import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1920import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2021
    2122import nl.jqno.equalsverifier.EqualsVerifier;
    class SelectCommandTest {  
    151152                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    152153            .withPrefabValues(OsmDataLayer.class,
    153154                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     155            .withPrefabValues(ElemStyles.class,
     156                new ElemStyles(), new ElemStyles())
    154157            .suppress(Warning.NONFINAL_FIELDS)
    155158            .verify();
    156159    }
  • test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java b/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java
    index 71b7941ffa..d1a37f1571 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    2525import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2626import org.openstreetmap.josm.data.osm.User;
    2727import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     28import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2829import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2930import org.openstreetmap.josm.tools.bugreport.ReportedException;
    3031
    class SequenceCommandTest {  
    223224                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    224225            .withPrefabValues(OsmDataLayer.class,
    225226                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     227            .withPrefabValues(ElemStyles.class,
     228                    new ElemStyles(), new ElemStyles())
    226229            .suppress(Warning.NONFINAL_FIELDS)
    227230            .verify();
    228231    }
  • test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.java b/test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.java
    index b7211958e7..912cb10b15 100644
    a b import org.openstreetmap.josm.gui.layer.OsmDataLayer;  
    1010
    1111import nl.jqno.equalsverifier.EqualsVerifier;
    1212import nl.jqno.equalsverifier.Warning;
     13import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1314
    1415/**
    1516 * Unit tests of {@link TransformNodesCommand} class.
    class TransformNodesCommandTest {  
    3031                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    3132            .withPrefabValues(OsmDataLayer.class,
    3233                new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     34            .withPrefabValues(ElemStyles.class,
     35                new ElemStyles(), new ElemStyles())
    3336            .suppress(Warning.NONFINAL_FIELDS)
    3437            .verify();
    3538    }
  • test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
    index 8caa468de4..58e1d30e21 100644
    a b import org.openstreetmap.josm.gui.layer.OsmDataLayer;  
    1818
    1919import nl.jqno.equalsverifier.EqualsVerifier;
    2020import nl.jqno.equalsverifier.Warning;
     21import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2122
    2223/**
    2324 * Unit tests of {@link ConflictAddCommand} class.
    class ConflictAddCommandTest {  
    7374                    new Conflict<>(new Node(), new Node()), new Conflict<>(new Way(), new Way()))
    7475            .withPrefabValues(OsmDataLayer.class,
    7576                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     77            .withPrefabValues(ElemStyles.class,
     78                    new ElemStyles(), new ElemStyles())
    7679            .suppress(Warning.NONFINAL_FIELDS)
    7780            .verify();
    7881    }
  • test/unit/org/openstreetmap/josm/command/conflict/ConflictResolveCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/conflict/ConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/ConflictResolveCommandTest.java
    index 51c3caaa1e..a8c9e35926 100644
    a b import org.openstreetmap.josm.gui.layer.OsmDataLayer;  
    1111
    1212import nl.jqno.equalsverifier.EqualsVerifier;
    1313import nl.jqno.equalsverifier.Warning;
     14import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1415
    1516/**
    1617 * Unit tests of {@link ConflictResolveCommand} class.
    class ConflictResolveCommandTest {  
    3233                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    3334            .withPrefabValues(OsmDataLayer.class,
    3435                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     36            .withPrefabValues(ElemStyles.class,
     37                    new ElemStyles(), new ElemStyles())
    3538            .suppress(Warning.NONFINAL_FIELDS)
    3639            .verify();
    3740    }
  • test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java
    index dedbb28180..d010c9867a 100644
    a b import org.openstreetmap.josm.gui.layer.OsmDataLayer;  
    2020
    2121import nl.jqno.equalsverifier.EqualsVerifier;
    2222import nl.jqno.equalsverifier.Warning;
     23import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    2324
    2425/**
    2526 * Unit tests of {@link CoordinateConflictResolveCommand} class.
    class CoordinateConflictResolveCommandTest {  
    9091                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    9192            .withPrefabValues(OsmDataLayer.class,
    9293                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     94            .withPrefabValues(ElemStyles.class,
     95                    new ElemStyles(), new ElemStyles())
    9396            .suppress(Warning.NONFINAL_FIELDS)
    9497            .verify();
    9598    }
  • test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java
    index cb44246e68..95c001a5b4 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    99import org.openstreetmap.josm.data.osm.User;
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
    1415import nl.jqno.equalsverifier.EqualsVerifier;
    class DeletedStateConflictResolveCommandTest {  
    3435                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
    3942    }
  • test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java
    index 0f58740f0a..37de778150 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    99import org.openstreetmap.josm.data.osm.User;
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
    1415import nl.jqno.equalsverifier.EqualsVerifier;
    class ModifiedConflictResolveCommandTest {  
    3435                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
    3942    }
  • test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java
    index 18e6266aaf..db5a1fa3b2 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    99import org.openstreetmap.josm.data.osm.Relation;
    1010import org.openstreetmap.josm.data.osm.User;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
    1415import nl.jqno.equalsverifier.EqualsVerifier;
    class RelationMemberConflictResolverCommandTest {  
    3637                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    3738            .withPrefabValues(OsmDataLayer.class,
    3839                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     40            .withPrefabValues(ElemStyles.class,
     41                    new ElemStyles(), new ElemStyles())
    3942            .suppress(Warning.NONFINAL_FIELDS)
    4043            .verify();
    4144    }
  • test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java
    index 2445caf4c1..42dfc4928f 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    99import org.openstreetmap.josm.data.osm.User;
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
    1415import nl.jqno.equalsverifier.EqualsVerifier;
    class TagConflictResolveCommandTest {  
    3435                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
    3942    }
  • test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java
    index e30b948e83..a21f4e8732 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    99import org.openstreetmap.josm.data.osm.User;
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
    1415import nl.jqno.equalsverifier.EqualsVerifier;
    class VersionConflictResolveCommandTest {  
    3435                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
    3942    }
  • test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java

    diff --git a/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java
    index 6c44982301..3c971d3803 100644
    a b import org.openstreetmap.josm.data.osm.Node;  
    99import org.openstreetmap.josm.data.osm.User;
    1010import org.openstreetmap.josm.data.osm.Way;
    1111import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     12import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    1213import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
    1314
    1415import nl.jqno.equalsverifier.EqualsVerifier;
    class WayNodesConflictResolverCommandTest {  
    3435                    User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
    3536            .withPrefabValues(OsmDataLayer.class,
    3637                    new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
     38            .withPrefabValues(ElemStyles.class,
     39                    new ElemStyles(), new ElemStyles())
    3740            .suppress(Warning.NONFINAL_FIELDS)
    3841            .verify();
    3942    }