Package com.massifmaps.components
Class Layers
java.lang.Object
com.massifmaps.components.Layers
Container for all raster and vector layers of the map view.
The order in which layers are added is important for vector elements like Points, Lines
and Polygons. For these elements the layer ordering defines their draw order.
Other elements like NMLModels and Polygon3Ds are z ordered and are drawn using the depth buffer.
For Billboard elements like Markers and Labels, the layer ordering is unimportant, because
they will be sorted from back to front and drawn in that order on top of all other vector elements.
The order in which layers are added is important for vector elements like Points, Lines
and Polygons. For these elements the layer ordering defines their draw order.
Other elements like NMLModels and Polygon3Ds are z ordered and are drawn using the depth buffer.
For Billboard elements like Markers and Labels, the layer ordering is unimportant, because
they will be sorted from back to front and drawn in that order on top of all other vector elements.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new layer to the layer stack.voidaddAll(LayerVector layers) Adds a a list of layers to the layer stack.voidclear()Clears the layer stack.intcount()Returns the current layer count.booleanChecks if this object is equal to the specified object.get(int index) Returns the layer at the specified index.getAll()Returns the list of all layers.inthashCode()Returns the hash value of this object.voidInserts a new layer at the specified position.
All previous layers starting from this index will be moved to the next position.booleanRemoves a layer from the layer stack.booleanremoveAll(LayerVector layers) Removes a list of layers from the layer stack.voidReplaces the layer at the specified index.voidsetAll(LayerVector layers) Replaces all the layers with the given layer list.
-
Method Details
-
equals
Checks if this object is equal to the specified object. -
hashCode
public int hashCode()Returns the hash value of this object. -
count
public int count()Returns the current layer count.- Returns:
- The layer count.
-
clear
public void clear()Clears the layer stack. -
get
Returns the layer at the specified index.- Parameters:
index- The layer index to return. Must be between 0 and count (exclusive).- Returns:
- The layer at the specified index.
- Throws:
IndexOutOfBoundsException- If the index is out of range.
-
getAll
Returns the list of all layers. The layers are in the order in which they were added.- Returns:
- A vector of all previously added layers.
-
set
Replaces the layer at the specified index.- Parameters:
index- The layer index to replace. Must be between 0 and count (exclusive).layer- The new layer.- Throws:
IndexOutOfBoundsException- If the index is out of range.
-
setAll
Replaces all the layers with the given layer list.- Parameters:
layers- The new list of layers.
-
insert
Inserts a new layer at the specified position.
All previous layers starting from this index will be moved to the next position.- Parameters:
index- The layer index. Must be between 0 and count (inclusive).layer- The new layer.- Throws:
IndexOutOfBoundsException- If the index is out of range.
-
add
Adds a new layer to the layer stack. The new layer will be the last (and topmost) layer.- Parameters:
layer- The layer to be added.
-
addAll
Adds a a list of layers to the layer stack. The new layers will be the last (and topmost) layers.- Parameters:
layers- The layer list to be added.
-
remove
Removes a layer from the layer stack.- Parameters:
layer- The layer to be removed.- Returns:
- True if the layer was removed. False otherwise (layer was not found).
-
removeAll
Removes a list of layers from the layer stack.- Parameters:
layers- The list of layers to be removed.- Returns:
- True if all layer were removed. False otherwise (some layers were not found).
-