Package org.openstreetmap.josm.tools
Class OsmPrimitiveImageProvider
- java.lang.Object
-
- org.openstreetmap.josm.tools.OsmPrimitiveImageProvider
-
public final class OsmPrimitiveImageProvider extends java.lang.Object
AnImageProviderforOsmPrimitive- Since:
- 16838 (extracted from ImageProvider)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOsmPrimitiveImageProvider.OptionsOptions used ingetResource(OsmPrimitive, Collection).
-
Constructor Summary
Constructors Modifier Constructor Description privateOsmPrimitiveImageProvider()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<ImageResource>getResource(java.lang.String key, java.lang.String value, OsmPrimitiveType primitiveType)Searches for an icon for the given key/value and primitiveTypestatic ImageResourcegetResource(OsmPrimitive primitive, java.util.Collection<OsmPrimitiveImageProvider.Options> options)Returns anImageIconfor the given OSM object, at the specified size.private static ImageResourcegetResourceFromMapPaintStyles(OsmPrimitive primitive, java.util.Collection<OsmPrimitiveImageProvider.Options> options)Computes a new padded icon for the given tagged primitive, using map paint styles.
-
-
-
Constructor Detail
-
OsmPrimitiveImageProvider
private OsmPrimitiveImageProvider()
-
-
Method Detail
-
getResource
public static ImageResource getResource(OsmPrimitive primitive, java.util.Collection<OsmPrimitiveImageProvider.Options> options)
Returns anImageIconfor the given OSM object, at the specified size. This is a slow operation.- Parameters:
primitive- Object for which an icon shall be fetched. The icon is chosen based on tags.options- zero or more options.- Returns:
- Icon for
primitivethat fits in cell ornull. - Since:
- 15889
-
getResourceFromMapPaintStyles
private static ImageResource getResourceFromMapPaintStyles(OsmPrimitive primitive, java.util.Collection<OsmPrimitiveImageProvider.Options> options)
Computes a new padded icon for the given tagged primitive, using map paint styles. This is a slow operation.- Parameters:
primitive- tagged OSM primitiveoptions- zero or more options.- Returns:
- a new padded icon for the given tagged primitive, or null
-
getResource
public static java.util.Optional<ImageResource> getResource(java.lang.String key, java.lang.String value, OsmPrimitiveType primitiveType)
Searches for an icon for the given key/value and primitiveType- Parameters:
key- The tag keyvalue- The tag valueprimitiveType- The type of the primitive- Returns:
- an icon for the given key/value and primitiveType
-
-