public class IlvHierarchicalDataSource extends IlvMapDataSource
Modifier and Type | Class and Description |
---|---|
static class |
IlvHierarchicalDataSource.CriterionFilter
A value extractor for map features.
|
static class |
IlvHierarchicalDataSource.SingleAttributeFilter
A specialized criterion filter that returns the value of an attribute of a
map feature.
|
Modifier and Type | Field and Description |
---|---|
protected IlvMapReusableFeatureIterator |
featureIterator
The
IlvMapReusableFeatureIterator of this data source |
protected String |
filename
The file this data source is based upon
|
protected HashMap<String,String> |
nameMap
Hashmap containing explicit names for attributes values (usually codes).
|
protected HashMap<Object,Object> |
styleMap
The (internal) table used to map a feature key to a style.
|
renderer, usingGeodeticComputation
Constructor and Description |
---|
IlvHierarchicalDataSource(IlvInputStream stream)
Constructs an
IlvHierarchicalDataSource from the specified
input stream. |
IlvHierarchicalDataSource(String filename)
Constructs an
IlvHierarchicalDataSource from a specified file. |
Modifier and Type | Method and Description |
---|---|
void |
addCriterionFilter(IlvHierarchicalDataSource.CriterionFilter filter)
Adds a criterion filter at the end of the list of filters.
|
protected void |
addLayer(IlvMapLayer parent,
IlvMapLayer layer)
Adds a specified
IlvMapLayer in the specified parent layer. |
protected IlvFeatureRenderer |
createFeatureRenderer()
Returns a renderer created for this datasource.
|
protected IlvMapLayer |
createInsertionLayer()
Creates the insertion layer.
|
protected IlvMapStyle |
createStyle(Class<?> geometryClass,
Object styleKey)
Creates a map style designed to be applied to the specified geometry class.
|
Iterator<IlvHierarchicalDataSource.CriterionFilter> |
getCriterionFilters()
Returns an iterator over the list of
CriterionFilter of this
data source |
IlvMapReusableFeatureIterator |
getFeatureIterator()
Retrieves the feature iterator used by this data source.
|
IlvFeatureRenderer |
getFeatureRenderer()
Overrides the parent method to always create a renderer that creates
IlvMapGraphic objects.
|
IlvFeatureRenderer |
getFeatureRenderer(IlvMapFeature feature)
Gets the appropriate feature renderer for the specified
IlvMapFeature . |
protected Object |
getKey(IlvMapFeature feature)
Associates a key to a map feature.
|
protected IlvMapLayer |
getMapLayer(IlvMapFeature feature)
Return< the mapLayer containing the specified
IlvMapFeature |
protected IlvMapStyle |
getStyle(IlvMapFeature feature)
Returns a map style for the specified feature.
|
boolean |
isAcceptNullValues()
Returns whether this data source should discard map features which do not
have a value for the specified criteria (in the filter list).
|
void |
readInfo(String info)
Creates the table of attributes values from a text file description.
|
void |
removeAllCriterionFilters()
Removes all the filters from this
IlvHierarchicalDataSource |
void |
removeCriterionFilter(IlvHierarchicalDataSource.CriterionFilter filter)
Removes a criterion filter from the list of filters.
|
void |
reset()
Resets the data source and prepares it for reloading.
|
void |
setAcceptNullValues(boolean acceptNullValues)
Sets whether this data source should discard map features which do not have
a value for the specified criteria (in the filter list).
|
protected void |
setupLayer(IlvMapLayer layer,
IlvMapFeature feature)
Sets up the layer to receive features.
|
void |
start()
Starts this data source.
|
void |
write(IlvOutputStream stream)
Writes this
IlvHierarchicalDataSource to an
IlvOutputStream . |
addDataSourceListener, callListeners, getBackupDataSources, getCoordinateSystem, getDescription, getInsertionLayer, getManager, getName, getNode, getValidExtentions, hasInsertionLayer, initBackupDataSource, initInsertionLayer, isAttachingAttributes, isGrapherMode, isSaveBackupDataSources, isSourceDataAvailable, isUsingBackupDataSource, isUsingGeodeticComputation, mapIntersects, removeDataSourceListener, setAttachingAttributes, setCoordinateSystem, setDescription, setFeatureRenderer, setForceUsingBackupDataSource, setGrapherMode, setInsertionLayer, setManager, setName, setSaveBackupDataSources, setValidExtentions, toString
protected IlvMapReusableFeatureIterator featureIterator
IlvMapReusableFeatureIterator
of this data sourceprotected String filename
protected HashMap<Object,Object> styleMap
public IlvHierarchicalDataSource(IlvInputStream stream) throws IlvReadFileException
IlvHierarchicalDataSource
from the specified
input stream.stream
- The IlvInputStream
to construct the data source from.IlvReadFileException
- exception thrown if an error was encountered when deserializing
this object.public IlvHierarchicalDataSource(String filename) throws MalformedURLException
IlvHierarchicalDataSource
from a specified file.filename
- The file containing map data.MalformedURLException
- If the path cannot be parsed as a URLpublic IlvMapReusableFeatureIterator getFeatureIterator()
getFeatureIterator
in class IlvMapDataSource
public void write(IlvOutputStream stream) throws IOException
IlvHierarchicalDataSource
to an
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvMapDataSource
stream
- The stream to write to.IOException
public void addCriterionFilter(IlvHierarchicalDataSource.CriterionFilter filter)
filter
- The CriterionFilter
to addpublic Iterator<IlvHierarchicalDataSource.CriterionFilter> getCriterionFilters()
CriterionFilter
of this
data sourcepublic void removeCriterionFilter(IlvHierarchicalDataSource.CriterionFilter filter)
filter
- The CriterionFilter
to removepublic void removeAllCriterionFilters()
IlvHierarchicalDataSource
public void readInfo(String info)
info
- The description file.protected IlvFeatureRenderer createFeatureRenderer() throws Exception
getFeatureRenderer()
and
getFeatureRenderer(IlvMapFeature)
methods calls. The default
implementation creates a renderer through
IlvDataSourceStylingFactory.createDefaultRenderer(boolean, boolean)
Exception
public IlvFeatureRenderer getFeatureRenderer(IlvMapFeature feature) throws Exception
IlvMapFeature
.feature
- The feature to render.IlvFeatureRenderer
.Exception
- if a feature renderer does not exist for the specified
IlvMapFeature
.public IlvFeatureRenderer getFeatureRenderer() throws Exception
getFeatureRenderer
in class IlvMapDataSource
IlvFeatureRenderer
.Exception
IlvMapDataSource.getFeatureRenderer()
protected final Object getKey(IlvMapFeature feature)
feature
- The map feature whose key is needed.protected IlvMapStyle getStyle(IlvMapFeature feature) throws Exception
createStyle(Class, Object)
feature
- The IlvMapFeature
.IlvMapStyle
for the featureException
- if an appropriate style could not be found for the specified
feature.protected IlvMapStyle createStyle(Class<?> geometryClass, Object styleKey)
IlvDataSourceStylingFactory.createDefaultFeatureStyle(Class, Object, boolean)
but you can override this.geometryClass
- The subclass IlvMapGeometry
styleKey
- The style key see getKey(IlvMapFeature)
public void setAcceptNullValues(boolean acceptNullValues)
acceptNullValues
- If true
, such features will be added to the parent
layer. If false
, they will not be added to the map.public void reset()
reset
in class IlvMapDataSource
IlvMapDataSource.reset()
public boolean isAcceptNullValues()
true
if such features are added to the parent layer.
False
if they are added to the map.protected IlvMapLayer getMapLayer(IlvMapFeature feature)
IlvMapFeature
getMapLayer
in class IlvMapDataSource
feature
- The specified map featureprotected void setupLayer(IlvMapLayer layer, IlvMapFeature feature)
feature
.layer
- The layerfeature
- The feature for which the layer was createdgetStyle(IlvMapFeature)
protected void addLayer(IlvMapLayer parent, IlvMapLayer layer)
IlvMapLayer
in the specified parent layer.parent
- The parent layer.layer
- The IlvMapLayer
to addpublic void start() throws Exception
start
in class IlvMapDataSource
Exception
protected IlvMapLayer createInsertionLayer()
createInsertionLayer
in class IlvMapDataSource
IlvMapDataSource.createInsertionLayer()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.