Class ImageProjectionRegistry
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.geoimage.viewers.projections.ImageProjectionRegistry
-
public final class ImageProjectionRegistry extends java.lang.Object
A class that holds a registry of viewers for image projections- Since:
- 18246
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.EnumMap<Projections,java.lang.Class<? extends IImageViewer>>
DEFAULT_VIEWERS
-
Constructor Summary
Constructors Modifier Constructor Description private
ImageProjectionRegistry()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<? extends IImageViewer>
getViewer(Projections projection)
Get the viewer for a specific projection typestatic boolean
registerViewer(java.lang.Class<? extends IImageViewer> clazz)
Register a new viewerstatic boolean
removeViewer(java.lang.Class<? extends IImageViewer> clazz)
Remove a viewer
-
-
-
Field Detail
-
DEFAULT_VIEWERS
private static final java.util.EnumMap<Projections,java.lang.Class<? extends IImageViewer>> DEFAULT_VIEWERS
-
-
Constructor Detail
-
ImageProjectionRegistry
private ImageProjectionRegistry()
-
-
Method Detail
-
registerViewer
public static boolean registerViewer(java.lang.Class<? extends IImageViewer> clazz) throws java.lang.ReflectiveOperationException
Register a new viewer- Parameters:
clazz
- The class to register. The class must have a no args constructor- Returns:
true
if something changed- Throws:
java.lang.ReflectiveOperationException
- if there is no no-args constructor, or it is not visible to us.
-
removeViewer
public static boolean removeViewer(java.lang.Class<? extends IImageViewer> clazz)
Remove a viewer- Parameters:
clazz
- The class to remove.- Returns:
true
if something changed
-
getViewer
public static java.lang.Class<? extends IImageViewer> getViewer(Projections projection)
Get the viewer for a specific projection type- Parameters:
projection
- The projection to view- Returns:
- The class to use
-
-