Class TLcdWFSProxyModel
- All Implemented Interfaces:
ILcd2DBoundsIndexedModel
,ILcd2DBoundsInteractable
,ILcdModel
,ILcdBounded
,ILcdDisposable
,Serializable
,AutoCloseable
ILcd2DBoundsIndexedModel
, which fetches its data from a WFS.
Instances of this model are created by providing the WFS service URL to the TLcdWFSProxyModel.Builder
.
A TLcdOGCFilter
can be specified in order to impose additional constraints on the
data that is retrieved from the WFS.
A caching mode can also be specified by invoking the setCachingMode(int)
method. The available modes are :
NO_CACHE
a query is sent to the WFS each time the functionelements()
orapplyOnInteract2DBounds(com.luciad.shape.ILcdBounds, boolean, com.luciad.util.ILcdFunction, double, double)
is invoked.CACHE_ALL
a query is first sent to the WFS and all the data are kept in memory.SMART_CACHE
in this mode, the caching strategy will depend on the size of the data set. For small data sets, all data will be cached. For large datasets, it will only query the server when it knows that new data might be returned by the server. For example, when all data for a certain region is present in the cache, zooming in in that area will not re-query the server. Panning to a new area however will re-query the server.
Note that this model is intended for read-only use. Its elements should not be edited, and it is not possible to add or remove elements. The model is thread-safe for accessing its elements.
Features are retrieved in GML. If the namespace of the feature type's schema equals a supported known XML format
(such as AIXM 5.1), the elements of the WFS proxy model are of the same type as those produced by the decoder of
the XML format. Otherwise, the elements of the WFS proxy model are the same as type as those produced by
TLcdGMLModelDecoder
.
Below a few snippets illustrating the configuration of the model for common use cases:
- Use case: retrieve and cache all data without limits:
try (TLcdLockUtil.Lock autoUnlock = TLcdLockUtil.writeLock(proxyModel)) {
proxyModel.setCachingModel(TLcdWFSProxyModel.CACHE_ALL, ILcdFireEventMode.FIRE_LATER);
proxyModel.setFilter(null, ILcdFireEventMode.FIRE_LATER);
proxyModel.setMaxFeatures(null, ILcdFireEventMode.FIRE_LATER);
} finally {
proxyModel.fireCollectedModelChanges();
}
TLcdOGCBBoxOperator bboxOperator = new TLcdOGCBBoxOperator();
bboxOperator.setPropertyName(new TLcdOGCPropertyName(proxyModel.getGeometryPropertyName()));
bboxOperator.setBounds(new TLcdLonLatBounds(0, 0, 20, 20));
bboxOperator.setBoundsGeoReference(new TLcdGeodeticReference());
TLcdOGCFilter filter = new TLcdOGCFilter(bboxOperator);
try (TLcdLockUtil.Lock autoUnlock = TLcdLockUtil.writeLock(proxyModel)) {
proxyModel.setCachingModel(TLcdWFSProxyModel.CACHE_ALL, ILcdFireEventMode.FIRE_LATER);
proxyModel.setFilter(filter, ILcdFireEventMode.FIRE_LATER);
proxyModel.setMaxFeatures(null, ILcdFireEventMode.FIRE_LATER);
} finally {
proxyModel.fireCollectedModelChanges();
}
try (TLcdLockUtil.Lock autoUnlock = TLcdLockUtil.writeLock(proxyModel)) {
proxyModel.setCachingModel(TLcdWFSProxyModel.SMART_CACHE, ILcdFireEventMode.FIRE_LATER);
proxyModel.setFilter(null, ILcdFireEventMode.FIRE_LATER);
proxyModel.setMaxFeatures(1000, ILcdFireEventMode.FIRE_LATER);
} finally {
proxyModel.fireCollectedModelChanges();
}
- Since:
- 6.2
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A builder class forTLcdWFSProxyModel
instances.Nested classes/interfaces inherited from interface com.luciad.model.ILcdModel
ILcdModel.Query
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
All data are retrieved and cached at first access.static final int
No caching is performed.static final int
In this mode, data is requested on demand.Fields inherited from class com.luciad.model.ALcdModel
fModelEventSupport
Fields inherited from interface com.luciad.model.ILcdModel
FIRE_LATER, FIRE_NOW, NO_EVENT
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(Object aObject, int aIndex) Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.void
addElements
(Vector aVector, int aIndex) Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.void
addModelListener
(ILcdModelListener aILcdModelListener) Registers the specified model listener to receive notifications of model changes on this model.int
applyOnInteract2DBounds
(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunctionToApply, double aPrecisionX, double aPrecisionY) Applies the specified function to all the model elements of which the 2D bounds overlap with the specified bounds.int
applyOnInteract2DBounds
(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunctionToApply, double aPrecisionX, double aPrecisionY, double aMinSizeX, double aMinSizeY, boolean aIncludePoints) Applies the specified function to all the elements of which the 2D bounds overlap with the specified bounds.boolean
canAddElement
(Object aObject) Always returns false, because TLcdWFSProxyModel is read-only.boolean
canRemoveElement
(Object aObject) Always returns false, because TLcdWFSProxyModel because read-only.void
dispose()
Disposes of this model and allows it to release any system resources that it is holding.void
elementChanged
(Object aObject, int aEventMode) Does nothing, because TLcdWFSProxyModel is read-only.elements()
Returns an enumeration over all elements of this model.void
elementsChanged
(Vector aVector, int aEventMode) Does nothing, because TLcdWFSProxyModel is read-only.void
Notifies all listeners that are registered on this model of all the changes that have been collected between the previous notification and now.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.int
Gets the caching mode.Returns the current OGC Filter used in queries sent to the WFS.Returns the name of the geometry property that will be used for building spatial filters.Returns the max features parameter that will be used for querying the remote WFS.Returns theILcdModelDescriptor
providing meta information about this model and its elements.Returns, if available, a model encoder that is capable of encoding this model, (encoder.canEncode(this)
),null
otherwise.Returns theILcdModelReference
describing how the geometry of the elements contained in this model should be interpreted.void
Invalidates the contents of the model, meaning that any locally cached data is removed.void
invalidate
(int aEventMode) Invalidates the contents of the model, meaning any locally cached data is removed.<T> Stream
<T> query
(ILcdModel.Query aQuery) Provides aStream
of all elements in this model that match the given query.void
removeAllElements
(int aIndex) Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.void
removeElement
(Object aObject, int aIndex) Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.void
removeElements
(Vector aVector, int aIndex) Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.void
removeModelListener
(ILcdModelListener aILcdModelListener) Unregisters the specified model listener so that it no longer receives notifications of model changes on this model.void
setCachingMode
(int aCachingMode) Sets the caching mode and clears any cached content.void
setCachingMode
(int aCachingMode, int aFireEventMode) Sets the caching mode.void
setExceptionHandler
(ILcdExceptionHandler aExceptionHandler) Sets an exception handler.void
setFilter
(TLcdOGCFilter aFilter) Sets the filter to be applied to features retrieved from the WFS.void
setFilter
(TLcdOGCFilter aFilter, int aEventMode) Sets the filter to be applied to features retrieved from the WFS.void
setGeometryPropertyName
(QName aGeometryPropertyName) Sets the name of the geometry property to be used for building spatial filters.void
setMaxFeatures
(Integer aMaxFeatures) Sets the max features parameter to be used for querying the remote WFS.Methods inherited from class com.luciad.model.ALcdModel
allElementsChanged, allElementsRemoved, elementAdded, elementRemoved, elementsAdded, elementsRemoved, getModelMetadata, initializeTransientValues, isClassTraceOn, isTraceOn, setClassTraceOn, setModelDescriptor, setModelDisposer, setModelEncoder, setModelMetadataFunction, setModelReference, setTraceOn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdDisposable
close
Methods inherited from interface com.luciad.model.ILcdModel
getModelMetadata
-
Field Details
-
NO_CACHE
public static final int NO_CACHENo caching is performed. Data are requested on demand.
Note that this mode is not suited for visualizing the
TLcdWFSProxyModel
on the map. Because this mode returns new domain object instances on eachapplyOnInteract2DBounds(ILcdBounds, boolean, ILcdFunction, double, double)
andelements()
call, it does not support labeling nor selection.A possible use-case of this mode is when you want to use the
TLcdWFSProxyModel
to send a certain query to the server, obtain the results of that query and then dispose of the model. In this scenario, theTLcdWFSProxyModel
is only used to send the query to the server and to accept the result:TLcdWFSProxyModel model = TLcdWFSProxyModelFactory.createXXX; //set all the query parameters on the model model.setMaxFeatures(100); model.setFilter( ... ); //Either use elements or applyOnInteract2DBounds, //depending on whether you want to apply extra bounds filtering Enumeration elements = model.elements(); while( elements.hasMoreElements() ){ Object element = elements.nextElement; //do something with the element } model = null;//do no longer use the model
- See Also:
-
CACHE_ALL
public static final int CACHE_ALLAll data are retrieved and cached at first access.- See Also:
-
SMART_CACHE
public static final int SMART_CACHEIn this mode, data is requested on demand. For example when visualizing the data on a view, only the data currently visible in the view will be queried from the server. When panning around in the view, data for the new area will be loaded from the server if not yet available in the cache.
This is the recommended mode when working with large data sets. For large data sets, make sure to limit the number of features that is requested from the server. This can either be done by specifying the
maximum number of features
, or by specifying afilter
.For small data sets which fit into memory, this mode works very similar to
CACHE_ALL
. As soon as all data is loaded into the cache, no extra requests to the server will be made.For large data sets which do not fit completely in memory, care must be taken that the model never requests all data from the server. This would happen when visualizing the data on a view, and zooming out on the view so that the whole world becomes visible. Avoiding that all data gets requested can for example by achieved by setting the
maxFeatures
to a sensible value, or specifying anOGC filter
to limit the data. If the model is only used in a layer, another alternative is to set a scale range on the layer which visualizes the data.- Since:
- 2016.1
- See Also:
-
-
Method Details
-
setExceptionHandler
Sets an exception handler.- Parameters:
aExceptionHandler
- the exception handler.
-
getFilter
Returns the current OGC Filter used in queries sent to the WFS.- Returns:
- the current OGC Filter used in queries sent to the WFS.
-
setFilter
Sets the filter to be applied to features retrieved from the WFS.This operation only sets the filter and clears the caches content, without sending events and triggering new data queries. By itself, it is thus a cheap operation. However, any access afterwards to the model content (either through
elements()
or throughapplyOnInteract2DBounds(com.luciad.shape.ILcdBounds, boolean, com.luciad.util.ILcdFunction, double, double)
) will trigger a new query to the server, which can be a potential expensive operation.Because this method does not send any event, the layer containing the model needs to be updated manually. By using
setFilter(TLcdOGCFilter, int)
instead of this method, an event can be sent that automatically updates the layer.As this method can update the content of this model, a write lock needs to be used.
Calling this method when the
caching mode
is set toSMART_CACHE
might perform requests to the server, making this an expensive method call.- Parameters:
aFilter
- an OGC Filter to be used for any subsequent WFS queries sent by this model- See Also:
-
setFilter
Sets the filter to be applied to features retrieved from the WFS.This operation sets the filter, clears the cached content and sends a model changed event with the given mode. Depending on the event mode, it can trigger a new data query, which can potentially be an expensive operation.
As this method can update the content of this model, a write lock needs to be used.
Calling this method when the
caching mode
is set toSMART_CACHE
might perform requests to the server, making this an expensive method call.Usage example :
TLcdOGCFilter filter = ...; try (TLcdLockUtil.Lock autoUnlock = TLcdLockUtil.writeLock(proxyModel)) { proxyModel.setFilter(filter, ILcdFireEventMode.FIRE_LATER); } finally { proxyModel.fireCollectedModelChanges(); }
- Parameters:
aFilter
- an OGC Filter to be used for any subsequent WFS queries sent by this modelaEventMode
- the mode for sending out the model change event. This can be one of FIRE_NOW, FIRE_LATER or NO_EVENT.- Since:
- 2016.1
-
invalidate
public void invalidate()Invalidates the contents of the model, meaning that any locally cached data is removed. The next time the model is accessed, new WFS queries are sent to the server to retrieve the necessary data.This method does not send any event, in contrast with
invalidate(int)
. Sending an event automatically updates the layer containing the model. Without an event, the layer needs to be updated manually.As this method can update the content of this model, a write lock needs to be used.
Calling this method when the
caching mode
is set toSMART_CACHE
might perform requests to the server, making this an expensive method call.- See Also:
-
invalidate
public void invalidate(int aEventMode) Invalidates the contents of the model, meaning any locally cached data is removed. Afterwards, a model changed event is sent with the given mode, Depending on the event mode, it can trigger a new data query, which can potentially be an expensive operation.As this method can update the content of this model, a write lock needs to be used.
Usage example:
try (TLcdLockUtil.Lock autoUnlock = TLcdLockUtil.writeLock(proxyModel)) { proxyModel.invalidate(ILcdFireEventMode.FIRE_LATER); } finally { proxyModel.fireCollectedModelChanges(); }
Calling this method when the
caching mode
is set toSMART_CACHE
might perform requests to the server, making this an expensive method call.- Parameters:
aEventMode
- the mode for sending out the model change event. This can be one of FIRE_NOW, FIRE_LATER or NO_EVENT.- Since:
- 2016.1
-
getCachingMode
public int getCachingMode()Gets the caching mode.- Returns:
- the caching mode.
- See Also:
-
setCachingMode
public void setCachingMode(int aCachingMode) Sets the caching mode and clears any cached content. The next time the model is accessed, new WFS queries are sent to the server to retrieve the necessary data.This method does not send any event.
As this method can update the content of this model, a write lock needs to be used.
Calling this method with mode
SMART_CACHE
might perform requests to the server, making this an expensive method call.- Parameters:
aCachingMode
- one of the constant defined in this class.- See Also:
-
setCachingMode
public void setCachingMode(int aCachingMode, int aFireEventMode) Sets the caching mode. If different that the current cache mode, it clears any cached content and send a model changed event with the given mode. As this method can update the content of this model, a write lock needs to be used. Calling this method with modeSMART_CACHE
might perform requests to the server, making this an expensive method call.- Parameters:
aCachingMode
- one of the constant defined in this class.- Since:
- 2016.1
- See Also:
-
getMaxFeatures
Returns the max features parameter that will be used for querying the remote WFS.This allows to limit the number of objects returned by the server and then preventing from downloading the full data set in one request.
- Returns:
- the max features parameter that will be used for querying the remote WFS.
-
setMaxFeatures
Sets the max features parameter to be used for querying the remote WFS. This is used for any subsequent queries sent by this model. Calling this method when thecaching mode
is set toSMART_CACHE
might perform requests to the server, making this an expensive method call.- Parameters:
aMaxFeatures
- the max features parameter that will be used for querying the remote WFS.- See Also:
-
getGeometryPropertyName
Returns the name of the geometry property that will be used for building spatial filters.A default geometry name is selected automatically from the feature type.
- Returns:
- the name of the geometry property that will be used for building spatial filters.
-
setGeometryPropertyName
Sets the name of the geometry property to be used for building spatial filters. This is used for any subsequent queries sent by this model.- Parameters:
aGeometryPropertyName
- the name of the geometry property that will be used for building spatial filters.
-
applyOnInteract2DBounds
public int applyOnInteract2DBounds(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunctionToApply, double aPrecisionX, double aPrecisionY) Description copied from interface:ILcd2DBoundsIndexedModel
Applies the specified function to all the model elements of which the 2D bounds overlap with the specified bounds. By default, the order in which the function is applied on the elements is unspecified and depends on the implementation. The return value of the specified function is used as a stop criterion: the spatial query is interrupted if the function returnsfalse
.- Specified by:
applyOnInteract2DBounds
in interfaceILcd2DBoundsIndexedModel
- Parameters:
aBounds
- the rectangle to test overlap with.aStrictInteract
- iffalse
, the spatial search may return more elements than the ones strictly overlapping; iftrue
, the search only returns the elements that are overlapping. The latter mode is more precise, but it may be slower.aFunctionToApply
- the function to apply on each element that overlaps with the given bounds. The return value of the specified function is used as a stop criterion: the spatial query is interrupted if the function returnsfalse
.aPrecisionX
- the precision required in the x dimension, expressed in model units. For example, for a cartesian grid system expressed in meters, the values should be expressed in meters as well, for a geodetic coordinate system the accuracy values should be expressed in degrees.The precision is useful in combination with multi-leveled data (multiple representations of the same object, but with varying accuracy), so that the most appropriate accuracy level can be used. 0 means best possible accuracy, but it might trigger lazy-loaded implementations to load lots of data.
aPrecisionY
- the precision required in the y dimension, expressed in model units.- Returns:
- the number of elements to which the
ILcdFunction
has been applied.
-
applyOnInteract2DBounds
public int applyOnInteract2DBounds(ILcdBounds aBounds, boolean aStrictInteract, ILcdFunction aFunctionToApply, double aPrecisionX, double aPrecisionY, double aMinSizeX, double aMinSizeY, boolean aIncludePoints) Description copied from interface:ILcd2DBoundsInteractable
Applies the specified function to all the elements of which the 2D bounds overlap with the specified bounds. The order in which the function is applied on the elements is unspecified and depends on the implementation. Only elements that have at least the specified minimal size in the x dimension or in the y dimension are considered. This can be useful for quickly eliminating elements that are too small to be visible in a view, for instance. If required, an exception can be made for point elements, which have a size of 0 by 0. They can be forced to be considered, even though they would always be rejected as being too small for any sizes larger than 0. The return value of the specified function is used as a stop criterion: the spatial query will be interrupted as soon as the function returnsfalse
for an element it was applied on.- Specified by:
applyOnInteract2DBounds
in interfaceILcd2DBoundsIndexedModel
- Specified by:
applyOnInteract2DBounds
in interfaceILcd2DBoundsInteractable
- Parameters:
aBounds
- the rectangle to test overlap with.aStrictInteract
- iffalse
, the spatial search may return more elements than the ones strictly overlapping; iftrue
, the search only returns the elements that are overlapping. The latter mode is more precise, but it may be slower.aFunctionToApply
- the function to apply on each element that overlaps with the given bounds.aPrecisionX
- the precision required in the x dimension, expressed in model units. For example, for a cartesian grid system expressed in meters, the values should be expressed in meters as well, for a geodetic coordinate system the accuracy values should be expressed in degrees.The precision is useful in combination with multi-leveled data (multiple representations of the same object, but with varying accuracy), so that the most appropriate accuracy level can be used. 0 means best possible accuracy, but it might trigger lazy-loaded implementations to load lots of data.
aPrecisionY
- the precision required in the y dimension, expressed in model units.aMinSizeX
- the minimal element size in the x dimension (as inILcdBounds.getWidth()
), expressed in model units. Elements that are smaller than this size will be skipped. This may, for example, be useful when improving the efficiency of painting elements by skipping elements that are smaller than some threshold (e.g. one pixel, converted to model units).aMinSizeY
- the minimal element size in the y dimension (as inILcdBounds.getHeight()
), expressed in model units.aIncludePoints
- iftrue
, zero-sized elements (points) are considered as well, even though they might be smaller than the minimum size.- Returns:
- the number of elements to which the
ILcdFunction
has been applied.
-
query
Description copied from interface:ILcd2DBoundsIndexedModel
Provides aStream
of all elements in this model that match the given query.If the query condition contains a spatial component (either
bounding-box test
, or a spatial operator)applyOnInteracts2DBounds
is used first to narrow down the set of relevant objects. The rest of the conditions are then evaluated on that subset.If the query condition contains a
Overall documentation: Provides aminimum object size
aspect, that minimum size is passed as arguments to theapplyOnInteract2DBounds
call.Stream
of all elements in this model that match the given query.The query aspects are applied in this specific order, regardless of the order used to create the query:
- The query
filter
is applied first (if any). - The query
sorting
is applied second (if any). - The query
limit
is applied last (if any).
condition
andsort-by
must never change after creation.Examples:
- model.
query
(all
()); - model.
query
(filter
(new TLcdOGCBBoxOperator(...))); - model.
query
(filter
(eq(property("name"), literal("Leuven"))); - model.
query
(all
().sorted
(comparing(property("population"), DESC)); - model.
query
(all
().limit
(150)); - model.
query
(filter
(and(bboxCondition, ogcCondition)).sorted
(sortByPopulation).limit
(120));
A
stream
iscloseable
, and it depends on the implementation whether the stream has to be closed or not.
You should use this template to ensure proper model locking and stream closing:try (TLcdLockUtil.Lock autoUnlock = TLcdLockUtil.readLock(model); Stream elements = model.query(all())) { elements.forEach(System.err::println); }
Model implementations:
By default, this method will invoke
elements()
, loop over all elements and apply the filter, sorting and limit.For
Overriding:ILcd2DBoundsIndexedModel
, this method will invokeapplyOnInteract2DBounds()
if the condition contains a spatial component (either a bounding-box operator, or a spatial operator), and apply the rest of the filter on those elements.Model implementers can override this method to apply the query more efficiently on their back-end format.
For example, if your back-end is a service or database that accepts certain queries, you can override this method and transform the condition into a query on that service.
You can inspect the condition usinginstanceof
on the various condition classes.- Specified by:
query
in interfaceILcd2DBoundsIndexedModel
- Specified by:
query
in interfaceILcdModel
- Parameters:
aQuery
- The query, cannot benull
. PassILcdModel.all()
if you want all elements.- Returns:
- a stream of the retained model elements
- See Also:
- The query
-
getModelReference
Description copied from class:ALcdModel
Returns theILcdModelReference
describing how the geometry of the elements contained in this model should be interpreted.- Specified by:
getModelReference
in interfaceILcdModel
- Overrides:
getModelReference
in classALcdModel
- Returns:
- the
ILcdModelReference
of thisILcdModel
. - See Also:
-
getModelDescriptor
Description copied from class:ALcdModel
Returns theILcdModelDescriptor
providing meta information about this model and its elements.- Specified by:
getModelDescriptor
in interfaceILcdModel
- Overrides:
getModelDescriptor
in classALcdModel
- Returns:
- the
ILcdModelDescriptor
of thisILcdModel
. Should not benull
. - See Also:
-
getModelEncoder
Description copied from class:ALcdModel
Returns, if available, a model encoder that is capable of encoding this model, (encoder.canEncode(this)
),null
otherwise.- Specified by:
getModelEncoder
in interfaceILcdModel
- Overrides:
getModelEncoder
in classALcdModel
- Returns:
- a model encoder that is capable of encoding this model if available,
null
otherwise. - See Also:
-
elements
Description copied from interface:ILcdModel
Returns an enumeration over all elements of this model. The order in which the elements are enumerated is unspecified by default. -
addElement
Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.- Specified by:
addElement
in interfaceILcdModel
- Overrides:
addElement
in classALcdModel
- Parameters:
aObject
- the element to be added to this model.aIndex
- the mode for sending out the model change event. This can beFIRE_LATER
orNO_EVENT
.- Throws:
UnsupportedOperationException
- this method is not implementedIllegalArgumentException
- See Also:
-
canAddElement
Always returns false, because TLcdWFSProxyModel is read-only.- Specified by:
canAddElement
in interfaceILcdModel
- Overrides:
canAddElement
in classALcdModel
- Parameters:
aObject
- the element to be verified.- Returns:
true
if the specified element can be added to this model,false
otherwise.
-
addElements
Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.- Specified by:
addElements
in interfaceILcdModel
- Overrides:
addElements
in classALcdModel
- Parameters:
aVector
- the vector of elements to be added to this model.aIndex
- the mode for sending the model change events This can beFIRE_LATER
orNO_EVENT
.- Throws:
UnsupportedOperationException
- this method is not implemented- See Also:
-
removeElement
Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.- Specified by:
removeElement
in interfaceILcdModel
- Overrides:
removeElement
in classALcdModel
- Parameters:
aObject
- the element to be removed from this model.aIndex
- the mode for sending out the model change event. This can beFIRE_LATER
orNO_EVENT
.- Throws:
UnsupportedOperationException
- this method is not implementedIllegalArgumentException
- See Also:
-
canRemoveElement
Always returns false, because TLcdWFSProxyModel because read-only.- Specified by:
canRemoveElement
in interfaceILcdModel
- Overrides:
canRemoveElement
in classALcdModel
- Parameters:
aObject
- the element to be verified.- Returns:
true
if the specified element can be removed from this model,false
otherwise.
-
removeElements
Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.- Specified by:
removeElements
in interfaceILcdModel
- Overrides:
removeElements
in classALcdModel
- Parameters:
aVector
- the vector of elements to be removed from this model.aIndex
- the mode for sending out the model change event. This can beFIRE_LATER
orNO_EVENT
.- Throws:
UnsupportedOperationException
- this method is not implemented- See Also:
-
removeAllElements
public void removeAllElements(int aIndex) Always throws an UnsupportedOperationException, because TLcdWFSProxyModel is read-only.- Specified by:
removeAllElements
in interfaceILcdModel
- Overrides:
removeAllElements
in classALcdModel
- Parameters:
aIndex
- the mode for sending out the model change event. This can beFIRE_LATER
orNO_EVENT
.- Throws:
UnsupportedOperationException
- this method is not implemented
-
elementChanged
Does nothing, because TLcdWFSProxyModel is read-only.- Specified by:
elementChanged
in interfaceILcdModel
- Overrides:
elementChanged
in classALcdModel
- Parameters:
aObject
- the element that has changed.aEventMode
- the mode for sending out the model change event. This can beFIRE_LATER
orNO_EVENT
.
-
elementsChanged
Does nothing, because TLcdWFSProxyModel is read-only.- Specified by:
elementsChanged
in interfaceILcdModel
- Overrides:
elementsChanged
in classALcdModel
- Parameters:
aVector
- the vector of elements that have changed.aEventMode
- the mode for sending out the model change event. This can beFIRE_LATER
orNO_EVENT
.
-
fireCollectedModelChanges
public void fireCollectedModelChanges()Notifies all listeners that are registered on this model of all the changes that have been collected between the previous notification and now.- Specified by:
fireCollectedModelChanges
in interfaceILcdModel
- Overrides:
fireCollectedModelChanges
in classALcdModel
- See Also:
-
addModelListener
Registers the specified model listener to receive notifications of model changes on this model.Model changes are sent out when settings of this model have been changed that impact the content. This can be through
setFilter(TLcdOGCFilter, int)
,setCachingMode(int)
(TLcdOGCFilter, int)} andinvalidate(int)
. Model changes can be sent out individually, grouped or silently applied without notifications, depending on the ILcdFireEventMode that was specified with the change.In case you need to register a listener which keeps a reference to an object with a shorter life-time than this model, you can use a
ALcdWeakModelListener
instance as model listener.- Specified by:
addModelListener
in interfaceILcdModel
- Overrides:
addModelListener
in classALcdModel
- Parameters:
aILcdModelListener
- theILcdModelListener
to register on this model.- See Also:
-
removeModelListener
Unregisters the specified model listener so that it no longer receives notifications of model changes on this model.- Specified by:
removeModelListener
in interfaceILcdModel
- Overrides:
removeModelListener
in classALcdModel
- Parameters:
aILcdModelListener
- theILcdModelListener
to remove.- See Also:
-
dispose
public void dispose()Description copied from class:ALcdModel
Disposes of this model and allows it to release any system resources that it is holding. The result of calling any other method (other thanfinalize
) on this model subsequent to a call to this method is undefined.When a model disposer has been provided it is called, otherwise this method does nothing. When overriding this method it is recommended to call
super.dispose()
. -
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefined
bounds. You can create undefined bounds using the default constructors ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
getFeatureType
- Returns:
- the feature type of this model.
-
getWFSClient
- Returns:
- the WFS client.
-