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(int x, int y)
          The OMLabler should return the pixel distance from any part of the label to the given x, y pixel distance.
 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.Point p)
          The OMLabeler should be able to set its pixel location directly.
 

Method Detail

render

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

Parameters:
g -

distance

public float distance(int x,
                      int 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

public 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

public 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

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

Parameters:
p -


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