Package ucar.nc2.ui.util
Interface Renderer
-
- All Known Implementing Classes:
ContourFeatureRenderer
,EsriShapefileRenderer
,GisFeatureRenderer
,GisFeatureRendererMulti
,PointRenderer
,WorldMap
public interface Renderer
A Renderer does the actual work of drawing objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
draw(Graphics2D g, AffineTransform pixelAT)
Tell the renderer to draw itself.Color
getColor()
LatLonRect
getPreferredArea()
This allows application to automatically switch to some special area defined by the Renderervoid
setColor(Color color)
Tell the Renderer to use the given color.void
setProjection(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 contextpixelAT
- 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.
-
setProjection
void setProjection(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()
-
getPreferredArea
LatLonRect getPreferredArea()
This allows application to automatically switch to some special area defined by the Renderer- Returns:
- LatLonRect or null.
-
-