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
ConstructorsConstructorDescriptionTLcyGXYLayerOrderManager(ILcyLucyEnv aLucyEnv, ILcyMapComponent aMapComponent) Creates a newTLcyGXYLayerOrderManager. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanMoveGXYLayerDown(ILcdGXYLayer aGXYLayer) Returns true if the given gxy layer can be moved down without violating the layer ordering.booleancanMoveGXYLayerUp(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.voidinsertGXYLayer(ILcdGXYLayer aGXYLayer, int aGXYLayerType, int aModelType) Method to insert the given layer to the given gxy view.voidmoveLayerBottom(ILcdGXYLayer aGXYLayer) Moves the given layer to the bottom of the view, but respects the layer ordering.voidmoveLayerDown(ILcdGXYLayer aGXYLayer) Moves the given layer downwards.voidmoveLayerTop(ILcdGXYLayer aGXYLayer) Moves the given layer to the top of the view, but respects the layer ordering.voidmoveLayerUp(ILcdGXYLayer aGXYLayer) Moves the given layer upwards.
-
Constructor Details
-
TLcyGXYLayerOrderManager
Creates a newTLcyGXYLayerOrderManager.- Parameters:
aLucyEnv- The Lucy environment.aMapComponent- TheILcyMapComponenton which thisILcyGXYLayerOrderManagershould operate.
-
-
Method Details
-
getGXYView
Description copied from interface:ILcyGXYLayerOrderManagerReturn the gxy view associated with this layer order manager.- Specified by:
getGXYViewin 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#UNKNOWNas layer type andILcyModelContentType#UNKNOWNas model type. Once the model and layer type are determined, it will not be changed anymore.- Specified by:
insertGXYLayerin 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:ILcyGXYLayerOrderManagerReturns true if the given gxy layer can be moved up without violating the layer ordering.- Specified by:
canMoveGXYLayerUpin interfaceILcyGXYLayerOrderManager- Parameters:
aGXYLayer- The layer to test.- Returns:
- true if the given gxy layer can be moved up.
-
canMoveGXYLayerDown
Description copied from interface:ILcyGXYLayerOrderManagerReturns true if the given gxy layer can be moved down without violating the layer ordering.- Specified by:
canMoveGXYLayerDownin interfaceILcyGXYLayerOrderManager- Parameters:
aGXYLayer- The layer to test.- Returns:
- true if the given gxy layer can be moved down.
-
moveLayerUp
Description copied from interface:ILcyGXYLayerOrderManagerMoves the given layer upwards.This method should only be called if canMoveGXYLayerUp for the same layer returns true.
- Specified by:
moveLayerUpin interfaceILcyGXYLayerOrderManager- Parameters:
aGXYLayer- The layer to move.- See Also:
-
moveLayerDown
Description copied from interface:ILcyGXYLayerOrderManagerMoves the given layer downwards.This method should only be called if canMoveGXYLayerDown for the same layer returns true.
- Specified by:
moveLayerDownin interfaceILcyGXYLayerOrderManager- Parameters:
aGXYLayer- The layer to move.- See Also:
-
moveLayerTop
Description copied from interface:ILcyGXYLayerOrderManagerMoves 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:
moveLayerTopin interfaceILcyGXYLayerOrderManager- Parameters:
aGXYLayer- The layer to move.- See Also:
-
moveLayerBottom
Description copied from interface:ILcyGXYLayerOrderManagerMoves 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:
moveLayerBottomin interfaceILcyGXYLayerOrderManager- Parameters:
aGXYLayer- The layer to move.- See Also:
-