com.bbn.openmap.omGraphics
Interface OMLabeler

All Known Implementing Classes:
OMTextLabeler

public interface OMLabeler

An OMLabeler is used by OMGraphics to handle their labels. It can draw the text on the map, and tell how far away an x,y pixel location is away from where it's drawing itself on the map.

Author:
dietrick

Method Summary
 float distance(double x, double y)
          The OMLabler should return the pixel distance from any part of the label to the given x, y pixel distance.
 void evaluateRotationAngle(Projection proj)
          Evaluate the current projection in case it has information that affects placement, like rotation.
 void render(java.awt.Graphics g)
          The OMLabeler should render the text label onto the Graphics object.
 void setLocation(java.awt.geom.GeneralPath gp)
          The OMLabeler should be able to determine its pixel location based on the GeneralPath of the OMGraphic.
 void setLocation(int[] xpoints, int[] ypoints)
          The OMLabeler should be able to determine its pixel location based on a set of x and y pixel coordinates common in OMGraphics.
 void setLocation(java.awt.geom.Point2D p)
          The OMLabeler should be able to set its pixel location directly.
 

Method Detail

render

void render(java.awt.Graphics g)
The OMLabeler should render the text label onto the Graphics object.

Parameters:
g -

distance

float distance(double x,
               double y)
The OMLabler should return the pixel distance from any part of the label to the given x, y pixel distance.

Parameters:
x - pixel distance from left side of map window.
y - pixel distance from top of map window.
Returns:
distance in pixels from label text to given point.

setLocation

void setLocation(java.awt.geom.GeneralPath gp)
The OMLabeler should be able to determine its pixel location based on the GeneralPath of the OMGraphic. This will generally cause the label to be placed in the center of the bounds of the shape.

Parameters:
gp -

setLocation

void setLocation(int[] xpoints,
                 int[] ypoints)
The OMLabeler should be able to determine its pixel location based on a set of x and y pixel coordinates common in OMGraphics.

Parameters:
xpoints -
ypoints -

setLocation

void setLocation(java.awt.geom.Point2D p)
The OMLabeler should be able to set its pixel location directly.

Parameters:
p -

evaluateRotationAngle

void evaluateRotationAngle(Projection proj)
Evaluate the current projection in case it has information that affects placement, like rotation.

Parameters:
proj - Projection


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