Package org.openstreetmap.josm.gui.layer
Class AbstractTileSourceLayer.TileSet
- java.lang.Object
-
- org.openstreetmap.gui.jmapviewer.TileRange
-
- org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer.TileSet
-
- Enclosing class:
- AbstractTileSourceLayer<T extends org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource>
protected class AbstractTileSourceLayer.TileSet extends org.openstreetmap.gui.jmapviewer.TileRange
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractTileSourceLayer.TileSetInfo
info
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.List<org.openstreetmap.gui.jmapviewer.Tile>
allExistingTiles()
Get all tiles represented by this TileSet that are already in the tileCache.private java.util.List<org.openstreetmap.gui.jmapviewer.Tile>
allLoadedTiles()
private java.util.List<org.openstreetmap.gui.jmapviewer.Tile>
allTiles(java.util.function.Function<TilePosition,org.openstreetmap.gui.jmapviewer.Tile> mapper)
private java.util.List<org.openstreetmap.gui.jmapviewer.Tile>
allTilesCreate()
private java.util.Comparator<org.openstreetmap.gui.jmapviewer.Tile>
getTileDistanceComparator()
private AbstractTileSourceLayer.TileSetInfo
getTileSetInfo()
boolean
hasAllLoadedTiles()
Check if all tiles in the range are fully loaded.boolean
hasLoadingTiles()
Check if there are tiles still loading.boolean
hasOverzoomedTiles()
Check if there there is a tile that is overzoomed.boolean
hasVisibleTiles()
Check if there is any tile fully loaded without error.private void
loadAllErrorTiles(boolean force)
private void
loadAllTiles(boolean force)
private void
overloadTiles()
Extend tile loading corridor, so that no flickering happens when panningprotected void
sanitize()
java.util.stream.Stream<TilePosition>
tilePositions()
Gets a stream of all tile positions in this setprivate boolean
tooLarge()
private boolean
tooSmall()
java.lang.String
toString()
private void
visitTilePosition(java.util.function.Consumer<org.openstreetmap.gui.jmapviewer.Tile> visitor, TilePosition tp, java.util.function.Consumer<TilePosition> missed)
void
visitTiles(java.util.function.Consumer<org.openstreetmap.gui.jmapviewer.Tile> visitor, java.util.function.Consumer<TilePosition> missed)
Call the given paint method for all tiles in this tile set.
-
-
-
Field Detail
-
info
private volatile AbstractTileSourceLayer.TileSetInfo info
-
-
Method Detail
-
sanitize
protected void sanitize()
-
tooSmall
private boolean tooSmall()
-
tooLarge
private boolean tooLarge()
-
allExistingTiles
private java.util.List<org.openstreetmap.gui.jmapviewer.Tile> allExistingTiles()
Get all tiles represented by this TileSet that are already in the tileCache.- Returns:
- all tiles represented by this TileSet that are already in the tileCache
-
allTilesCreate
private java.util.List<org.openstreetmap.gui.jmapviewer.Tile> allTilesCreate()
-
allTiles
private java.util.List<org.openstreetmap.gui.jmapviewer.Tile> allTiles(java.util.function.Function<TilePosition,org.openstreetmap.gui.jmapviewer.Tile> mapper)
-
tilePositions
public java.util.stream.Stream<TilePosition> tilePositions()
Gets a stream of all tile positions in this set- Returns:
- A stream of all positions
-
allLoadedTiles
private java.util.List<org.openstreetmap.gui.jmapviewer.Tile> allLoadedTiles()
-
getTileDistanceComparator
private java.util.Comparator<org.openstreetmap.gui.jmapviewer.Tile> getTileDistanceComparator()
- Returns:
- comparator, that sorts the tiles from the center to the edge of the current screen
-
loadAllTiles
private void loadAllTiles(boolean force)
-
overloadTiles
private void overloadTiles()
Extend tile loading corridor, so that no flickering happens when panning
-
loadAllErrorTiles
private void loadAllErrorTiles(boolean force)
-
visitTiles
public void visitTiles(java.util.function.Consumer<org.openstreetmap.gui.jmapviewer.Tile> visitor, java.util.function.Consumer<TilePosition> missed)
Call the given paint method for all tiles in this tile set.Uses a parallel stream.
- Parameters:
visitor
- A visitor to call for each tile.missed
- a consumer to call for each missed tile.
-
visitTilePosition
private void visitTilePosition(java.util.function.Consumer<org.openstreetmap.gui.jmapviewer.Tile> visitor, TilePosition tp, java.util.function.Consumer<TilePosition> missed)
-
hasVisibleTiles
public boolean hasVisibleTiles()
Check if there is any tile fully loaded without error.- Returns:
- true if there is any tile fully loaded without error
-
hasOverzoomedTiles
public boolean hasOverzoomedTiles()
Check if there there is a tile that is overzoomed.I.e. the server response for one tile was "there is no tile here". This usually happens when zoomed in too much. The limit depends on the region, so at the edge of such a region, some tiles may be available and some not.
- Returns:
- true if there there is a tile that is overzoomed
-
hasLoadingTiles
public boolean hasLoadingTiles()
Check if there are tiles still loading.This is the case if there is a tile not yet in the cache, or in the cache but marked as loading (
Tile.isLoading()
.- Returns:
- true if there are tiles still loading
-
hasAllLoadedTiles
public boolean hasAllLoadedTiles()
Check if all tiles in the range are fully loaded.A tile is considered to be fully loaded even if the result of loading the tile was an error.
- Returns:
- true if all tiles in the range are fully loaded
-
getTileSetInfo
private AbstractTileSourceLayer.TileSetInfo getTileSetInfo()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-