Package com.kheops.jmap.client.layers
Interface Tile
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 Summary
Modifier and TypeMethodDescriptionvoidbringForward(K2DElement[] elements) Moves the specified elements one z order position up.voidbringToFront(K2DElement[] elements) Moves the specified elements to the highest z order position.booleancontains(long elementId) booleancontains(K2DElement element) Gets all the elements contained in this tile.Gets the bounds of the elements of this tile.intgetCount()Gets the number of elements in this tile.getElement(int pos) Gets the element at the specified position in the vector.longReturns the tile expiration.longGets the last time this tile has been used.intgetPos()Gets the position of this tile.Gets the tile region.booleanisEmpty()booleanReturns whether this tile is expired.booleanisLoaded()Checks if the tile is already loaded.booleanChecks if this tile is requestedvoidsendBackward(K2DElement[] elements) Moves the specified elements one z order position down.voidsendToBack(K2DElement[] elements) Moves the specified elements to the lowest z order position.voidsetExpiration(long expiration) Sets the tile expiration.voidsetLastUseTime(long time) Sets the last time this tile has been used.voidsetLoaded(boolean flag) Sets the isloaded flag.voidsetRequested(boolean flag) Sets the isRequested flag.intsizeOf()
-
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
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
Moves the specified elements to the lowest z order position.- Parameters:
elements- the elements to move
-
bringToFront
Moves the specified elements to the highest z order position.- Parameters:
elements- the elements to move
-
bringForward
Moves the specified elements one z order position up.- Parameters:
elements- the elements to move
-
sendBackward
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
- 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.
-