Interface LayerCollection
- All Superinterfaces:
LayersVisitable,org.gvsig.tools.visitor.Visitable
- All Known Implementing Classes:
FLayers
Interface with methods for a collection of layers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intValue used to specify the insertion after an element.static final intValue used to specify the insertion before an element.static final intValue used to specify the insertion at the beginning.static final intValue used to specify the insertion at the end. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new layer to this collection.voidAdds a new layer to this collection before or after an element if supplied, and if not at the beginning or end of the collection.voidAdds a listener of events produced on a collection of layers.voidbeginDraw(Graphics2D g, ViewPort viewPort) voidendDraw(Graphics2D g, ViewPort viewPort) FLayer[]Returns an array with all active layers in this collection.getLayer(int index) Returns the ith-output directed son (from bottom up) of this collection.Returns a first-level layer of this collection, using its name.getLayer(org.gvsig.fmap.dal.DataStore store) Returns a first-level layer of this collection, using its name.intReturns the number of layers that are at the first level inside this one.FLayer[]Returns an array with all visible layers in this collection.voidmove(FLayer layer, LayerCollection group) Moves a layer from this collection to the end of another collection.voidmove(FLayer layer, LayerCollection group, int where, FLayer adjoiningLayer) Moves a layer from this collection to another collection before or after an element if supplied, and if not at the beginning or end of the collection.voidmoveTo(int from, int to) Moves a layer of the collection to another position in internal list.voidremoveLayer(int idLayer) Removes a layer using its identifier.voidremoveLayer(String layerName) Removes a layer using its name.voidremoveLayer(FLayer lyr) Removes a layer from this collection.voidRemoves a listener of events produced on a collection of layers.voidsetAllActives(boolean active) Changes the status of all layers to active or inactive.voidsetAllVisibles(boolean visible) Changes the status of all layers to visible or invisible.Methods inherited from interface org.gvsig.fmap.mapcontext.layers.operations.LayersVisitable
acceptMethods inherited from interface org.gvsig.tools.visitor.Visitable
accept
-
Field Details
-
BEGIN
static final int BEGINValue used to specify the insertion at the beginning.- See Also:
-
END
static final int ENDValue used to specify the insertion at the end.- See Also:
-
BEFORE
static final int BEFOREValue used to specify the insertion before an element.- See Also:
-
AFTER
static final int AFTERValue used to specify the insertion after an element.- See Also:
-
-
Method Details
-
addLayerCollectionListener
Adds a listener of events produced on a collection of layers.
- Parameters:
listener- aLayerCollectionListener- See Also:
-
removeLayerCollectionListener
Removes a listener of events produced on a collection of layers.
- Parameters:
listener- aLayerCollectionListener- See Also:
-
addLayer
Adds a new layer to this collection.
- Parameters:
layer- the new layer- Throws:
CancelationException- any exception produced during the cancellation of the driver.LoadLayerException- any exception produced loading the layer.- See Also:
-
addLayer
void addLayer(FLayer layer, int where, FLayer adjoiningLayer) throws LayerNotFoundInCollectionException Adds a new layer to this collection before or after an element if supplied, and if not at the beginning or end of the collection.
.- Parameters:
layer- a FLayer to movewhere- the position parameter. The valid values are:
0 = BEGIN (first position)
1 = END (last position)
2 = BEFORE (before target layer)
3 = AFTER (after target layer)adjoiningLayer- a FLayer a layer adjacent to where to insert the layer.group- a LayerCollection in which the layer has to be moved- Throws:
CancelationException- any exception produced during the cancellation of the driver.LoadLayerException- any exception produced loading the layer.LayerNotFoundInCollectionException- See Also:
-
moveTo
Moves a layer of the collection to another position in internal list. It doesn't consider sub-nodes of layers.
- Parameters:
from- origin positionto- destination position- Throws:
CancelationException- any exception produced during the cancellation of the driver.
-
removeLayer
Removes a layer from this collection.
- Parameters:
lyr- a layer- Throws:
CancelationException- any exception produced during the cancellation of the driver.- See Also:
-
removeLayer
void removeLayer(int idLayer) Removes a layer using its identifier.
- Parameters:
idLayer- layer identifier- See Also:
-
removeLayer
Removes a layer using its name.
- Parameters:
layerName- the name of the layer- See Also:
-
getVisibles
FLayer[] getVisibles()Returns an array with all visible layers in this collection.
- Returns:
- array with first-level visible layer nodes, or
nullif no there is no layer visible - See Also:
-
getActives
FLayer[] getActives()Returns an array with all active layers in this collection.
- Returns:
- array with first-level active layer nodes, or
nullif no there is no layer actived - See Also:
-
getLayers
-
getLayer
Returns the ith-output directed son (from bottom up) of this collection.
- Parameters:
index- index of the ith-output layer in this collection.- Returns:
- a layer
- See Also:
-
getLayer
Returns a first-level layer of this collection, using its name.- Parameters:
layerName- name of a layer of this collection- Returns:
- a layer
- See Also:
-
getLayer
Returns a first-level layer of this collection, using its name.- Parameters:
store- of a layer of this collection- Returns:
- a layer
-
getLayersCount
int getLayersCount()Returns the number of layers that are at the first level inside this one.
Doesn't counts the sublayers (of
FLayerssubnodes).- Returns:
- number >= 0 with layers that are at the same first-level
- See Also:
-
setAllActives
void setAllActives(boolean active) Changes the status of all layers to active or inactive.
- Parameters:
active- a boolean value- See Also:
-
setAllVisibles
void setAllVisibles(boolean visible) Changes the status of all layers to visible or invisible.
- Parameters:
visible- a boolean value- See Also:
-
beginDraw
-
endDraw
-
move
void move(FLayer layer, LayerCollection group, int where, FLayer adjoiningLayer) throws LayerNotFoundInCollectionException Moves a layer from this collection to another collection before or after an element if supplied, and if not at the beginning or end of the collection.
- Parameters:
layer- a FLayer to movegroup- a LayerCollection in which the layer has to be movedwhere- the position parameter. The valid values are:
0 = BEGIN (first position)
1 = END (last position)
2 = BEFORE (before target layer)
3 = AFTER (after target layer)adjoiningLayer- a FLayer a layer adjacent to where to insert the layer.- Throws:
LayerNotFoundInCollectionException- See Also:
-
move
Moves a layer from this collection to the end of another collection.
- Parameters:
layer- a FLayer to movegroup- a LayerCollection in which the layer has to be moved- Throws:
LayerNotFoundInCollectionException
-