ilog.views.maps.datasource
Class IlvGraphicLayerDataSource

java.lang.Object
  extended by ilog.views.maps.datasource.IlvMapDataSource
      extended by ilog.views.maps.datasource.IlvGraphicLayerDataSource
All Implemented Interfaces:
IlvPersistentObject, IlvFeatureRenderer, IlvMapFeatureIterator, IlvMapReusableFeatureIterator
Direct Known Subclasses:
IlvPolylineMergerDataSource, IlvPolylineSimplifierDataSource

public class IlvGraphicLayerDataSource
extends IlvMapDataSource
implements IlvMapReusableFeatureIterator, IlvFeatureRenderer

Creates a datasource based on a dynamic vector of IlvGraphic objects. Using add(IlvGraphic), the application will add to the list of objects, that will then be available through the getNextFeature() calls, and will be stored and retrieved when the map is saved.

Since:
JViews 7.5

Field Summary
 
Fields inherited from class ilog.views.maps.datasource.IlvMapDataSource
renderer, usingGeodeticComputation
 
Constructor Summary
IlvGraphicLayerDataSource()
          Default constructor.
IlvGraphicLayerDataSource(IlvInputStream stream)
          Reads an IlvGraphicLayerDataSource from an IlvInputStream
 
Method Summary
 void add(IlvGraphic graphic)
          Adds an IlvGraphic object (in the manager's coordinate system) to this dynamic datasource.
 void add(IlvGraphic graphic, IlvCoordinateSystem cs)
          Adds an IlvGraphic object using the specified coordinate system to this dynamic datasource.
 void clear()
          Clears the list of IlvGraphic in this dynamic datasource.
 void dispose()
          This feature iterator method does nothing.
 IlvGraphic get(int index)
          Returns the graphic object at specified index.
 IlvFeatureRenderer getDefaultFeatureRenderer()
          Returns this data source.
 IlvMapReusableFeatureIterator getFeatureIterator()
          Retrieves the feature iterator used by this data source.
 IlvCoordinate getLowerRightCorner()
          Returns null.
 IlvThreadMonitoringData getMonitoringData()
          Returns the monitorData.
 IlvMapFeature getNextFeature()
          Returns the next map feature of the iterator or null if the iteration is finished.
 IlvCoordinate getUpperLeftCorner()
          Returns null.
 boolean isGeoreferenced()
          Returns false.
 boolean isPersistent()
          Returns true.
 IlvGraphic makeGraphic(IlvMapFeature arg0, IlvCoordinateTransformation transform)
          Goes through the vector of known IlvGraphic registered with add(IlvGraphic) and uses IlvMapGraphic.copy(IlvCoordinateTransformation) to transform them to the new manager transformation.
 boolean remove(IlvGraphic graphic)
          Removes an IlvGraphic object from this dynamic datasource.
 void restart()
          Rewinds the iterator for a new use.
 void setCoordinateSystem(IlvCoordinateSystem coordinateSystem)
          This method is not allowed for this data source.
 void setManager(IlvManager manager)
          This method sets both the manager and the coordinate system of the data source.
 void setMonitoringData(IlvThreadMonitoringData monitorData)
          Sets the monitorData.
 int size()
          Returns the number of IlvGraphic in this datasource.
 void start()
          Starts this data source and initiates the rendering process.
 void write(IlvOutputStream stream)
          Writes an IlvMapDataSource to an IlvOutputStream.
 
Methods inherited from class ilog.views.maps.datasource.IlvMapDataSource
addDataSourceListener, callListeners, createInsertionLayer, getBackupDataSources, getCoordinateSystem, getDescription, getFeatureRenderer, getInsertionLayer, getManager, getMapLayer, getName, getNode, getValidExtentions, hasInsertionLayer, initBackupDataSource, initInsertionLayer, isAttachingAttributes, isSaveBackupDataSources, isSourceDataAvailable, isUsingGeodeticComputation, mapIntersects, removeDataSourceListener, reset, setAttachingAttributes, setDescription, setFeatureRenderer, setForceUsingBackupDataSource, setInsertionLayer, setName, setSaveBackupDataSources, setValidExtentions, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ilog.views.maps.IlvMapFeatureIterator
getCoordinateSystem
 

Constructor Detail

IlvGraphicLayerDataSource

public IlvGraphicLayerDataSource()
Default constructor. Creates an empty data source.


IlvGraphicLayerDataSource

public IlvGraphicLayerDataSource(IlvInputStream stream)
                          throws IlvReadFileException
Reads an IlvGraphicLayerDataSource from an IlvInputStream

Parameters:
stream - The stream to read from.
Throws:
IlvReadFileException
Method Detail

write

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

Specified by:
write in interface IlvPersistentObject
Specified by:
write in interface IlvFeatureRenderer
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:
IlvFeatureRenderer.write(ilog.views.io.IlvOutputStream)

restart

public void restart()
Rewinds the iterator for a new use.

Specified by:
restart in interface IlvMapReusableFeatureIterator
See Also:
IlvMapReusableFeatureIterator.restart()

start

public void start()
           throws Exception
Starts this data source and initiates the rendering process. The map features are read from the reader and the graphic objects are rendered and inserted into the manager.

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

setCoordinateSystem

public void setCoordinateSystem(IlvCoordinateSystem coordinateSystem)
This method is not allowed for this data source. The coordinate system should be set through the use of setManager. As the objects added in this data source are pre-rendered IlvGraphic, the coordinate system must be exactly the manager's one, at the moment the object is added.

Overrides:
setCoordinateSystem in class IlvMapDataSource
Parameters:
coordinateSystem - The coordinate system of this data source.
See Also:
IlvMapDataSource.setCoordinateSystem(ilog.views.maps.srs.coordsys.IlvCoordinateSystem)

setManager

public void setManager(IlvManager manager)
This method sets both the manager and the coordinate system of the data source.

Overrides:
setManager in class IlvMapDataSource
Parameters:
manager - The manager.
See Also:
setCoordinateSystem(IlvCoordinateSystem), IlvMapDataSource.setManager(ilog.views.IlvManager)

getNextFeature

public IlvMapFeature getNextFeature()
Returns the next map feature of the iterator or null if the iteration is finished. The returned map feature must be considered as volatile and can be modified by the reader during the next call to its getNextFeature function.

Specified by:
getNextFeature in interface IlvMapFeatureIterator
See Also:
IlvMapFeatureIterator.getNextFeature()

isGeoreferenced

public boolean isGeoreferenced()
Returns false.

Specified by:
isGeoreferenced in interface IlvMapFeatureIterator
Returns:
Returns false.
See Also:
IlvMapFeatureIterator.isGeoreferenced()

getUpperLeftCorner

public IlvCoordinate getUpperLeftCorner()
Returns null.

Specified by:
getUpperLeftCorner in interface IlvMapFeatureIterator
Returns:
Returns null.
See Also:
IlvMapFeatureIterator.getUpperLeftCorner()

getLowerRightCorner

public IlvCoordinate getLowerRightCorner()
Returns null.

Specified by:
getLowerRightCorner in interface IlvMapFeatureIterator
Returns:
Returns null.
See Also:
IlvMapFeatureIterator.getLowerRightCorner()

getDefaultFeatureRenderer

public IlvFeatureRenderer getDefaultFeatureRenderer()
Returns this data source.

Specified by:
getDefaultFeatureRenderer in interface IlvMapFeatureIterator
Returns:
Returns this data source.
See Also:
IlvMapFeatureIterator.getLowerRightCorner()

dispose

public void dispose()
This feature iterator method does nothing.

Specified by:
dispose in interface IlvMapFeatureIterator
See Also:
IlvMapFeatureIterator.dispose()

makeGraphic

public IlvGraphic makeGraphic(IlvMapFeature arg0,
                              IlvCoordinateTransformation transform)
Goes through the vector of known IlvGraphic registered with add(IlvGraphic) and uses IlvMapGraphic.copy(IlvCoordinateTransformation) to transform them to the new manager transformation.

Specified by:
makeGraphic in interface IlvFeatureRenderer
Parameters:
arg0 - The map feature to translate.
transform - The transformation used to convert coordinates of the map feature.
See Also:
IlvFeatureRenderer.makeGraphic(ilog.views.maps.IlvMapFeature, ilog.views.maps.srs.coordtrans.IlvCoordinateTransformation)

isPersistent

public boolean isPersistent()
Returns true.

Specified by:
isPersistent in interface IlvFeatureRenderer
Returns:
Returns true.
See Also:
IlvFeatureRenderer.isPersistent()

add

public void add(IlvGraphic graphic)
Adds an IlvGraphic object (in the manager's coordinate system) to this dynamic datasource.

Parameters:
graphic - graphic object to manage with this datasource.

add

public void add(IlvGraphic graphic,
                IlvCoordinateSystem cs)
Adds an IlvGraphic object using the specified coordinate system to this dynamic datasource.

Parameters:
graphic - graphic object to manage with this datasource.
cs - coordinate system used by the graphics passed.
Since:
JViews 7.5

remove

public boolean remove(IlvGraphic graphic)
Removes an IlvGraphic object from this dynamic datasource.

Parameters:
graphic - graphic object to manage with this datasource.
Returns:
true if the data source contained this graphic.
Since:
JViews 7.5

size

public int size()
Returns the number of IlvGraphic in this datasource.

Returns:
the number of IlvGraphic in this datasource.

get

public IlvGraphic get(int index)
Returns the graphic object at specified index.

Parameters:
index - index of IlvGraphic to return.
Returns:
object at the specified index
Throws:
ArrayIndexOutOfBoundsException - index is out of range

clear

public void clear()
Clears the list of IlvGraphic in this dynamic datasource.


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()

getMonitoringData

public IlvThreadMonitoringData getMonitoringData()
Returns the monitorData.

Returns:
Returns the monitorData.
Since:
JViews 8.0

setMonitoringData

public void setMonitoringData(IlvThreadMonitoringData monitorData)
Sets the monitorData.

Parameters:
monitorData - The monitorData to set.
Since:
JViews 8.0


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