Ignore:
Timestamp:
2018-03-19T00:22:20+01:00 (21 months ago)
Author:
Don-vip
Message:

see #15310 - remove deprecated color stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    r12990 r13543  
    1313import java.text.Collator;
    1414import java.util.ArrayList;
    15 import java.util.HashMap;
    1615import java.util.List;
    1716import java.util.Map;
     
    3837
    3938import org.openstreetmap.josm.Main;
     39import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
    4040import org.openstreetmap.josm.data.preferences.ColorInfo;
    41 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
    4241import org.openstreetmap.josm.data.preferences.NamedColorProperty;
    4342import org.openstreetmap.josm.data.validation.Severity;
     
    265264
    266265    /**
    267      * Set the colors to be shown in the preference table. This method creates a table model if
    268      * none exists and overwrites all existing values.
    269      * @param colorMap the map holding the colors
    270      * (key = color id (without prefixes, so only <code>background</code>; not <code>color.background</code>),
    271      * value = html representation of the color.
    272      * @deprecated (since 12987) replaced by {@link #setColors(java.util.Map)}
    273      */
    274     @Deprecated
    275     public void setColorModel(Map<String, String> colorMap) {
    276         setColors(colorMap.entrySet().stream().collect(Collectors.toMap(e->e.getKey(), e->
    277             new ColorInfo(NamedColorProperty.COLOR_CATEGORY_GENERAL, null, e.getKey(), ColorHelper.html2color(e.getValue()), null))));
    278     }
    279 
    280     /**
    281266     * Returns a map with the colors in the table (key = preference key, value = color info).
    282267     * @return a map holding the colors.
     
    284269    public Map<String, ColorInfo> getColors() {
    285270        return tableModel.getData().stream().collect(Collectors.toMap(e -> e.key, e -> e.info));
    286     }
    287 
    288     /**
    289      * Returns a map with the colors in the table (key = color name without prefix, value = html color code).
    290      * @return a map holding the colors.
    291      * @deprecated replaced by {@link #getColors()}
    292      */
    293     @Deprecated
    294     public Map<String, String> getColorModel() {
    295         Map<String, String> colorMap = new HashMap<>();
    296         for (ColorEntry e : tableModel.getData()) {
    297             colorMap.put(e.key, ColorHelper.color2html(e.getDisplayColor()));
    298         }
    299         return colorMap;
    300271    }
    301272
Note: See TracChangeset for help on using the changeset viewer.