ilog.views.maps.rendering
Class IlvDefaultRasterRenderer

java.lang.Object
  extended by ilog.views.maps.rendering.IlvDefaultRasterRenderer
All Implemented Interfaces:
IlvPersistentObject, IlvFeatureRenderer

public class IlvDefaultRasterRenderer
extends Object
implements IlvFeatureRenderer

This renderer translates a map feature whose geometry is an IlvMapRaster into an IlvIcon using a color model to directly translate the values of the raster into colors. The default color model is adapted to display terrain elevations, but it can be changed.
If a projection is required, only the corners of the image are projected.

Since:
ILOG JViews 3.0
See Also:
IlvMapRaster, IlvIcon, IlvIntervalColorModel

Constructor Summary
IlvDefaultRasterRenderer()
          Creates an IlvDefaultRasterRenderer.
IlvDefaultRasterRenderer(IlvInputStream stream)
          Reads an IlvDefaultRasterRenderer from an IlvInputStream.
 
Method Summary
 ColorModel getColorModel()
          Returns the ColorModel used by the renderer to make the graphic.
 IlvMapImageRenderingStyle getImageRenderingStyle()
          Retrieves the rendering style of the renderer.
 boolean isPersistent()
          Returns true.
 boolean isSynchronousImageLoading()
          Returns true if the image loading mode is synchronous, false otherwise.
 IlvGraphic makeGraphic(IlvMapFeature feature, IlvCoordinateTransformation transformation)
          Translates a feature with a raster geometry into an IlvIcon.
static Image MakeImage(IlvMapRaster raster, ColorModel colorModel)
          Creates an image from an IlvMapRaster by directly translating the raster value into colors using a color model.
 void setColorModel(ColorModel model)
          Sets the ColorModel used by the renderer to create the graphic object.
 void setImageRenderingStyle(IlvMapImageRenderingStyle style)
          Sets the rendering style of the renderer.
 void setSynchronousImageLoading(boolean synchronous)
          Sets the image loading mode to synchronous or asynchronous accordingly to the value of the synchronous parameter.
 void write(IlvOutputStream stream)
          Writes the renderer to an IlvOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvDefaultRasterRenderer

public IlvDefaultRasterRenderer()
Creates an IlvDefaultRasterRenderer.


IlvDefaultRasterRenderer

public IlvDefaultRasterRenderer(IlvInputStream stream)
                         throws IlvReadFileException
Reads an IlvDefaultRasterRenderer from an IlvInputStream.

Throws:
IlvReadFileException
Method Detail

makeGraphic

public IlvGraphic makeGraphic(IlvMapFeature feature,
                              IlvCoordinateTransformation transformation)
                       throws IlvMapRenderException,
                              IlvCoordinateTransformationException
Translates a feature with a raster geometry into an IlvIcon. Note that this method has been changed since ILOG JViews 5.0. The old method was draw(IlvMapFeature, IlvProjection). In case you have overridden the old draw method, you have to rewrite your method in order to migrate to JViews 5.0.

Specified by:
makeGraphic in interface IlvFeatureRenderer
Parameters:
feature - The map feature to translate.
transformation - The transformation. This parameter should never be null.
Throws:
IlvMapRenderException - If the renderer can not process the map feature.
IlvCoordinateTransformationException - If a transformation exception occurs.
Since:
JViews 5.0

MakeImage

public static Image MakeImage(IlvMapRaster raster,
                              ColorModel colorModel)
Creates an image from an IlvMapRaster by directly translating the raster value into colors using a color model.

Parameters:
raster - The raster from which an image will be created.
colorModel - The color model used to translate the values of the raster into colors.

setColorModel

public void setColorModel(ColorModel model)
Sets the ColorModel used by the renderer to create the graphic object. By default, the color model used by this renderer is a color model that displays elevation rasters.

See Also:
IlvIntervalColorModel.MakeElevationColorModel()

getColorModel

public ColorModel getColorModel()
Returns the ColorModel used by the renderer to make the graphic.


setSynchronousImageLoading

public void setSynchronousImageLoading(boolean synchronous)
Sets the image loading mode to synchronous or asynchronous accordingly to the value of the synchronous parameter. In synchronous mode, a MediaTracker waits for the image to be fully loaded before creating the IlvIcon in the makeGraphic method.

Since:
JViews 3.5

isSynchronousImageLoading

public boolean isSynchronousImageLoading()
Returns true if the image loading mode is synchronous, false otherwise.

Since:
JViews 3.5
See Also:
setSynchronousImageLoading(boolean)

write

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

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

isPersistent

public boolean isPersistent()
Returns true.

Specified by:
isPersistent in interface IlvFeatureRenderer

getImageRenderingStyle

public IlvMapImageRenderingStyle getImageRenderingStyle()
Retrieves the rendering style of the renderer.

Returns:
The rendering style.
Since:
JViews 5.0

setImageRenderingStyle

public void setImageRenderingStyle(IlvMapImageRenderingStyle style)
Sets the rendering style of the renderer.

Parameters:
style - The IlvMapImageRenderingStyle.
Since:
JViews 5.0


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