Class ProjectionRegistry
java.lang.Object
org.openstreetmap.josm.data.projection.ProjectionRegistry
Registry for a single, global projection instance.
- Since:
- 14120
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ProjectionBoundsProviderprivate static final List<WeakReference<ProjectionChangeListener>>private static ProjectionThe projection method used. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidRegister a projection change listener.static voidRemove all projection change listeners.private static voidfireProjectionChanged(Projection oldValue, Projection newValue, Bounds oldBounds) static ProjectionBoundsProviderReturns the bounds provider called in projection events.static ProjectionReplies the current projection.static voidRemoves a projection change listener.static voidsetboundsProvider(ProjectionBoundsProvider provider) Sets the bounds provider called in projection events.static voidSets the current projection
-
Field Details
-
proj
The projection method used. UsegetProjection()andsetProjection(Projection)for access. UsesetProjection(Projection)in order to trigger a projection change event. -
boundsProvider
-
listeners
-
-
Constructor Details
-
ProjectionRegistry
private ProjectionRegistry()
-
-
Method Details
-
getProjection
Replies the current projection.- Returns:
- the currently active projection
-
setProjection
Sets the current projection- Parameters:
p- the projection
-
fireProjectionChanged
private static void fireProjectionChanged(Projection oldValue, Projection newValue, Bounds oldBounds) -
addProjectionChangeListener
Register a projection change listener. The listener is registered to be weak, so keep a reference of it if you want it to be preserved.- Parameters:
listener- the listener. Ignored ifnull.
-
removeProjectionChangeListener
Removes a projection change listener.- Parameters:
listener- the listener. Ignored ifnull.
-
clearProjectionChangeListeners
Remove all projection change listeners. For testing purposes only. -
getBoundsProvider
Returns the bounds provider called in projection events.- Returns:
- the bounds provider
-
setboundsProvider
Sets the bounds provider called in projection events. Must not be null- Parameters:
provider- the bounds provider
-