public class VectorLayerHolder<T> extends java.lang.Object implements LeafletLayerHolder<LFeatureGroup>, LeafletMapAware, org.springframework.context.ApplicationContextAware, Refreshable
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
When a layer corresponding to the holder is selected,
this method is invoked in order to switch the holder into an active mode,
which basically means enable listeners and turn on a drawing mode if needed.
|
protected GeoObjectWrapper<T> |
addGeoObject(T entity) |
protected void |
applyWeightForPoint(GeoObjectWrapper<?> wrapper)
Applies weight value for a point (if the weight property is specified in the clustering options).
|
void |
deactivate()
This method is invoked when the layer corresponding to the holder is no more active
and it signals the holder to switch off listeners and a drawing mode.
|
protected void |
ensureItemSelection(T entity)
Invoke when geo-object's wrapper is changed.
|
protected static java.lang.Object |
geoObjectKey(java.lang.Object entity)
Returns a key for the given geo-object to be used in
geoObjectsMap. |
java.util.Map<java.lang.Object,GeoObjectWrapper<T>> |
getGeoObjectWrappersMap() |
LFeatureGroup |
getLeafletLayer()
Gets the
LeafletLayer |
VectorLayer<T> |
getVectorLayer() |
protected void |
initGeometryChangedSubscription() |
protected void |
initLeafletLayer() |
protected boolean |
isEditable() |
protected void |
itemsSetChanged(VectorLayerItems.ItemSetChangeEvent<T> event) |
protected void |
mergeGeoObject(T entity)
Invoked in case of replacing an existing entity with a new instance.
|
protected void |
notifyConnector() |
protected void |
onGeoObjectClick(T clickedGeoObject) |
void |
refresh() |
void |
refreshParameters(java.util.Collection<java.lang.String> changedParameters) |
protected void |
removeGeoObject(T entity) |
protected void |
removeGeoObjectByKey(java.lang.Object geoObjectKey) |
protected void |
removeWrapper(GeoObjectWrapper<?> wrapper) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setEditableMap(LEditableMap lEditableMap) |
void |
setLeafletMap(LMap leafletMap) |
void |
shutdown()
Signals that the holder is no more needed (for example when it is replaced with another holder instance).
|
protected void itemsSetChanged(VectorLayerItems.ItemSetChangeEvent<T> event)
protected void initLeafletLayer()
protected void initGeometryChangedSubscription()
protected GeoObjectWrapper<T> addGeoObject(T entity)
protected void removeGeoObject(T entity)
protected void removeGeoObjectByKey(java.lang.Object geoObjectKey)
protected void removeWrapper(GeoObjectWrapper<?> wrapper)
protected void mergeGeoObject(T entity)
Assumes that the previous item belongs to the layer.
protected static java.lang.Object geoObjectKey(java.lang.Object entity)
geoObjectsMap.
Returns entity id whenever possible, otherwise returns entity.protected void applyWeightForPoint(GeoObjectWrapper<?> wrapper)
wrapper - point wrapperprotected void ensureItemSelection(T entity)
Ensures the editable mode for the selected geo-object's wrapper.
protected boolean isEditable()
protected void onGeoObjectClick(T clickedGeoObject)
public void setLeafletMap(LMap leafletMap)
setLeafletMap in interface LeafletMapAwarepublic void setEditableMap(LEditableMap lEditableMap)
setEditableMap in interface LeafletMapAwarepublic LFeatureGroup getLeafletLayer()
LeafletLayerHolderLeafletLayergetLeafletLayer in interface LeafletLayerHolder<LFeatureGroup>public VectorLayer<T> getVectorLayer()
public void activate()
LeafletLayerHolderactivate in interface LeafletLayerHolder<LFeatureGroup>public void deactivate()
LeafletLayerHolderdeactivate in interface LeafletLayerHolder<LFeatureGroup>public void shutdown()
LeafletLayerHoldershutdown in interface LeafletLayerHolder<LFeatureGroup>public void refresh()
refresh in interface Refreshablepublic void refreshParameters(java.util.Collection<java.lang.String> changedParameters)
refreshParameters in interface Refreshableprotected void notifyConnector()
public java.util.Map<java.lang.Object,GeoObjectWrapper<T>> getGeoObjectWrappersMap()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansException