Package org.openstreetmap.josm.tools
Class OsmPrimitiveImageProvider
java.lang.Object
org.openstreetmap.josm.tools.OsmPrimitiveImageProvider
An
ImageProvider for OsmPrimitive- Since:
- 16838 (extracted from ImageProvider)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumOptions used ingetResource(OsmPrimitive, Collection). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<ImageResource>getResource(String key, String value, OsmPrimitiveType primitiveType) Searches for an icon for the given key/value and primitiveTypestatic ImageResourcegetResource(OsmPrimitive primitive, Collection<OsmPrimitiveImageProvider.Options> options) Returns anImageIconfor the given OSM object, at the specified size.private static ImageResourcegetResourceFromMapPaintStyles(OsmPrimitive primitive, Collection<OsmPrimitiveImageProvider.Options> options) Computes a new padded icon for the given tagged primitive, using map paint styles.
-
Constructor Details
-
OsmPrimitiveImageProvider
private OsmPrimitiveImageProvider()
-
-
Method Details
-
getResource
public static ImageResource getResource(OsmPrimitive primitive, 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, 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 Optional<ImageResource> getResource(String key, 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
-