Ignore:
Timestamp:
2017-05-13T12:58:12+02:00 (3 years ago)
Author:
bastiK
Message:

see #14773 - improve session export/import for imagery layer offset data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java

    r12118 r12134  
    99import java.util.List;
    1010import java.util.ListIterator;
     11import java.util.Map;
    1112
    1213import org.openstreetmap.josm.Main;
     14import org.openstreetmap.josm.data.Preferences;
    1315import org.openstreetmap.josm.data.Preferences.pref;
    1416import org.openstreetmap.josm.data.Preferences.writeExplicitly;
     
    262264        saveBookmarks();
    263265    }
     266
     267    /**
     268     * Converts the offset bookmark to a properties map.
     269     *
     270     * The map contains all the information to restore the offset bookmark.
     271     * @return properties map of all data
     272     * @since 12134
     273     * @see #fromPropertiesMap(java.util.Map)
     274     */
     275    public Map<String, String> toPropertiesMap() {
     276        return Preferences.serializeStruct(this, OffsetBookmark.class);
     277    }
     278
     279    /**
     280     * Creates an offset bookmark from a properties map.
     281     * @param properties the properties map
     282     * @return corresponding offset bookmark
     283     * @since 12134
     284     * @see #toPropertiesMap()
     285     */
     286    public static OffsetBookmark fromPropertiesMap(Map<String, String> properties) {
     287        return Preferences.deserializeStruct(properties, OffsetBookmark.class);
     288    }
    264289}
Note: See TracChangeset for help on using the changeset viewer.