Package org.openstreetmap.josm.gui
Class MapView.LayerInvalidatedListener
- java.lang.Object
-
- org.openstreetmap.josm.gui.MapView.LayerInvalidatedListener
-
- All Implemented Interfaces:
MapViewPaintable.PaintableInvalidationListener
- Enclosing class:
- MapView
private final class MapView.LayerInvalidatedListener extends java.lang.Object implements MapViewPaintable.PaintableInvalidationListener
An invalidation listener that simply calls repaint() for now.- Since:
- 10271
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
ignoreRepaint
private java.util.Set<MapViewPaintable>
invalidatedLayers
-
Constructor Summary
Constructors Modifier Constructor Description private
LayerInvalidatedListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTo(MapViewPaintable p)
Temporary until allMapViewPaintable
s support this.private java.util.Set<MapViewPaintable>
collectInvalidatedLayers()
Retrieves a set of all layers that have been marked as invalid since the last call to this method.void
invalidate(MapViewPaintable mapViewPaintable)
Invalidate contents and repaint map viewvoid
paintableInvalidated(MapViewPaintable.PaintableInvalidationEvent event)
Called whenever aMapViewPaintable.PaintableInvalidationEvent
is fired.void
removeFrom(MapViewPaintable p)
Temporary until allMapViewPaintable
s support this.private void
traceRandomRepaint()
Attempts to trace repaints that did not originate from this listener.
-
-
-
Field Detail
-
ignoreRepaint
private boolean ignoreRepaint
-
invalidatedLayers
private final java.util.Set<MapViewPaintable> invalidatedLayers
-
-
Constructor Detail
-
LayerInvalidatedListener
private LayerInvalidatedListener()
-
-
Method Detail
-
paintableInvalidated
public void paintableInvalidated(MapViewPaintable.PaintableInvalidationEvent event)
Description copied from interface:MapViewPaintable.PaintableInvalidationListener
Called whenever aMapViewPaintable.PaintableInvalidationEvent
is fired. This might be called from any thread.- Specified by:
paintableInvalidated
in interfaceMapViewPaintable.PaintableInvalidationListener
- Parameters:
event
- The event
-
invalidate
public void invalidate(MapViewPaintable mapViewPaintable)
Invalidate contents and repaint map view- Parameters:
mapViewPaintable
- invalidated layer
-
addTo
public void addTo(MapViewPaintable p)
Temporary until allMapViewPaintable
s support this.- Parameters:
p
- The paintable.
-
removeFrom
public void removeFrom(MapViewPaintable p)
Temporary until allMapViewPaintable
s support this.- Parameters:
p
- The paintable.
-
traceRandomRepaint
private void traceRandomRepaint()
Attempts to trace repaints that did not originate from this listener. Good to find missedMapView.repaint()
s in code.
-
collectInvalidatedLayers
private java.util.Set<MapViewPaintable> collectInvalidatedLayers()
Retrieves a set of all layers that have been marked as invalid since the last call to this method.- Returns:
- The layers
-
-