com.bbn.openmap.layer.policy
Interface RenderPolicy

All Known Implementing Classes:
BufferedImageRenderPolicy, FullProjectionRenderPolicy, PanningImageRenderPolicy, RenderingHintsRenderPolicy, StandardRenderPolicy

public interface RenderPolicy

A policy object that can be used by an OMGraphicHandlerLayer to figure out the best way to paint on the map.


Method Summary
 java.awt.Composite getComposite()
           
 OMGraphicHandlerLayer getLayer()
          A method to get the parent layer on the RenderPolicy.
 void paint(java.awt.Graphics g)
          Called from OMGraphicHandlerLayer.paint(Graphics), so the policy can handle the painting for the layer.
 OMGraphicList prepare()
          Called when an OMGraphicHandlerLayer should begin preparing OMGraphics for the map.
 void prePrepare(Projection newProjection)
          Be very careful with doing things in this method.
 void setComposite(java.awt.Composite composite)
          Set a Composite object on a Graphics2D object before rendering.
 void setLayer(OMGraphicHandlerLayer layer)
          A method to set the parent layer on the RenderPolicy.
 

Method Detail

setLayer

void setLayer(OMGraphicHandlerLayer layer)
A method to set the parent layer on the RenderPolicy.


getLayer

OMGraphicHandlerLayer getLayer()
A method to get the parent layer on the RenderPolicy.


setComposite

void setComposite(java.awt.Composite composite)
Set a Composite object on a Graphics2D object before rendering. Set to null (default) to not do anything.


getComposite

java.awt.Composite getComposite()

prePrepare

void prePrepare(Projection newProjection)
Be very careful with doing things in this method. It is called from the doPrepare() method in the calling thread, in order to allow any buffering to update itself outside of the LayerWorker thread. It allows the render policy to keep up with rapid projection changes even if the LayerWorker threads are getting backed up. Do not do a lot of work in this thread, it will slow down projection change notifications being received from other layers if you do.

Parameters:
newProjection - the new projection received in a projectionChanged method for the layer.

prepare

OMGraphicList prepare()
Called when an OMGraphicHandlerLayer should begin preparing OMGraphics for the map. This is a hook into the list to help RenderPolicy make decisions or set up the list for faster rendering.


paint

void paint(java.awt.Graphics g)
Called from OMGraphicHandlerLayer.paint(Graphics), so the policy can handle the painting for the layer. If you are going to change the Graphics object in this method, you should make a copy of it first using the Graphics.create() method so the changes won't affect other layers.



Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details