ilog.views.maps.raster.datasource
Class IlvTiledRasterDataSource

java.lang.Object
  extended by ilog.views.maps.datasource.IlvMapDataSource
      extended by ilog.views.maps.raster.datasource.IlvTiledRasterDataSource
All Implemented Interfaces:
IlvPersistentObject

public class IlvTiledRasterDataSource
extends IlvMapDataSource

IlvTiledRasterDataSource is used to manage any raster reader data. This class gives the option to split the images into tiles and load the images in a background thread. The default tile size is 256x256.

Since:
JViews 7.5

Field Summary
 
Fields inherited from class ilog.views.maps.datasource.IlvMapDataSource
renderer, usingGeodeticComputation
 
Constructor Summary
IlvTiledRasterDataSource()
          Creates a raster tiled data source that can be split and multithreaded.
IlvTiledRasterDataSource(boolean split, boolean threaded, IlvRasterAbstractReader reader)
          Creates a raster tiled data source that can be split and multithreaded.
IlvTiledRasterDataSource(IlvInputStream stream)
          Reads the data source from a serialized stream.
 
Method Summary
protected  IlvMapLayer createInsertionLayer()
          Creates the map layer using a tiled manager layer.
 void execute()
          Creates all necessary IlvFreeTile objects.
 IlvMapReusableFeatureIterator getFeatureIterator()
          Retrieves the feature iterator used by this data source.
 IlvThreadMonitoringData getMonitorInfo()
          Returns the thread monitoring information to use when updating progress.
 IlvRasterAbstractReader getReader()
          Returns the raster reader attached to this data source.
 IlvTiledLayer getTiledLayer()
          Returns the manager layer referenced by the insertion layer as a tiled layer.
protected  void initInsertionLayer(IlvMapLayer layer)
          Creates a new IlvTiledLayer instance to store images and tiles.
 boolean isSplit()
          Returns if images are split by this data source.
 boolean isThreaded()
          Returns the thread status of this data source.
 void reset()
          Resets the data source and prepares it for reloading.
 void setMonitorInfo(IlvThreadMonitoringData info)
          Sets the thread monitoring information to use when updating progress.
 void setReader(IlvRasterAbstractReader r)
          Sets the raster reader attached to this data source.
protected  void setSplit(boolean split)
          Sets the splitting for this data source.
 void setThreaded(boolean threaded)
          Sets the thread status of this data source.
 void start()
          Starts data source reading and rendering.
 void write(IlvOutputStream stream)
          Writes an IlvMapDataSource to an IlvOutputStream.
 
Methods inherited from class ilog.views.maps.datasource.IlvMapDataSource
addDataSourceListener, callListeners, getBackupDataSources, getCoordinateSystem, getDescription, getFeatureRenderer, getInsertionLayer, getManager, getMapLayer, getName, getNode, getValidExtentions, hasInsertionLayer, initBackupDataSource, isAttachingAttributes, isSaveBackupDataSources, isSourceDataAvailable, isUsingGeodeticComputation, mapIntersects, removeDataSourceListener, setAttachingAttributes, setCoordinateSystem, setDescription, setFeatureRenderer, setForceUsingBackupDataSource, setInsertionLayer, setManager, setName, setSaveBackupDataSources, setValidExtentions, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvTiledRasterDataSource

public IlvTiledRasterDataSource()
Creates a raster tiled data source that can be split and multithreaded. By default, splitting and multithreading are disabled.


IlvTiledRasterDataSource

public IlvTiledRasterDataSource(boolean split,
                                boolean threaded,
                                IlvRasterAbstractReader reader)
Creates a raster tiled data source that can be split and multithreaded.

Parameters:
split - Indicates if images created by this data source are split into tiles.
threaded - Indicates if image loading is done in a background thread.
reader - The reader used to provide the raster data.

IlvTiledRasterDataSource

public IlvTiledRasterDataSource(IlvInputStream stream)
                         throws IlvReadFileException
Reads the data source from a serialized stream.

Parameters:
stream - The stream to read from.
Throws:
IlvReadFileException - if there is a problem reading from stream.
Method Detail

getMonitorInfo

public IlvThreadMonitoringData getMonitorInfo()
Returns the thread monitoring information to use when updating progress.

Returns:
The thread monitoring information to use when updating progress.

getFeatureIterator

public IlvMapReusableFeatureIterator getFeatureIterator()
Retrieves the feature iterator used by this data source.

Specified by:
getFeatureIterator in class IlvMapDataSource
Returns:
The feature iterator.
See Also:
IlvMapDataSource.getFeatureIterator()

write

public void write(IlvOutputStream stream)
           throws IOException
Writes an IlvMapDataSource to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvMapDataSource
Parameters:
stream - The stream to write to.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.
See Also:
IlvMapDataSource.write(ilog.views.io.IlvOutputStream)

createInsertionLayer

protected IlvMapLayer createInsertionLayer()
Creates the map layer using a tiled manager layer.

Overrides:
createInsertionLayer in class IlvMapDataSource
Returns:
The layer that is to become the insertion layer.
See Also:
initInsertionLayer(IlvMapLayer), IlvMapDataSource.createInsertionLayer()

initInsertionLayer

protected void initInsertionLayer(IlvMapLayer layer)
Creates a new IlvTiledLayer instance to store images and tiles.

Overrides:
initInsertionLayer in class IlvMapDataSource
Parameters:
layer - The IlvMapLayer to initialize.
See Also:
IlvMapDataSource.initInsertionLayer(ilog.views.maps.beans.IlvMapLayer)

getTiledLayer

public IlvTiledLayer getTiledLayer()
Returns the manager layer referenced by the insertion layer as a tiled layer.

Returns:
The manager layer referenced by the insertion layer as a tiled layer.
See Also:
IlvMapDataSource.getInsertionLayer()

setMonitorInfo

public void setMonitorInfo(IlvThreadMonitoringData info)
Sets the thread monitoring information to use when updating progress.

Parameters:
info - The thread monitoring information.

reset

public void reset()
Resets the data source and prepares it for reloading.

Overrides:
reset in class IlvMapDataSource
See Also:
IlvMapDataSource.reset()

start

public void start()
Starts data source reading and rendering. If the current thread is the dispatch thread, loading will happen in a separate thread. Loading is done by calling execute().

Overrides:
start in class IlvMapDataSource
See Also:
IlvMapDataSource.start()

execute

public void execute()
Creates all necessary IlvFreeTile objects.


getReader

public IlvRasterAbstractReader getReader()
Returns the raster reader attached to this data source.

Returns:
The raster reader attached to this data source.

setReader

public void setReader(IlvRasterAbstractReader r)
Sets the raster reader attached to this data source. This method must be called before the data source is started to have any effect.

Parameters:
r - The raster reader attached to this data source.

isSplit

public boolean isSplit()
Returns if images are split by this data source. Splitting means divided into tiles.

Returns:
If images are split by this data source, true is returned.

setSplit

protected void setSplit(boolean split)
Sets the splitting for this data source. This method must be called before the data source is started to have any effect.

Parameters:
split - Indicates if images are split by this data source. Splitting means divided into tiles.

isThreaded

public boolean isThreaded()
Returns the thread status of this data source.

Returns:
If this data source uses threads to load tiles, true is returned.

setThreaded

public void setThreaded(boolean threaded)
Sets the thread status of this data source. This method must be called before the data source is started to have any effect.

Parameters:
threaded - Indicates if this data source uses threads to load tiles.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.