public interface LayerCollection extends LayersVisitable
Interface with methods for a collection of layers.
Modifier and Type | Field and Description |
---|---|
static int |
AFTER
Value used to specify the insertion after an element.
|
static int |
BEFORE
Value used to specify the insertion before an element.
|
static int |
BEGIN
Value used to specify the insertion at the beginning.
|
static int |
END
Value used to specify the insertion at the end.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayer(FLayer layer)
Adds a new layer to this collection.
|
void |
addLayer(FLayer layer,
int where,
FLayer adjoiningLayer)
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.
|
void |
addLayerCollectionListener(LayerCollectionListener listener)
Adds a listener of events produced on a collection of layers.
|
void |
beginDraw(Graphics2D g,
ViewPort viewPort) |
void |
endDraw(Graphics2D g,
ViewPort viewPort) |
FLayer[] |
getActives()
Returns an array with all active layers in this collection.
|
FLayer |
getLayer(int index)
Returns the ith-output directed son (from bottom up) of this collection.
|
FLayer |
getLayer(String layerName)
Returns a first-level layer of this collection, using its name.
|
int |
getLayersCount()
Returns the number of layers that are at the first level inside this one.
|
FLayer[] |
getVisibles()
Returns an array with all visible layers in this collection.
|
void |
move(FLayer layer,
LayerCollection group)
Moves a layer from this collection to the end of another collection.
|
void |
move(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.
|
void |
moveTo(int from,
int to)
Moves a layer of the collection to another position in internal list.
|
void |
removeLayer(FLayer lyr)
Removes a layer from this collection.
|
void |
removeLayer(int idLayer)
Removes a layer using its identifier.
|
void |
removeLayer(String layerName)
Removes a layer using its name.
|
void |
removeLayerCollectionListener(LayerCollectionListener listener)
Removes a listener of events produced on a collection of layers.
|
void |
setAllActives(boolean active)
Changes the status of all layers to active or inactive.
|
void |
setAllVisibles(boolean visible)
Changes the status of all layers to visible or invisible.
|
accept
static final int BEGIN
static final int END
static final int BEFORE
static final int AFTER
void addLayerCollectionListener(LayerCollectionListener listener)
Adds a listener of events produced on a collection of layers.
listener
- a LayerCollectionListener
removeLayerCollectionListener(LayerCollectionListener)
void removeLayerCollectionListener(LayerCollectionListener listener)
Removes a listener of events produced on a collection of layers.
listener
- a LayerCollectionListener
addLayerCollectionListener(LayerCollectionListener)
void addLayer(FLayer layer) throws CancelationException, LoadLayerException
Adds a new layer to this collection.
layer
- the new layerCancelationException
- any exception produced during the cancellation of the driver.LoadLayerException
- any exception produced loading the layer.removeLayer(FLayer)
,
removeLayer(int)
,
removeLayer(String)
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.
.layer
- a FLayer to movegroup
- a LayerCollection in which the layer has to be movedwhere
- the position parameter. The valid values are:adjoiningLayer
- a FLayer a layer adjacent to where to insert the layer.CancelationException
- any exception produced during the cancellation of the driver.LoadLayerException
- any exception produced loading the layer.LayerNotFoundInCollectionException
#moveTo(FLayer, LayerCollection, int, FLayer)
void moveTo(int from, int to) throws CancelationException
Moves a layer of the collection to another position in internal list. It doesn't consider sub-nodes of layers.
from
- origin positionto
- destination positionCancelationException
- any exception produced during the cancellation of the driver.void removeLayer(FLayer lyr) throws CancelationException
Removes a layer from this collection.
lyr
- a layerCancelationException
- any exception produced during the cancellation of the driver.removeLayer(int)
,
removeLayer(String)
,
addLayer(FLayer)
void removeLayer(int idLayer)
Removes a layer using its identifier.
idLayer
- layer identifierremoveLayer(FLayer)
,
removeLayer(String)
,
addLayer(FLayer)
void removeLayer(String layerName)
Removes a layer using its name.
layerName
- the name of the layerremoveLayer(FLayer)
,
removeLayer(int)
,
addLayer(FLayer)
FLayer[] getVisibles()
Returns an array with all visible layers in this collection.
null
if no there is no layer visiblesetAllVisibles(boolean)
FLayer[] getActives()
Returns an array with all active layers in this collection.
null
if no there is no layer activedsetAllActives(boolean)
FLayer getLayer(int index)
Returns the ith-output directed son (from bottom up) of this collection.
index
- index of the ith-output layer in this collection.getLayer(String)
FLayer getLayer(String layerName)
Returns a first-level layer of this collection, using its name.
layerName
- name of a layer of this collectiongetLayer(int)
int getLayersCount()
Returns the number of layers that are at the first level inside this one.
Doesn't counts the sublayers (of FLayers
subnodes).
getLayer(int)
,
getLayer(String)
void setAllActives(boolean active)
Changes the status of all layers to active or inactive.
active
- a boolean valuegetActives()
void setAllVisibles(boolean visible)
Changes the status of all layers to visible or invisible.
visible
- a boolean valuegetVisibles()
void beginDraw(Graphics2D g, ViewPort viewPort)
void endDraw(Graphics2D g, ViewPort viewPort)
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.
layer
- a FLayer to movegroup
- a LayerCollection in which the layer has to be movedwhere
- the position parameter. The valid values are:adjoiningLayer
- a FLayer a layer adjacent to where to insert the layer.LayerNotFoundInCollectionException
addLayer(FLayer, int, FLayer)
void move(FLayer layer, LayerCollection group)
Moves a layer from this collection to the end of another collection.
layer
- a FLayer to movegroup
- a LayerCollection in which the layer has to be movedLayerNotFoundInCollectionException