ucar.unidata.view
Interface Renderer

All Known Implementing Classes:
CompositeRenderer, EsriShapefileRenderer, GisFeatureRenderer, GisFeatureRendererMulti, McidasMap, StationLocationRenderer, WorldMap

public interface Renderer

A Renderer does the actual work of drawing objects.

Version:
$Id: Renderer.java,v 1.12 2005/05/13 18:33:06 jeffmc Exp $
Author:
John Caron

Method Summary
 void draw(Graphics2D g, AffineTransform pixelAT)
          Tell the renderer to draw itself.
 Color getColor()
          Get the color
 ucar.unidata.geoloc.LatLonRect getPreferredArea()
          This allows application to automatically switch to some special area defined by the Renderer
 void setColor(Color color)
          Tell the Renderer to use the given color.
 void setProjection(ucar.unidata.geoloc.ProjectionImpl project)
          Tell the Renderer to use the given projection from now on.
 

Method Detail

draw

void draw(Graphics2D g,
          AffineTransform pixelAT)
Tell the renderer to draw itself. The Graphics2D object has its AffineTransform set to transform World coordinates to display coordinates. Typically the Renderer does its drawing in World coordinates, and does not modify the AffineTransform. If the Renderer wants to draw in constant-pixel coordinates, so that its objects do not change as the user zooms in and out, use the pixelAT transform, which transforms "Normalized Device" coordinates (screen pixels) to Device coordinates. The Graphics2D object also has its clipping rectangle set (in World coordinates), which the Renderer may use for optimization. The Graphics2D object has default color and line width set; the Renderer should restore any changes it makes.

Parameters:
g - the Graphics context
pixelAT - transforms "Normalized Device" to Device coordinates. When drawing to the screen, this will be the identity transform. For other devices like printers, it is not the Identity transform. Renderers should use "Normalized Device" coordinates if they want to render non-scalable objects. Basically, you pretend you are working in screen pixels.
See Also:
for an example using pixelAT.

setProjection

void setProjection(ucar.unidata.geoloc.ProjectionImpl project)
Tell the Renderer to use the given projection from now on.

Parameters:
project - the projection to use.

setColor

void setColor(Color color)
Tell the Renderer to use the given color.

Parameters:
color - the Color to use.

getColor

Color getColor()
Get the color

Returns:
color

getPreferredArea

ucar.unidata.geoloc.LatLonRect getPreferredArea()
This allows application to automatically switch to some special area defined by the Renderer

Returns:
LatLonRect or null.