Class TLcyGXYLayerOrderManager
- All Implemented Interfaces:
ILcyGXYLayerOrderManager
Implementation of ILcyGXYLayerOrderManager
that orders the layers of a given
ILcyMapComponent
based on their ILcyGXYLayerType
and their
ILcyModelContentType
.
Layers whose layer type is ILcyGXYLayerType.REALTIME
are kept above all other layers. Additionally,
to optimize performance, the ILcdGXYView.setNumberOfCachedBackgroundLayers
flag is automatically updated
to be the total layer count minus the amount of those layers. So the REALTIME
layers aren't cached to
allow them to refresh often.
The remaining layers are sorted on their ILcyModelContentType
(the constant values). Layers having the
same model content type, are sorted on the ILcyGXYLayerType
(except REALTIME
layers, which are
kept above all others, as explained above).
Note that this ordering is only approximate when layers are also moved otherwise, for example in a layer control GUI.
This class works actively and passively. It works actively when a layer is added using insertGXYLayer. It works
passively in the sense that it listens to the associated ILcdGXYView
to detect the addition of new
layers. When a new layer is added, it is moved to the correct position.
-
Constructor Summary
ConstructorDescriptionTLcyGXYLayerOrderManager
(ILcyLucyEnv aLucyEnv, ILcyMapComponent aMapComponent) Creates a newTLcyGXYLayerOrderManager
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canMoveGXYLayerDown
(ILcdGXYLayer aGXYLayer) Returns true if the given gxy layer can be moved down without violating the layer ordering.boolean
canMoveGXYLayerUp
(ILcdGXYLayer aGXYLayer) Returns true if the given gxy layer can be moved up without violating the layer ordering.Return the gxy view associated with this layer order manager.void
insertGXYLayer
(ILcdGXYLayer aGXYLayer, int aGXYLayerType, int aModelType) Method to insert the given layer to the given gxy view.void
moveLayerBottom
(ILcdGXYLayer aGXYLayer) Moves the given layer to the bottom of the view, but respects the layer ordering.void
moveLayerDown
(ILcdGXYLayer aGXYLayer) Moves the given layer downwards.void
moveLayerTop
(ILcdGXYLayer aGXYLayer) Moves the given layer to the top of the view, but respects the layer ordering.void
moveLayerUp
(ILcdGXYLayer aGXYLayer) Moves the given layer upwards.
-
Constructor Details
-
TLcyGXYLayerOrderManager
Creates a newTLcyGXYLayerOrderManager
.- Parameters:
aLucyEnv
- The Lucy environment.aMapComponent
- TheILcyMapComponent
on which thisILcyGXYLayerOrderManager
should operate.
-
-
Method Details
-
getGXYView
Description copied from interface:ILcyGXYLayerOrderManager
Return the gxy view associated with this layer order manager.- Specified by:
getGXYView
in interfaceILcyGXYLayerOrderManager
- Returns:
- the gxy view associated with this layer order manager.
-
insertGXYLayer
Method to insert the given layer to the given gxy view.This method will try to determine the correct layer and model content type when called with
ILcyGXYLayerType#UNKNOWN
as layer type andILcyModelContentType#UNKNOWN
as model type. Once the model and layer type are determined, it will not be changed anymore.- Specified by:
insertGXYLayer
in interfaceILcyGXYLayerOrderManager
- Parameters:
aGXYLayer
- The layer to insert.aGXYLayerType
- The layer type of the layer.aModelType
- The model type of the model of the layer.
-
canMoveGXYLayerUp
Description copied from interface:ILcyGXYLayerOrderManager
Returns true if the given gxy layer can be moved up without violating the layer ordering.- Specified by:
canMoveGXYLayerUp
in interfaceILcyGXYLayerOrderManager
- Parameters:
aGXYLayer
- The layer to test.- Returns:
- true if the given gxy layer can be moved up.
-
canMoveGXYLayerDown
Description copied from interface:ILcyGXYLayerOrderManager
Returns true if the given gxy layer can be moved down without violating the layer ordering.- Specified by:
canMoveGXYLayerDown
in interfaceILcyGXYLayerOrderManager
- Parameters:
aGXYLayer
- The layer to test.- Returns:
- true if the given gxy layer can be moved down.
-
moveLayerUp
Description copied from interface:ILcyGXYLayerOrderManager
Moves the given layer upwards.This method should only be called if canMoveGXYLayerUp for the same layer returns true.
- Specified by:
moveLayerUp
in interfaceILcyGXYLayerOrderManager
- Parameters:
aGXYLayer
- The layer to move.- See Also:
-
moveLayerDown
Description copied from interface:ILcyGXYLayerOrderManager
Moves the given layer downwards.This method should only be called if canMoveGXYLayerDown for the same layer returns true.
- Specified by:
moveLayerDown
in interfaceILcyGXYLayerOrderManager
- Parameters:
aGXYLayer
- The layer to move.- See Also:
-
moveLayerTop
Description copied from interface:ILcyGXYLayerOrderManager
Moves the given layer to the top of the view, but respects the layer ordering.This method should only be called if canMoveGXYLayerUp for the same layer returns true.
- Specified by:
moveLayerTop
in interfaceILcyGXYLayerOrderManager
- Parameters:
aGXYLayer
- The layer to move.- See Also:
-
moveLayerBottom
Description copied from interface:ILcyGXYLayerOrderManager
Moves the given layer to the bottom of the view, but respects the layer ordering.This method should only be called if canMoveGXYLayerDown for the same layer returns true.
- Specified by:
moveLayerBottom
in interfaceILcyGXYLayerOrderManager
- Parameters:
aGXYLayer
- The layer to move.- See Also:
-