Class AbstractTileSourceLayer.TileSet

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private AbstractTileSourceLayer.TileSetInfo info  
      • Fields inherited from class org.openstreetmap.gui.jmapviewer.TileRange

        maxX, maxY, minX, minY, zoom
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TileSet()
      null tile set
      protected TileSet​(org.openstreetmap.gui.jmapviewer.TileRange range)  
      protected TileSet​(org.openstreetmap.gui.jmapviewer.TileXY t1, org.openstreetmap.gui.jmapviewer.TileXY t2, int zoom)  
    • 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 panning
      protected void sanitize()  
      java.util.stream.Stream<TilePosition> tilePositions()
      Gets a stream of all tile positions in this set
      private 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.
      • Methods inherited from class org.openstreetmap.gui.jmapviewer.TileRange

        size, tilesSpanned
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TileSet

        protected TileSet​(org.openstreetmap.gui.jmapviewer.TileXY t1,
                          org.openstreetmap.gui.jmapviewer.TileXY t2,
                          int zoom)
      • TileSet

        protected TileSet​(org.openstreetmap.gui.jmapviewer.TileRange range)
      • TileSet

        private TileSet()
        null tile set
    • Method Detail

      • 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<TilePositiontilePositions()
        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
      • 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.
      • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object