Package org.openstreetmap.josm.gui.layer
Class AbstractTileSourceLayer.TileSourcePainter
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable.CompatibilityModeLayerPainter
-
- org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer.TileSourcePainter
-
- All Implemented Interfaces:
MapViewPaintable.LayerPainter
- Enclosing class:
- AbstractTileSourceLayer<T extends org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource>
private final class AbstractTileSourceLayer.TileSourcePainter extends AbstractMapViewPaintable.CompatibilityModeLayerPainter
-
-
Field Summary
Fields Modifier and Type Field Description private MemoryManager.MemoryHandle<?>
memory
The memory handle that will hold our tile source.
-
Constructor Summary
Constructors Modifier Constructor Description private
TileSourcePainter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
allocateCacheMemory()
void
detachFromMapView(MapViewPaintable.MapViewEvent event)
Called when the layer is removed from the map view and this painter is not used any more.private void
doPaint(MapViewGraphics graphics)
private long
getEstimatedCacheSize()
void
paint(MapViewGraphics graphics)
Paints the given layer.
-
-
-
Field Detail
-
memory
private MemoryManager.MemoryHandle<?> memory
The memory handle that will hold our tile source.
-
-
Constructor Detail
-
TileSourcePainter
private TileSourcePainter()
-
-
Method Detail
-
paint
public void paint(MapViewGraphics graphics)
Description copied from interface:MapViewPaintable.LayerPainter
Paints the given layer.This can be called in any thread at any time. You will not receive parallel calls for the same map view but you can receive parallel calls if you use the same
MapViewPaintable.LayerPainter
for different map views.- Specified by:
paint
in interfaceMapViewPaintable.LayerPainter
- Overrides:
paint
in classAbstractMapViewPaintable.CompatibilityModeLayerPainter
- Parameters:
graphics
- The graphics object of the map view you should use. It provides you with a content pane, the bounds and the view state.
-
doPaint
private void doPaint(MapViewGraphics graphics)
-
allocateCacheMemory
private void allocateCacheMemory()
-
getEstimatedCacheSize
private long getEstimatedCacheSize()
-
detachFromMapView
public void detachFromMapView(MapViewPaintable.MapViewEvent event)
Description copied from interface:MapViewPaintable.LayerPainter
Called when the layer is removed from the map view and this painter is not used any more.This method is called once on the painter returned by
AbstractMapViewPaintable.attachToMapView(org.openstreetmap.josm.gui.layer.MapViewPaintable.MapViewEvent)
- Specified by:
detachFromMapView
in interfaceMapViewPaintable.LayerPainter
- Overrides:
detachFromMapView
in classAbstractMapViewPaintable.CompatibilityModeLayerPainter
- Parameters:
event
- The event.
-
-