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 booleanignoreRepaintprivate java.util.Set<MapViewPaintable>invalidatedLayers
-
Constructor Summary
Constructors Modifier Constructor Description privateLayerInvalidatedListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTo(MapViewPaintable p)Temporary until allMapViewPaintables 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.voidinvalidate(MapViewPaintable mapViewPaintable)Invalidate contents and repaint map viewvoidpaintableInvalidated(MapViewPaintable.PaintableInvalidationEvent event)Called whenever aMapViewPaintable.PaintableInvalidationEventis fired.voidremoveFrom(MapViewPaintable p)Temporary until allMapViewPaintables support this.private voidtraceRandomRepaint()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.PaintableInvalidationListenerCalled whenever aMapViewPaintable.PaintableInvalidationEventis fired. This might be called from any thread.- Specified by:
paintableInvalidatedin 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 allMapViewPaintables support this.- Parameters:
p- The paintable.
-
removeFrom
public void removeFrom(MapViewPaintable p)
Temporary until allMapViewPaintables 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
-
-