|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.maps.datasource.IlvMapDataSource
ilog.views.maps.datasource.IlvHierarchicalDataSource
public class IlvHierarchicalDataSource
A data source that sorts graphic objects into layers according to their attributes. It relies on the underlying feature iterator to get a list of objects, and then applies a list a filters on each object to determine what layer it should be added to. This way, objects added via this data source can be grouped in hierarchical fashion. For instance a road object will be added in the road layer within the transportation layer.
| Nested Class Summary | |
|---|---|
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. |
| Field Summary | |
|---|---|
protected IlvMapReusableFeatureIterator |
featureIterator
The IlvMapReusableFeatureIterator of this data source |
protected String |
filename
the file this data source is based upon |
protected HashMap |
nameMap
Hashmap containing explicit names for attributes values (usually codes). |
protected HashMap |
styleMap
The (internal) table used to map a feature kep to a style. |
| Fields inherited from class ilog.views.maps.datasource.IlvMapDataSource |
|---|
renderer, usingGeodeticComputation |
| Constructor Summary | |
|---|---|
IlvHierarchicalDataSource(IlvInputStream stream)
Constructs a IlvHierarchicalDataSource from the specified input stream. |
|
IlvHierarchicalDataSource(String filename)
Constructs a IlvHierarchicalDataSource from a specified file. |
|
| Method Summary | |
|---|---|
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. |
Iterator |
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 does not have a value for 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 does not have a value for 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected IlvMapReusableFeatureIterator featureIterator
IlvMapReusableFeatureIterator of this data source
protected String filename
protected HashMap styleMap
protected HashMap nameMap
| Constructor Detail |
|---|
public IlvHierarchicalDataSource(IlvInputStream stream)
throws IlvReadFileException
IlvHierarchicalDataSource from the specified input stream.
stream - the IlvInputStream to constructs 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 URL| Method Detail |
|---|
public IlvMapReusableFeatureIterator getFeatureIterator()
getFeatureIterator in class IlvMapDataSource
public void write(IlvOutputStream stream)
throws IOException
IlvHierarchicalDataSource to an IlvOutputStream.
write in interface IlvPersistentObjectwrite in class IlvMapDataSourcestream - The stream to write to.
IOExceptionpublic void addCriterionFilter(IlvHierarchicalDataSource.CriterionFilter filter)
filter - the CriterionFilter to addpublic Iterator getCriterionFilters()
CriterionFilter of this data source
public 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 IlvMapDataSourceIlvFeatureRenderer.
ExceptionIlvMapDataSource.getFeatureRenderer()protected final Object getKey(IlvMapFeature feature)
feature - the map feature whose key is needed.
protected IlvMapStyle getStyle(IlvMapFeature feature)
throws Exception
feature - the IlvMapFeature.
IlvMapStyle for the feature
Exception - if an appropriate style could not be found for the specified feature.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 IlvMapDataSourceIlvMapDataSource.reset()public boolean isAcceptNullValues()
protected IlvMapLayer getMapLayer(IlvMapFeature feature)
IlvMapFeature
getMapLayer in class IlvMapDataSourcefeature - The specified map feature
protected 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 add
public void start()
throws Exception
start in class IlvMapDataSourceExceptionprotected IlvMapLayer createInsertionLayer()
createInsertionLayer in class IlvMapDataSourceIlvMapDataSource.createInsertionLayer()
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||