Class Tile

  • All Implemented Interfaces:
    ImageLoader
    Direct Known Subclasses:
    BingTile, OSMTile

    public abstract class Tile
    extends Object
    implements ImageLoader
    At tile represents a single space on the map within a specific ReferencedEnvelope. It holds a RenderExecutorComposite for fetching its image, and an SWTImage (which is disposed at various times). It listens to events for when to fetch, dispose, and construct new images. From
    Since:
    12
    Author:
    GDavis, Ugo Taddei
    • Field Detail

      • LOGGER

        protected static final Logger LOGGER
      • service

        protected TileService service
        The initiating service
    • Method Detail

      • setImageLoader

        public void setImageLoader​(ImageLoader imageLoader)
      • dispose

        public void dispose()
        Disposes of the tile.
      • getBufferedImage

        public BufferedImage getBufferedImage()
      • loadImageTileImage

        public BufferedImage loadImageTileImage​(Tile tile)
                                         throws IOException
        Implementation of ImageLoader. Has been moved to {@link
        Specified by:
        loadImageTileImage in interface ImageLoader
        Returns:
        an image
        Throws:
        IOException
        See Also:
        }
      • createErrorImage

        protected BufferedImage createErrorImage​(String message)
        Gets an image showing an error, possibly indicating a failure to load the tile image.
      • getTileSize

        public int getTileSize()
        Returns:
        The size of the tile in pixels.
      • setRenderState

        public void setRenderState​(Tile.RenderState newState)
        Sets the state of the tiles image.

        See getRenderState() for a description of the valid states.

      • getRenderState

        public Tile.RenderState getRenderState()
        Gets the state of the tiled image.

        One Of:

        • RenderState.NEW - a new tile that needs to be rendered
        • RenderState.Renderer - the tile has been rendered or is in the state of being rendered
        • RenderState.Invalid - something has changed and the tile's rendered image is not longer valid and needs to be re-rendered
      • getContextState

        public Tile.ContextState getContextState()
        This function returns the state of the tile render stack. If the context is invalid then the context needs to be updated before the tile is rendered.

        Should be one of:

        • INVALID - The context needs to be updated.
        • OKAY - The context is okay and does not need updating.
        Returns:
        the state of the tiles rendering stack
      • setContextState

        public void setContextState​(Tile.ContextState newState)
        Sets the state of the tile rendering stack.

        See getContextState() for valid value descriptions.

      • getScreenState

        public Tile.ScreenState getScreenState()
        Sets if the tile is on screen or not.

        This is used with other information to determine if a tile can be disposed of. Valid values include:

        • ONSCREEN - the tile has been requested by the viewport therefore we assume it is on screen
        • OFFSCREEN - this tile was not requested by the viewport
      • setScreenState

        public void setScreenState​(Tile.ScreenState newState)
        Sets the screen state.

        See getScreenState() for a description of the valid values.

      • getTileState

        public Tile.ValidatedState getTileState()
        Gets the validation state.

        This is used in conjunction with the screen state to determine it a tile can be disposed of. This state is set during a refresh event that is triggered from some gui event. Valid values include:

        • VALIDATED - The tile is validated and ready to be used for painting on the screen. Don't remove this tile.
        • OLD - This tile is an old tile that if off screen can be removed.
      • setTileState

        public void setTileState​(Tile.ValidatedState newState)
        Sets the validation state.

        See getTileState() for a description of valid values.

      • getId

        public String getId()
        Diese Methode wird verwendet um... TODO.
      • getTileIdentifier

        public TileIdentifier getTileIdentifier()
        Diese Methode wird verwendet um... TODO.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object other)
        Overrides:
        equals in class Object
      • toString

        public String toString()
        Overrides:
        toString in class Object
      • getUrl

        public abstract URL getUrl()
        A unique url for every tile