public abstract class IlvDefaultTilableDataSource extends IlvHierarchicalDataSource
IlvHierarchicalDataSource.CriterionFilter, IlvHierarchicalDataSource.SingleAttributeFilter
Modifier and Type | Field and Description |
---|---|
static IlvGeometryClassFilter[] |
GeometryClassInformation
List of geometries managed by the tilable datasource.
|
featureIterator, filename, nameMap, styleMap
renderer, usingGeodeticComputation
Constructor and Description |
---|
IlvDefaultTilableDataSource(IlvInputStream stream)
Constructs an
IlvDefaultTilableDataSource from the specified
IlvInputStream |
IlvDefaultTilableDataSource(String filename)
Constructs a
IlvDefaultTilableDataSource from the specified file name. |
IlvDefaultTilableDataSource(URL url)
Constructs an
IlvDefaultTilableDataSource from the specified url. |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsCode(Object codeValue)
Indicates if the current data source accepts the specified code value.
|
protected void |
addLayer(IlvMapLayer parent,
IlvMapLayer layer)
Adds a specified
IlvMapLayer in the specified parent layer. |
protected IlvDefaultFeatureFilter |
createDefaultFilter()
Creates, at construction time, the filter that will be used to separate
features into layers.
|
protected abstract IlvMapReusableFeatureIterator |
createFeatureIterator(String fileName)
Method used in
IlvDefaultTilableDataSource(String) constructor to build the data source reader. |
protected abstract IlvMapReusableFeatureIterator |
createFeatureIterator(URL urlName)
Method used in the
IlvDefaultTilableDataSource(URL) constructor to build the data source reader. |
protected void |
createGenericTiles(IlvTileController tileController,
IlvCoordinateTransformation tr)
This method creates the free tiles in the tiled layer
|
protected abstract IlvMapRegionOfInterestIterator |
createTiledIterator(IlvFeatureClassInformation featureClass,
IlvGeometryClassFilter geometryClass)
Should create the specific
IlvMapRegionOfInterestIterator to be used for this data source. |
protected void |
createTiledLayers()
Creates the set of
IlvMapLayer to be used for tile management. |
int |
getColumnCount()
Returns the tile column Count.
|
protected String |
getFeatureFilterPropertyName()
Deprecated.
since JViews 8.1, this method is deprecated and should be replaced by an implementation of
createDefaultFilter() |
IlvMapReusableFeatureIterator |
getFeatureIterator()
Retrieves the feature iterator used by this data source.
|
Object |
getFeatureName(Object codeValue)
Returns the feature name for the feature code passed or null.
|
protected IlvGeometryClassFilter[] |
getGeometryClassFilters()
By default, returns
GeometryClassInformation |
IlvGeometryClassFilter |
getGeometryClassInformation(IlvMapFeature feature)
Returns the geometry class information for the selected feature.
|
double |
getLatMax()
Returns the latitude Maximum.
|
double |
getLatMin()
Returns the latitude Minimum.
|
protected Integer |
getLayerOrder(IlvMapLayer layer)
A utility method that retrieves the map layer order.
|
double |
getLonMax()
Returns the longitude Maximum.
|
double |
getLonMin()
Returns the longitude Minimum..
|
IlvThreadMonitoringData |
getMonitoringData()
Returns the monitorData.
|
int |
getRowCount()
Returns the tile row Count.
|
URL |
getURL()
Retrieves the
URL given at construction time. |
protected abstract void |
initFeatureList()
Specific initialization done when data source is created.
|
boolean |
isMultiThreaded()
Returns whether the tiled layer created by this data source uses
multithreading to load tiles
|
protected boolean |
isSourceDataAvailable()
Checks whether the source data this
IlvMapDataSource is
based on is available (file, database connection, url...). |
boolean |
isUsingTiling()
Returns whether tiling is used.
|
String |
makeLayerName(String name,
IlvGeometryClassFilter d)
Creates a layer name from a feature name and a geometry class.
|
void |
readInfo(String info)
Creates the table of attributes values from a text file description.
|
void |
reset()
Resets the data source.
|
void |
setAcceptedCodeList(String[] codes)
Sets the list of accepted object codes
|
void |
setAreaOfinterest(double lonMin,
double latMin,
double lonMax,
double latMax)
Sets the area outside of which data will not be fetched.
|
protected void |
setLayerOrder(IlvMapLayer layer,
Integer order)
A utility method that stores the map layer order.
|
void |
setMonitoringData(IlvThreadMonitoringData monitorData)
Sets the monitor data.
|
void |
setMultiThreaded(boolean t)
Indicates whether the tiled layer created by this data source will use
multithreading to load tiles.
|
void |
setTilingParameters(boolean useTiling,
int rows,
int columns)
Sets tiling parameters for this data source.
|
protected void |
setupLayer(IlvMapLayer layer,
IlvMapFeature feature)
This method has been overridden so the preferred order in the layer is also
stored.
|
protected void |
setupTiledLoaders()
Sets up tile loader for all map layer children of the insertion layer.
|
void |
setURL(URL url)
Sets the
URL . |
void |
start()
Starts this data source.
|
void |
write(IlvOutputStream stream)
Writes this
IlvVMAPDataSource to an
IlvOutputStream . |
addCriterionFilter, createFeatureRenderer, createInsertionLayer, createStyle, getCriterionFilters, getFeatureRenderer, getFeatureRenderer, getKey, getMapLayer, getStyle, isAcceptNullValues, removeAllCriterionFilters, removeCriterionFilter, setAcceptNullValues
addDataSourceListener, callListeners, getBackupDataSources, getCoordinateSystem, getDescription, getInsertionLayer, getManager, getName, getNode, getValidExtentions, hasInsertionLayer, initBackupDataSource, initInsertionLayer, isAttachingAttributes, isGrapherMode, isSaveBackupDataSources, isUsingBackupDataSource, isUsingGeodeticComputation, mapIntersects, removeDataSourceListener, setAttachingAttributes, setCoordinateSystem, setDescription, setFeatureRenderer, setForceUsingBackupDataSource, setGrapherMode, setInsertionLayer, setManager, setName, setSaveBackupDataSources, setValidExtentions, toString
public static IlvGeometryClassFilter[] GeometryClassInformation
public IlvDefaultTilableDataSource(IlvInputStream stream) throws IlvReadFileException
IlvDefaultTilableDataSource
from the specified
IlvInputStream
stream
- The input stream to read fromIlvReadFileException
public IlvDefaultTilableDataSource(String filename) throws MalformedURLException
IlvDefaultTilableDataSource
from the specified file name.filename
- The name of the file to read.MalformedURLException
- if the path cannot be parsed as a URLpublic IlvDefaultTilableDataSource(URL url) throws IOException
IlvDefaultTilableDataSource
from the specified url.url
- The URL to read from.IOException
public IlvMapReusableFeatureIterator getFeatureIterator()
getFeatureIterator
in class IlvHierarchicalDataSource
null>/code>.
- Since:
- JViews 8.5
-
acceptsCode
public boolean acceptsCode(Object codeValue)
Indicates if the current data source accepts the specified code value.
- Parameters:
codeValue
- The code to look for.
- Returns:
true
if the value is registered.
-
reset
public void reset()
Resets the data source. Prepare this data source for reloading.
- Overrides:
reset
in class IlvHierarchicalDataSource
- See Also:
IlvMapDataSource.reset()
-
setAreaOfinterest
public void setAreaOfinterest(double lonMin,
double latMin,
double lonMax,
double latMax)
Sets the area outside of which data will not be fetched.
- Parameters:
lonMin
- The minimum longitude of the area of interest.
latMin
- The minimum latitude of the area of interest.
lonMax
- The maximum longitude of the area of interest.
latMax
- The maximum latitude of the area of interest.
-
setTilingParameters
public void setTilingParameters(boolean useTiling,
int rows,
int columns)
Sets tiling parameters for this data source.
- Parameters:
useTiling
- If true
, this data source will use the load-on-demand
mechanism for loading data. If false
, all
the data will be loaded when the start
method is
called.
rows
- The number of rows of tiles (only when useTiling
is
true
);
columns
- The number of columns of tiles (only when useTiling
is
true
);
-
write
public void write(IlvOutputStream stream)
throws IOException
Writes this IlvVMAPDataSource
to an
IlvOutputStream
.
- Specified by:
write
in interface IlvPersistentObject
- Overrides:
write
in class IlvHierarchicalDataSource
- Parameters:
stream
- The stream to write to.
- Throws:
IOException
-
createGenericTiles
protected void createGenericTiles(IlvTileController tileController,
IlvCoordinateTransformation tr)
This method creates the free tiles in the tiled layer
- Parameters:
tileController
- The IlvTileController
for the tiled layer of this data source.
tr
- The coordinate transformation between the source coordinate system and
the map (destination) coordinate system.
-
getColumnCount
public int getColumnCount()
Returns the tile column Count.
- Returns:
- The tile column Count.
-
getLatMax
public double getLatMax()
Returns the latitude Maximum.
- Returns:
- The latitude Maximum.
-
getLatMin
public double getLatMin()
Returns the latitude Minimum.
- Returns:
- The latitude Minimum.
-
getLonMax
public double getLonMax()
Returns the longitude Maximum.
- Returns:
- The longitude Maximum..
-
getLonMin
public double getLonMin()
Returns the longitude Minimum..
- Returns:
- The longitude Minimum.
-
getRowCount
public int getRowCount()
Returns the tile row Count.
- Returns:
- The tile row Count.
-
isUsingTiling
public boolean isUsingTiling()
Returns whether tiling is used.
- Returns:
true
if tiling is used.
-
start
public void start()
throws Exception
Starts this data source. The rendering process is initiated. The map
features are read from the reader, graphic objects are rendered and
inserted into the manager.
- Overrides:
start
in class IlvHierarchicalDataSource
- Throws:
Exception
-
setupTiledLoaders
protected void setupTiledLoaders()
Sets up tile loader for all map layer children of the insertion layer.
-
isMultiThreaded
public boolean isMultiThreaded()
Returns whether the tiled layer created by this data source uses
multithreading to load tiles
- Returns:
true
if multithreading is used to load tiles.
-
setMultiThreaded
public void setMultiThreaded(boolean t)
Indicates whether the tiled layer created by this data source will use
multithreading to load tiles. This method must be called before the data
source is started.
- Parameters:
t
- true
if multithreading will be used to load tiles
-
getGeometryClassInformation
public IlvGeometryClassFilter getGeometryClassInformation(IlvMapFeature feature)
Returns the geometry class information for the selected feature.
- Parameters:
feature
- The feature used to search for a geometry class.
- Returns:
- The information(mainly name) of this geometry.
-
getGeometryClassFilters
protected IlvGeometryClassFilter[] getGeometryClassFilters()
By default, returns GeometryClassInformation
- Returns:
- the list of possible geometry classes that can be loaded.
- Since:
- JViews 8.1
-
readInfo
public void readInfo(String info)
Creates the table of attributes values from a text file description.
- Overrides:
readInfo
in class IlvHierarchicalDataSource
- Parameters:
info
- The description file.
- See Also:
IlvHierarchicalDataSource.readInfo(java.lang.String)
-
makeLayerName
public String makeLayerName(String name,
IlvGeometryClassFilter d)
Creates a layer name from a feature name and a geometry class.
- Parameters:
name
- The feature name.
d
- The geometry class.
- Returns:
- A string to use as a layer name.
-
createTiledLayers
protected void createTiledLayers()
Creates the set of IlvMapLayer
to be used for tile management.
The default implementation creates one layer for each (selected feature code,geometry class) pair.
-
setupLayer
protected void setupLayer(IlvMapLayer layer,
IlvMapFeature feature)
This method has been overridden so the preferred order in the layer is also
stored.
- Overrides:
setupLayer
in class IlvHierarchicalDataSource
- Parameters:
layer
- The layer.
feature
- The feature.
- Since:
- JViews 8.1
- See Also:
IlvHierarchicalDataSource.setupLayer(ilog.views.maps.beans.IlvMapLayer, ilog.views.maps.IlvMapFeature)
-
getFeatureName
public Object getFeatureName(Object codeValue)
Returns the feature name for the feature code passed or null.
- Parameters:
codeValue
- The value of the feature property.
- Returns:
- The feature name or
null
.
-
setAcceptedCodeList
public void setAcceptedCodeList(String[] codes)
Sets the list of accepted object codes
- Parameters:
codes
- An array of accepted object codes (decimal values).
-
createDefaultFilter
protected IlvDefaultFeatureFilter createDefaultFilter()
Creates, at construction time, the filter that will be used to separate
features into layers.
For example, this method can create an IlvDefaultFeatureFilter
instance and pass the property used to split features.
- Returns:
- The default feature filter that will be used to separate layers
for this data source.
- Since:
- JViews 8.1
-
createTiledIterator
protected abstract IlvMapRegionOfInterestIterator createTiledIterator(IlvFeatureClassInformation featureClass,
IlvGeometryClassFilter geometryClass)
Should create the specific IlvMapRegionOfInterestIterator
to be used for this data source.
For example: protected IlvMapRegionOfInterestIterator createTiledIterator(IlvFeatureClassInformation featureValue,IlvGeometryClassFilter geometryClass) {
// retrieve a default iterator
IlvS57Reader initial = (IlvS57Reader) getFeatureIterator();
// and create a new one which filters the specific geomerty and feature classes.
return initial.deriveReader(featureValue,geometryClass);
}
- Parameters:
featureClass
- The information on which the feature code will be filtered.
geometryClass
- The information for which the geometry class is acceptable.
- Returns:
- The iterator set up with the specified parameters.
-
initFeatureList
protected abstract void initFeatureList()
Specific initialization done when data source is created.
It should be used to retrieve the possible feature codes that the data source can manage.
-
createFeatureIterator
protected abstract IlvMapReusableFeatureIterator createFeatureIterator(String fileName)
throws IOException
Method used in IlvDefaultTilableDataSource(String)
constructor to build the data source reader.
For example: protected void createFeatureIterator(String fileName)
{
return new IlvS57Reader(fileName);
}
- Parameters:
fileName
- The file parameter.
- Returns:
- The data source reader.
- Throws:
IOException
-
createFeatureIterator
protected abstract IlvMapReusableFeatureIterator createFeatureIterator(URL urlName)
throws IOException
Method used in the IlvDefaultTilableDataSource(URL)
constructor to build the data source reader.
For example: protected void createFeatureIterator(URL urlName)
{
return new IlvS57Reader(urlName);
}
- Parameters:
urlName
- The file parameter.
- Returns:
- The data source reader.
- Throws:
IOException
-
getFeatureFilterPropertyName
@Deprecated
protected String getFeatureFilterPropertyName()
Deprecated. since JViews 8.1, this method is deprecated and should be replaced by an implementation of createDefaultFilter()
This method should return the feature property used to filter features out.
It will be used to set a new IlvDefaultFeatureFilter
on the data source at construction time.
- Returns:
- Returns the property name to use.
-
getMonitoringData
public IlvThreadMonitoringData getMonitoringData()
Returns the monitorData.
- Returns:
- The monitor data.
-
setMonitoringData
public void setMonitoringData(IlvThreadMonitoringData monitorData)
Sets the monitor data.
- Parameters:
monitorData
- The monitorData to set.
-
isSourceDataAvailable
protected boolean isSourceDataAvailable()
Checks whether the source data this IlvMapDataSource
is
based on is available (file, database connection, url...). A
.ivl,
JViews Maps file keeps references to the original
sources the map was built from. It can happen that these sources are not available when
opening the map, for example, when the map is transferred to another machine. This method
checks that availability. In the case where these sources are not available, all operations
that need them are performed from the data embedded in the map, but there is a risk of loosing
information (when reprojecting for example).
This method should be overridden by subclasses.
- Overrides:
isSourceDataAvailable
in class IlvMapDataSource
- Returns:
- Returns
true
, if the original source data is available.
-
getURL
public URL getURL()
Retrieves the URL
given at construction time.
- Returns:
- The
URL
given at construction time.
-
setURL
public void setURL(URL url)
Sets the URL
.
- Parameters:
url
- The URL
to set.
-
addLayer
protected void addLayer(IlvMapLayer parent,
IlvMapLayer layer)
Adds a specified IlvMapLayer
in the specified parent layer.
- Overrides:
addLayer
in class IlvHierarchicalDataSource
- Parameters:
parent
- The parent layer.
layer
- The IlvMapLayer
to add.
-
setLayerOrder
protected void setLayerOrder(IlvMapLayer layer,
Integer order)
A utility method that stores the map layer order.
This default implementation stores the map layer order in the manager
layer properties.
- Parameters:
layer
- The layer to change
order
- The order indicator.
- Since:
- JViews 8.1
-
getLayerOrder
protected Integer getLayerOrder(IlvMapLayer layer)
A utility method that retrieves the map layer order.
- Parameters:
layer
- The map layer.
- Returns:
- The order or
null
if the order has not has been set.
- Since:
- JViews 8.1
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.