Index: trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java	(revision 13635)
+++ trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java	(revision 13636)
@@ -11,5 +11,5 @@
  * @since 4098
  */
-public interface IPrimitive extends Tagged, PrimitiveId {
+public interface IPrimitive extends Tagged, PrimitiveId, Stylable {
 
     /**
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 13635)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 13636)
@@ -193,49 +193,25 @@
      * MAPPAINT
      *--------*/
-    public StyleCache mappaintStyle;
+    private StyleCache mappaintStyle;
     private short mappaintCacheIdx;
 
-    /* This should not be called from outside. Fixing the UI to add relevant
-       get/set functions calling this implicitely is preferred, so we can have
-       transparent cache handling in the future. */
-    public void clearCachedStyle() {
-        mappaintStyle = null;
-    }
-
-    /**
-     * Check if the cached style for this primitive is up to date.
-     * @return true if the cached style for this primitive is up to date
-     * @since 13420
-     */
+    @Override
+    public final StyleCache getCachedStyle() {
+        return mappaintStyle;
+    }
+
+    @Override
+    public final void setCachedStyle(StyleCache mappaintStyle) {
+        this.mappaintStyle = mappaintStyle;
+    }
+
+    @Override
     public final boolean isCachedStyleUpToDate() {
         return mappaintStyle != null && mappaintCacheIdx == dataSet.getMappaintCacheIndex();
     }
 
-    /**
-     * Declare that the cached style for this primitive is up to date.
-     * @since 13420
-     */
+    @Override
     public final void declareCachedStyleUpToDate() {
         this.mappaintCacheIdx = dataSet.getMappaintCacheIndex();
-    }
-
-    /**
-     * Returns mappaint cache index.
-     * @return mappaint cache index
-     * @deprecated no longer supported (see also {@link #isCachedStyleUpToDate()})
-     */
-    @Deprecated
-    public final short getMappaintCacheIdx() {
-        return mappaintCacheIdx;
-    }
-
-    /**
-     * Sets the mappaint cache index.
-     * @param mappaintCacheIdx mappaint cache index
-     * @deprecated no longer supported (see also {@link #declareCachedStyleUpToDate()})
-     */
-    @Deprecated
-    public final void setMappaintCacheIdx(short mappaintCacheIdx) {
-        this.mappaintCacheIdx = mappaintCacheIdx;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java	(revision 13635)
+++ trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java	(revision 13636)
@@ -11,4 +11,6 @@
 import java.util.List;
 import java.util.Map;
+
+import org.openstreetmap.josm.gui.mappaint.StyleCache;
 
 /**
@@ -130,3 +132,23 @@
         ois.defaultReadObject();
     }
+
+    @Override
+    public StyleCache getCachedStyle() {
+        return null;
+    }
+
+    @Override
+    public void setCachedStyle(StyleCache mappaintStyle) {
+        // Override if needed
+    }
+
+    @Override
+    public boolean isCachedStyleUpToDate() {
+        return false;
+    }
+
+    @Override
+    public void declareCachedStyleUpToDate() {
+        // Override if needed
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/Stylable.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Stylable.java	(revision 13636)
+++ trunk/src/org/openstreetmap/josm/data/osm/Stylable.java	(revision 13636)
@@ -0,0 +1,46 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+import org.openstreetmap.josm.gui.mappaint.StyleCache;
+
+/**
+ * Object that can be rendered using a cachable style.
+ * @since 13636
+ */
+public interface Stylable {
+
+    /**
+     * Returns the cached style.
+     * @return the cached style
+     */
+    StyleCache getCachedStyle();
+
+    /**
+     * Sets the cached style.
+     * @param mappaintStyle the cached style
+     */
+    void setCachedStyle(StyleCache mappaintStyle);
+
+    /**
+     * Clears the cached style.
+     * This should not be called from outside. Fixing the UI to add relevant
+     * get/set functions calling this implicitely is preferred, so we can have
+     * transparent cache handling in the future.
+     */
+    default void clearCachedStyle() {
+        setCachedStyle(null);
+    }
+
+    /**
+     * Check if the cached style for this primitive is up to date.
+     * @return true if the cached style for this primitive is up to date
+     * @since 13420
+     */
+    boolean isCachedStyleUpToDate();
+
+    /**
+     * Declare that the cached style for this primitive is up to date.
+     * @since 13420
+     */
+    void declareCachedStyleUpToDate();
+}
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 13635)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 13636)
@@ -151,6 +151,6 @@
         if (sel.size() == 2) {
             List<OsmPrimitive> selList = new ArrayList<>(sel);
-            StyleCache sc1 = selList.get(0).mappaintStyle;
-            StyleCache sc2 = selList.get(1).mappaintStyle;
+            StyleCache sc1 = selList.get(0).getCachedStyle();
+            StyleCache sc2 = selList.get(1).getCachedStyle();
             if (sc1 == sc2) {
                 txtMappaint.append(tr("The 2 selected objects have identical style caches."));
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 13635)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 13636)
@@ -105,4 +105,8 @@
     }
 
+    /**
+     * Returns the background color.
+     * @return the background color
+     */
     public Color getBackgroundColor() {
         if (backgroundColorCache != null)
@@ -144,7 +148,7 @@
     public Pair<StyleElementList, Range> getStyleCacheWithRange(OsmPrimitive osm, double scale, NavigatableComponent nc) {
         if (!osm.isCachedStyleUpToDate() || scale <= 0) {
-            osm.mappaintStyle = StyleCache.EMPTY_STYLECACHE;
+            osm.setCachedStyle(StyleCache.EMPTY_STYLECACHE);
         } else {
-            Pair<StyleElementList, Range> lst = osm.mappaintStyle.getWithRange(scale, osm.isSelected());
+            Pair<StyleElementList, Range> lst = osm.getCachedStyle().getWithRange(scale, osm.isSelected());
             if (lst.a != null)
                 return lst;
@@ -191,10 +195,10 @@
             }
         }
-        StyleCache style = osm.mappaintStyle != null ? osm.mappaintStyle : StyleCache.EMPTY_STYLECACHE;
+        StyleCache style = osm.getCachedStyle() != null ? osm.getCachedStyle() : StyleCache.EMPTY_STYLECACHE;
         try {
-            osm.mappaintStyle = style.put(p.a, p.b, osm.isSelected());
+            osm.setCachedStyle(style.put(p.a, p.b, osm.isSelected()));
         } catch (RangeViolatedError e) {
             throw new AssertionError("Range violated: " + e.getMessage()
-                    + " (object: " + osm.getPrimitiveId() + ", current style: "+osm.mappaintStyle
+                    + " (object: " + osm.getPrimitiveId() + ", current style: "+osm.getCachedStyle()
                     + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b + ')', e);
         }
@@ -462,8 +466,16 @@
     }
 
+    /**
+     * Determines whether multipolygons must be drawn.
+     * @return whether multipolygons must be drawn.
+     */
     public boolean isDrawMultipolygon() {
         return drawMultipolygon;
     }
 
+    /**
+     * Sets whether multipolygons must be drawn.
+     * @param drawMultipolygon whether multipolygons must be drawn
+     */
     public void setDrawMultipolygon(boolean drawMultipolygon) {
         this.drawMultipolygon = drawMultipolygon;
