Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap
Interface ProjectionPainter

All Known Implementing Classes:
  Layer

public interface ProjectionPainter

The ProjectionPainter interface is intended for objects that can manage graphics and draw them into a Java Graphics object. The idea is that the ProjectionPainter, all within one thread, gathers the graphics that reside within the projection, and render them into the Graphics that has been set up for that projection. The height and width of the projection should match the Graphics height and width, in case some of the graphics from the ProjectionPainter depend on them to place themselves within the Graphics.

This is different from the usual paradigm of OpenMap components. Since OpenMap components are Swing components, they usually ready themselves, call repaint() on themselves, and then wait for the Swing thread to call paint and supply a Graphics object. This leads to uncertainty as to when the painting is actually completed, which can be an issue if you are trying to create an image, or something like that.

Some layers kick off a SwingWorker thread to do the work. If a layer is modified to implement this interface, the layer should do all the graphics collection work and rendering in the calling thread, so the caller knows that the contribution to the map from this ProjectionPainter is complete.

Method Summary
`void` | `renderDataForProjection(Projection proj, java.awt.Graphics g)` Given a projection and Graphics, paint graphic objects inside the Graphics.

Method Detail

### renderDataForProjection

    public void renderDataForProjection(Projection proj,
                                        java.awt.Graphics g)

  Given a projection and Graphics, paint graphic objects inside the Graphics. When this function returns, everything should be all set.

  Parameters:
    `proj` - a com.bbn.openmap.proj.Projection that describes a map.
    `g` - a java.awt.Graphics to draw into.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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