com.supermap.mapping
Class LayerGroup
- java.lang.Object
-
- com.supermap.mapping.Layer
-
- com.supermap.mapping.LayerGroup
-
public class LayerGroup extends Layer
Layer class.
Grouping layer is used to group the layer management, and can achieve the same group of layers of unified control, such as visibility control. The grouping layer is also a layer, but his main function is to manage the layers, including the management grouping layer, that is, the grouping layer can be nested (grouping can also include grouping).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
add(Layer layer)
Add the new layer to the current group layer.LayerGroup
addGroup(java.lang.String groupName)
Adds a new group layer to current group layer, that is, a nested group layer.void
addLayerAddedListener(LayerAddedListener l)
A listener used to receiveLayerAddedEvent
void
addLayerRemovedListener(LayerRemovedListener l)
A listener used to receiveLayerRemovedEvent
Layer
find(java.lang.String name)
Finds layers in LayergroupLayer
get(int index)
Returns the layer object with the specified index in the layer collection.int
getCount()
Returns the count of the layer objects in the specified layer collection.Layer
getLayerByName(java.lang.String name)
Finds Layer the its nameint
indexOf(Layer layer)
Returns the index that the specified is in the current group layer.void
insert(int index, Layer layer)
Insert the new layer to the current group layer.LayerGroup
insertGroup(int index, java.lang.String groupName)
Adds a new group layer to current group layer in specified index position, that is, a nested group layer.boolean
remove(Layer layer)
Removes the specified layer from the group layer.boolean
removeGroup(LayerGroup group)
Removes a specified group layer from current group layer.void
removeLayerAddedListener(LayerAddedListener l)
A listener used to receiveLayerAddedEvent
void
removeLayerRemovedListener(LayerRemovedListener l)
A listener used to receiveLayerRemovedEvent
boolean
ungroup()
Cancel group management in the current group layer.-
Methods inherited from class com.supermap.mapping.Layer
getAdditionalSetting, getByCaption, getCaption, getDataset, getDeduplicateThreshold, getDeduplicateTolerance, getDescription, getDisplayFilter, getIsSwipe, getLayerSettingVectorCache, getMaxVisibleScale, getMinVisibleGeometrySize, getMinVisibleScale, getName, getParentGroup, getSelection, getSymbolScale, getTheme, GetTheme, getTimeEndField, getTimeFilterEnding, getTimeFilterStarting, getTimeStartField, getTimeStepInterval, hitTest, hitTestEx, isDeduplicateEnabled, isDisposed, isEditable, isFastDrawEnabled, isSelectable, isSnapable, isSymbolScalable, IsTimeFilterEnable, isVisible, isVisibleScale, removeCache, setAdditionalSetting, setCaption, setDataset, setDeduplicateEnabled, setDeduplicateThreshold, setDeduplicateTolerance, setDescription, setDisplayFilter, setEditable, setFastDrawDataModefied, setFastDrawEnabled, setIsSwipe, setMaxVisibleScale, setMinVisibleGeometrySize, setMinVisibleScale, setOpaqueRate, setSelectable, setSnapable, setSymbolScalable, setSymbolScale, setTimeEndField, setTimeFilterEnable, setTimeFilterEnding, setTimeFilterStarting, setTimeStartField, setTimeStepInterval, setVisible, toXML
-
-
-
-
Method Detail
-
getCount
public int getCount()
Returns the count of the layer objects in the specified layer collection.- Returns:
- The total number of layer objects in a given layer collection.
-
get
public Layer get(int index)
Returns the layer object with the specified index in the layer collection.- Parameters:
index
- The specified index value.- Returns:
- The total number of layer objects in a given layer collection.
-
indexOf
public int indexOf(Layer layer)
Returns the index that the specified is in the current group layer.- Parameters:
layer
- Specifies the layer to get the index value.- Returns:
- Specifies the index value of the layer under the current grouping layer.
-
add
public void add(Layer layer)
Add the new layer to the current group layer. If the specified layer belongs to other group, move the layer to the current group.- Parameters:
layer
- Specifies the layer to be added to the current grouping layer.
-
insert
public void insert(int index, Layer layer)
Insert the new layer to the current group layer. If the specified layer belongs to other group, move the layer to the current group.- Parameters:
index
- The specified index value, the new layer will be inserted into that location.layer
- Specifies the new layer to be inserted.
-
remove
public boolean remove(Layer layer)
Removes the specified layer from the group layer.- Parameters:
layer
- Specifies the layer to be removed.- Returns:
- a boolean value, the return succeeded True; failed to return False.
-
addGroup
public LayerGroup addGroup(java.lang.String groupName)
Adds a new group layer to current group layer, that is, a nested group layer.- Parameters:
groupName
- The name of the new grouping layer.- Returns:
- Returns the newly added grouping layer.
-
insertGroup
public LayerGroup insertGroup(int index, java.lang.String groupName)
Adds a new group layer to current group layer in specified index position, that is, a nested group layer.- Parameters:
index
- The specified index value.groupName
- The name of the new grouping layer.- Returns:
- Returns the newly added grouping layer.
-
removeGroup
public boolean removeGroup(LayerGroup group)
Removes a specified group layer from current group layer.- Parameters:
group
- Specifies the grouping layer to be removed.- Returns:
- a boolean value, the return succeeded True; failed to return False.
-
ungroup
public boolean ungroup()
Cancel group management in the current group layer.- Returns:
- A Boolean value indicating whether the operation was successful, true for success, and false to fail.
-
addLayerAddedListener
public void addLayerAddedListener(LayerAddedListener l)
A listener used to receiveLayerAddedEvent
- Parameters:
l
- A listener that receives a layer-end event that adds a layer-end event to the grouping layer.
-
removeLayerAddedListener
public void removeLayerAddedListener(LayerAddedListener l)
A listener used to receiveLayerAddedEvent
- Parameters:
l
- A listener for receiving a layer end event from a grouping layer.
-
addLayerRemovedListener
public void addLayerRemovedListener(LayerRemovedListener l)
A listener used to receiveLayerRemovedEvent
- Parameters:
l
- A listener for receiving a layer end event from a grouping layer.
-
find
public Layer find(java.lang.String name)
Finds layers in Layergroup- Parameters:
name
- Name- Returns:
- layer
-
removeLayerRemovedListener
public void removeLayerRemovedListener(LayerRemovedListener l)
A listener used to receiveLayerRemovedEvent
- Parameters:
l
- A listener for receiving a layer end event from a grouping layer.
-
getLayerByName
public Layer getLayerByName(java.lang.String name)
Finds Layer the its name- Parameters:
name
- The name of layer- Returns:
- layer
-
-