Interface Tile

All Superinterfaces:
Cloneable, Shareable

public interface Tile extends Cloneable, Shareable
This class represent a rectangular section (region) of a layer. It enable adding and retrieving elements associated with the layer. All tiles are part of a specific tile set (TileSet) which forms a grid to span the whole layer. Tiles are used divide in smaller region the layer to increase efficiency. When changes occurs only the corresponding tiles needs to be updated on the client side.
See Also:
  • Method Details

    • isEmpty

      boolean isEmpty()
    • isLoaded

      boolean isLoaded()
      Checks if the tile is already loaded.
      Returns:
      true if loaded false otherwise.
    • setLastUseTime

      void setLastUseTime(long time)
      Sets the last time this tile has been used.
      Parameters:
      time - the corresponding time.
    • getLastUseTime

      long getLastUseTime()
      Gets the last time this tile has been used.
      Returns:
      getLastUseTime.
    • getRegion

      Rectangle getRegion()
      Gets the tile region.
      Returns:
      region.
    • getElement

      K2DElement getElement(int pos)
      Gets the element at the specified position in the vector.
      Parameters:
      pos - the position.
      Returns:
      the K2DElement instance at the specified position.
    • getAllElements

      Enumeration<K2DElement> getAllElements()
      Gets all the elements contained in this tile.
    • sendToBack

      void sendToBack(K2DElement[] elements)
      Moves the specified elements to the lowest z order position.
      Parameters:
      elements - the elements to move
    • bringToFront

      void bringToFront(K2DElement[] elements)
      Moves the specified elements to the highest z order position.
      Parameters:
      elements - the elements to move
    • bringForward

      void bringForward(K2DElement[] elements)
      Moves the specified elements one z order position up.
      Parameters:
      elements - the elements to move
    • sendBackward

      void sendBackward(K2DElement[] elements)
      Moves the specified elements one z order position down.
      Parameters:
      elements - the elements to move
    • getCount

      int getCount()
      Gets the number of elements in this tile.
      Returns:
      the element count.
    • setLoaded

      void setLoaded(boolean flag)
      Sets the isloaded flag.
      Parameters:
      flag - the boolean value to be set.
    • setRequested

      void setRequested(boolean flag)
      Sets the isRequested flag.
      Parameters:
      flag - the boolean value to be set.
    • isRequested

      boolean isRequested()
      Checks if this tile is requested
      Returns:
      true if the tile is requested false otherwise.
    • getBounds

      Rectangle getBounds()
      Gets the bounds of the elements of this tile.
      Returns:
      tileBounds the bouding box of the elements of this tile
    • getPos

      int getPos()
      Gets the position of this tile.
      Returns:
      the position.
    • sizeOf

      int sizeOf()
    • contains

      boolean contains(K2DElement element)
      Parameters:
      element - the element to search for
      Returns:
      true if the tile contains the specified element
    • contains

      boolean contains(long elementId)
      Parameters:
      elementId - the id of the element to search for
      Returns:
      true if the tile contains the specified element
    • getExpiration

      long getExpiration()
      Returns the tile expiration.
      Returns:
      the tile expiration.
    • setExpiration

      void setExpiration(long expiration)
      Sets the tile expiration.
      Parameters:
      expiration - the tile expiration.
    • isExpired

      boolean isExpired()
      Returns whether this tile is expired.
      Returns:
      whether this tile is expired.