Changeset 13543 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2018-03-19T00:22:20+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r12990 r13543 13 13 import java.text.Collator; 14 14 import java.util.ArrayList; 15 import java.util.HashMap;16 15 import java.util.List; 17 16 import java.util.Map; … … 38 37 39 38 import org.openstreetmap.josm.Main; 39 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 40 40 import org.openstreetmap.josm.data.preferences.ColorInfo; 41 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;42 41 import org.openstreetmap.josm.data.preferences.NamedColorProperty; 43 42 import org.openstreetmap.josm.data.validation.Severity; … … 265 264 266 265 /** 267 * Set the colors to be shown in the preference table. This method creates a table model if268 * none exists and overwrites all existing values.269 * @param colorMap the map holding the colors270 * (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 @Deprecated275 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 /**281 266 * Returns a map with the colors in the table (key = preference key, value = color info). 282 267 * @return a map holding the colors. … … 284 269 public Map<String, ColorInfo> getColors() { 285 270 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 @Deprecated294 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;300 271 } 301 272
Note:
See TracChangeset
for help on using the changeset viewer.