Class MapPaintPrefHelper
- java.lang.Object
-
- org.openstreetmap.josm.data.preferences.sources.SourcePrefHelper
-
- org.openstreetmap.josm.data.preferences.sources.MapPaintPrefHelper
-
public class MapPaintPrefHelper extends SourcePrefHelper
Helper class for map paint styles preferences.- Since:
- 12649 (extracted from gui.preferences package)
-
-
Field Summary
Fields Modifier and Type Field Description static MapPaintPrefHelper
INSTANCE
The unique instance.-
Fields inherited from class org.openstreetmap.josm.data.preferences.sources.SourcePrefHelper
type
-
-
Constructor Summary
Constructors Constructor Description MapPaintPrefHelper()
Constructs a newMapPaintPrefHelper
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SourceEntry
deserialize(java.util.Map<java.lang.String,java.lang.String> s)
Deserializes the given map as a source entry.java.util.List<SourceEntry>
get()
Returns the list of sources.java.util.Collection<ExtendedSourceEntry>
getDefault()
Returns the default sources provided by JOSM core.private boolean
insertNewDefaults(java.util.List<SourceEntry> list)
If the selection of default styles changes in future releases, add the new entries to the user-configured list.java.util.Map<java.lang.String,java.lang.String>
serialize(SourceEntry entry)
Serializes the given source entry as a map.-
Methods inherited from class org.openstreetmap.josm.data.preferences.sources.SourcePrefHelper
getActiveUrls, put
-
-
-
-
Field Detail
-
INSTANCE
public static final MapPaintPrefHelper INSTANCE
The unique instance.
-
-
Constructor Detail
-
MapPaintPrefHelper
public MapPaintPrefHelper()
Constructs a newMapPaintPrefHelper
.
-
-
Method Detail
-
get
public java.util.List<SourceEntry> get()
Description copied from class:SourcePrefHelper
Returns the list of sources.- Overrides:
get
in classSourcePrefHelper
- Returns:
- The list of sources
-
insertNewDefaults
private boolean insertNewDefaults(java.util.List<SourceEntry> list)
If the selection of default styles changes in future releases, add the new entries to the user-configured list. Remember the known URLs, so an item that was deleted explicitly is not added again.- Parameters:
list
- new defaults- Returns:
true
if a change occurred
-
getDefault
public java.util.Collection<ExtendedSourceEntry> getDefault()
Description copied from class:SourcePrefHelper
Returns the default sources provided by JOSM core.- Specified by:
getDefault
in classSourcePrefHelper
- Returns:
- the default sources provided by JOSM core
-
serialize
public java.util.Map<java.lang.String,java.lang.String> serialize(SourceEntry entry)
Description copied from class:SourcePrefHelper
Serializes the given source entry as a map.- Overrides:
serialize
in classSourcePrefHelper
- Parameters:
entry
- source entry to serialize- Returns:
- map (key=value)
-
deserialize
public SourceEntry deserialize(java.util.Map<java.lang.String,java.lang.String> s)
Description copied from class:SourcePrefHelper
Deserializes the given map as a source entry.- Overrides:
deserialize
in classSourcePrefHelper
- Parameters:
s
- map (key=value)- Returns:
- source entry
-
-