ilog.views.maps.datasource
Class IlvMIDMIFDataSource

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

public class IlvMIDMIFDataSource
extends IlvHierarchicalDataSource

A data source to read MapInfo MID/MIF files.

Since:
JViews 7.5

Nested Class Summary
static class IlvMIDMIFDataSource.MIDMIFFilter
          A specialized criterion filter that returns for a key identifying the specified map feature's geometry type as well as its style.
 
Nested classes/interfaces inherited from class ilog.views.maps.datasource.IlvHierarchicalDataSource
IlvHierarchicalDataSource.CriterionFilter, IlvHierarchicalDataSource.SingleAttributeFilter
 
Field Summary
 
Fields inherited from class ilog.views.maps.datasource.IlvHierarchicalDataSource
featureIterator, filename, nameMap, styleMap
 
Fields inherited from class ilog.views.maps.datasource.IlvMapDataSource
renderer, usingGeodeticComputation
 
Constructor Summary
IlvMIDMIFDataSource(IlvInputStream stream)
          Constructs a IlvMIDMIFDataSource from the specified input stream.
IlvMIDMIFDataSource(String filename)
          Constructs a IlvMIDMIFDataSource from the specified file name.
IlvMIDMIFDataSource(URL url)
          Constructs a IlvMIDMIFDataSource from the specified URL.
 
Method Summary
 IlvCoordinateSystem getCoordinateSystem()
          Retrieves the coordinate system of this data source.
 IlvMapReusableFeatureIterator getFeatureIterator()
          Retrieves the feature iterator used by this data source.
 IlvFeatureRenderer getFeatureRenderer(IlvMapFeature feature)
          Gets the appropriate feature renderer for the specified IlvMapFeature.
protected  IlvMapStyle getStyle(IlvMapFeature feature)
          Returns a map style for the specified feature.
protected  boolean isSourceDataAvailable()
          Checks whether the source data this IlvMapDataSource is based on is available (file, database connection, url...).
 void start()
          Starts the data source.
 void write(IlvOutputStream stream)
          Writes this IlvMIDMIFDataSource to an IlvOutputStream.
 
Methods inherited from class ilog.views.maps.datasource.IlvHierarchicalDataSource
addCriterionFilter, addLayer, createFeatureRenderer, createInsertionLayer, getCriterionFilters, getFeatureRenderer, getKey, getMapLayer, isAcceptNullValues, readInfo, removeAllCriterionFilters, removeCriterionFilter, reset, setAcceptNullValues, setupLayer
 
Methods inherited from class ilog.views.maps.datasource.IlvMapDataSource
addDataSourceListener, callListeners, getBackupDataSources, getDescription, getInsertionLayer, getManager, getName, getNode, getValidExtentions, hasInsertionLayer, initBackupDataSource, initInsertionLayer, isAttachingAttributes, isSaveBackupDataSources, 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

IlvMIDMIFDataSource

public IlvMIDMIFDataSource(String filename)
                    throws MalformedURLException
Constructs a IlvMIDMIFDataSource from the specified file name.

Parameters:
filename - The name of the MID/MIF file to read.
Throws:
MalformedURLException - if the path cannot be parsed as a URL

IlvMIDMIFDataSource

public IlvMIDMIFDataSource(URL url)
                    throws MalformedURLException
Constructs a IlvMIDMIFDataSource from the specified URL.

Parameters:
url - The URL referring of the MID/MIF file to read.
Throws:
MalformedURLException - if the path cannot be parsed as a URL
Since:
JViews 7.5

IlvMIDMIFDataSource

public IlvMIDMIFDataSource(IlvInputStream stream)
                    throws IlvReadFileException
Constructs a IlvMIDMIFDataSource from the specified input stream.

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

write

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

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvHierarchicalDataSource
Parameters:
stream - The stream to write to.
Throws:
IOException

getCoordinateSystem

public IlvCoordinateSystem getCoordinateSystem()
Retrieves the coordinate system of this data source.

Overrides:
getCoordinateSystem in class IlvMapDataSource
Returns:
The coordinate system of this data source.

getFeatureRenderer

public IlvFeatureRenderer getFeatureRenderer(IlvMapFeature feature)
                                      throws Exception
Gets the appropriate feature renderer for the specified IlvMapFeature.

Overrides:
getFeatureRenderer in class IlvHierarchicalDataSource
Parameters:
feature - the feature to render.
Returns:
the IlvFeatureRenderer.
Throws:
Exception - if a feature renderer does not exist for the specified IlvMapFeature.

start

public void start()
           throws Exception
Starts the data source.

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

getFeatureIterator

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

Overrides:
getFeatureIterator in class IlvHierarchicalDataSource
Returns:
The feature iterator.

getStyle

protected IlvMapStyle getStyle(IlvMapFeature feature)
                        throws Exception
Returns a map style for the specified feature.

Overrides:
getStyle in class IlvHierarchicalDataSource
Parameters:
feature - the IlvMapFeature.
Returns:
a IlvMapStyle for the feature
Throws:
Exception - if an appropriate style could not be found for the specified feature.

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.


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