ilog.views.maps.format.image
Class IlvImageReader

java.lang.Object
  extended by ilog.views.maps.format.image.IlvImageReader
All Implemented Interfaces:
IlvMapFeatureIterator

public class IlvImageReader
extends Object
implements IlvMapFeatureIterator

This class is an IlvMapFeatureIterator specialized for reading image files. The supported image formats are those supported by the Java Platform (GIF, JPEG, or PNG).

Since:
JViews 5.0

Constructor Summary
IlvImageReader(String filename, IlvCoordinate ul, IlvCoordinate lr)
          Constructs an IlvImageReader by specifying the name of the image file to read and the coordinates of the image.
IlvImageReader(URL url, IlvCoordinate ul, IlvCoordinate lr)
          Constructs an IlvImageReader by specifying the URL of the image file to read and the coordinates of the image.
 
Method Summary
 void dispose()
          Disposes this reader.
 IlvCoordinateSystem getCoordinateSystem()
          Returns the associated coordinate system that has been set by the setCoordinateSystem method or null if none has been set.
 IlvFeatureRenderer getDefaultFeatureRenderer()
          Returns an IlvFeatureRenderer suitable for the IlvMapFeature built by this reader.
 IlvCoordinate getLowerRightCorner()
          Retrieves the lower right corner of the image or null if none has been set.
 IlvMapFeature getNextFeature()
          Returns the IlvMapFeature whose geometry is an IlvMapImage.
 IlvCoordinate getUpperLeftCorner()
          Retrieves the upper left corner of the image or null if none has been set.
 boolean isGeoreferenced()
          Tells if the reader is georeferenced (that is if a source projection has been defined for this reader.
 void setCoordinateSystem(IlvCoordinateSystem cs)
          Sets the source coordinate system of the reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvImageReader

public IlvImageReader(String filename,
                      IlvCoordinate ul,
                      IlvCoordinate lr)
               throws IOException,
                      IlvMapFormatException,
                      FileNotFoundException
Constructs an IlvImageReader by specifying the name of the image file to read and the coordinates of the image.

Parameters:
filename - The name of the image file.
ul - The upper left coordinates of the image.
lr - The lower right coordinates of the image.
Throws:
FileNotFoundException - The file specified by filename does not exist.
IOException
IlvMapFormatException
FileNotFoundException

IlvImageReader

public IlvImageReader(URL url,
                      IlvCoordinate ul,
                      IlvCoordinate lr)
               throws IOException,
                      IlvMapFormatException
Constructs an IlvImageReader by specifying the URL of the image file to read and the coordinates of the image.

Parameters:
url - The name of the image file.
ul - The upper left coordinates of the image.
lr - The lower right coordinates of the image.
Throws:
IOException
IlvMapFormatException
Since:
JViews 5.5
Method Detail

getNextFeature

public IlvMapFeature getNextFeature()
                             throws IOException
Returns the IlvMapFeature whose geometry is an IlvMapImage. Since an image is only one map feature, a second call to this method will return null.

Specified by:
getNextFeature in interface IlvMapFeatureIterator
Returns:
The resulting IlvMapFeature.
Throws:
IOException

setCoordinateSystem

public void setCoordinateSystem(IlvCoordinateSystem cs)
Sets the source coordinate system of the reader.

Parameters:
cs - The source coordinate system.

getLowerRightCorner

public IlvCoordinate getLowerRightCorner()
Retrieves the lower right corner of the image or null if none has been set.

Specified by:
getLowerRightCorner in interface IlvMapFeatureIterator
Returns:
The lower right corner.

getUpperLeftCorner

public IlvCoordinate getUpperLeftCorner()
Retrieves the upper left corner of the image or null if none has been set.

Specified by:
getUpperLeftCorner in interface IlvMapFeatureIterator
Returns:
The upper left corner.

getDefaultFeatureRenderer

public IlvFeatureRenderer getDefaultFeatureRenderer()
Returns an IlvFeatureRenderer suitable for the IlvMapFeature built by this reader. The returned IlvFeatureRenderer is an IlvDefaultImageRenderer.

Specified by:
getDefaultFeatureRenderer in interface IlvMapFeatureIterator
Returns:
An IlvDefaultImageRenderer.

isGeoreferenced

public boolean isGeoreferenced()
Tells if the reader is georeferenced (that is if a source projection has been defined for this reader.

Specified by:
isGeoreferenced in interface IlvMapFeatureIterator
Returns:
true if a source projection has been set, false otherwise.

getCoordinateSystem

public IlvCoordinateSystem getCoordinateSystem()
Returns the associated coordinate system that has been set by the setCoordinateSystem method or null if none has been set.

Specified by:
getCoordinateSystem in interface IlvMapFeatureIterator
Returns:
The coordinate system, or null if the coordinate system is unknown.

dispose

public void dispose()
Disposes this reader.

Specified by:
dispose in interface IlvMapFeatureIterator


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