Changeset 11493 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
- Timestamp:
- 2017-01-25T14:12:07+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r11401 r11493 290 290 291 291 private static StyleSource fromSourceEntry(SourceEntry entry) { 292 if (entry.url == null && entry instanceof MapCSSStyleSource) { 293 return (MapCSSStyleSource) entry; 294 } 292 295 Set<String> mimes = new HashSet<>(Arrays.asList(MapCSSStyleSource.MAPCSS_STYLE_MIME_TYPES.split(", "))); 293 296 try (CachedFile cf = new CachedFile(entry.url).setHttpAccept(Utils.join(", ", mimes))) { … … 419 422 styles.add(source); 420 423 loadStyleForFirstTime(source); 424 refreshStyles(); 425 return source; 426 } 427 428 /** 429 * Remove a map paint style. 430 * @param entry map paint style 431 * @since 11493 432 */ 433 public static void removeStyle(SourceEntry entry) { 434 StyleSource source = fromSourceEntry(entry); 435 if (styles.remove(source)) { 436 refreshStyles(); 437 } 438 } 439 440 private static void refreshStyles() { 421 441 MapPaintPrefHelper.INSTANCE.put(styles.getStyleSources()); 422 442 fireMapPaintSylesUpdated(); … … 425 445 Main.map.mapView.repaint(); 426 446 } 427 return source;428 447 } 429 448
Note:
See TracChangeset
for help on using the changeset viewer.