ilog.views.maps.format
Class IlvMapTileLoader

java.lang.Object
  extended by ilog.views.maps.format.IlvMapTileLoader
All Implemented Interfaces:
IlvPersistentObject, IlvTileLoader
Direct Known Subclasses:
IlvImageTileLoader, IlvRegionOfInterestTileLoader, IlvShapeFileTileLoader

public abstract class IlvMapTileLoader
extends Object
implements IlvTileLoader

The base abstract class for tile loaders specialized in loading map formats.
This default implementation of an IlvTileLoader can load data from any data set on which IlvMapFeatureIterator can be constructed for a given tile.
This default implementation can also take advantage of classes implementing IlvLookAheadFeatureIterator.

Since:
JViews 4.0
See Also:
IlvLookAheadFeatureIterator

Constructor Summary
protected IlvMapTileLoader()
          This class can only be instantiated by subclasses.
protected IlvMapTileLoader(IlvInputStream stream)
          This class can only be instantiated by subclasses.
 
Method Summary
abstract  IlvFeatureRenderer getDefaultFeatureRenderer()
          Returns the default feature renderer used for the rendering of map features of this tile.
abstract  IlvMapFeatureIterator getFeatureIterator(IlvTile tile)
          Returns the feature iterator to read features for the specified tile.
 IlvFeatureRenderer getFeatureRenderer()
          Returns the renderer to use with this tile loader.
 boolean isAttachingAttributes()
          Returns true if this tile loader is attaching attributes to graphic objects it loads, when these are available.
abstract  boolean isPersistent()
          Returns true if this tile loader must be saved by a tile controller.
 void load(IlvTile tile)
          Method called when a tile has to be loaded.
 void release(IlvTile tile)
          Releases the specified tile.
 void setAttachingAttributes(boolean set)
          Specifies whether this tile loader is attaching attributes to graphic objects it loads.
 void setFeatureRenderer(IlvFeatureRenderer renderer)
          Sets the renderer to use with this tile loader.
 void write(IlvOutputStream stream)
          Writes this tile loader to the specified IlvOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMapTileLoader

protected IlvMapTileLoader()
This class can only be instantiated by subclasses.


IlvMapTileLoader

protected IlvMapTileLoader(IlvInputStream stream)
                    throws IlvReadFileException
This class can only be instantiated by subclasses.

Parameters:
stream - The input stream.
Throws:
IlvReadFileException
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes this tile loader to the specified IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Specified by:
write in interface IlvTileLoader
Parameters:
stream - The IlvOutputStream to write this object to.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

isPersistent

public abstract boolean isPersistent()
Returns true if this tile loader must be saved by a tile controller.

Specified by:
isPersistent in interface IlvTileLoader

load

public void load(IlvTile tile)
          throws Exception
Method called when a tile has to be loaded.
The default implementation gets the feature iterator for the tile to load using getFeatureIterator(), and then adds all objects to the tile using the feature renderer of this tile loader.
If getFeatureIterator() returns null, the specified tile is assumed to be inexistent and tile.loadComplete() is called.

Specified by:
load in interface IlvTileLoader
Parameters:
tile - The tile to load.
Throws:
Exception - if an error occurs when loading objects from the specified tile.

release

public void release(IlvTile tile)
Releases the specified tile. The default implementation calls tile.deleteAll().

Specified by:
release in interface IlvTileLoader
Parameters:
tile - The tile to release.

getFeatureIterator

public abstract IlvMapFeatureIterator getFeatureIterator(IlvTile tile)
                                                  throws Exception
Returns the feature iterator to read features for the specified tile.

Parameters:
tile - The tile to load.
Returns:
The feature iterator to load features for this tile, or null if no features are to be loaded.
Throws:
Exception

getDefaultFeatureRenderer

public abstract IlvFeatureRenderer getDefaultFeatureRenderer()
Returns the default feature renderer used for the rendering of map features of this tile. This default feature renderer is used when the user does not set a feature renderer.


setAttachingAttributes

public void setAttachingAttributes(boolean set)
Specifies whether this tile loader is attaching attributes to graphic objects it loads.

Parameters:
set - If true, attributes are attached.

isAttachingAttributes

public boolean isAttachingAttributes()
Returns true if this tile loader is attaching attributes to graphic objects it loads, when these are available. The default is true.


setFeatureRenderer

public void setFeatureRenderer(IlvFeatureRenderer renderer)
Sets the renderer to use with this tile loader.

Parameters:
renderer - The feature renderer.

getFeatureRenderer

public IlvFeatureRenderer getFeatureRenderer()
Returns the renderer to use with this tile loader.



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