edu.neu.ccs.gui
Interface TextAnchor.XLocator

Enclosing interface:
TextAnchor

public static interface TextAnchor.XLocator

The XLocator interface defines the methods needed to compute the x-coordinate of the left, right, and center of a given String displayed in a given Font using the given anchorX position and this strategy.


Method Summary
 float getCenterX(String string, Font font, float anchorX)
          Returns the center x-coordinate of the string.
 float getLeftX(String string, Font font, float anchorX)
          Returns the left x-coordinate of the string.
 float getRightX(String string, Font font, float anchorX)
          Returns the right x-coordinate of the string.
 

Method Detail

getLeftX

public float getLeftX(String string,
                      Font font,
                      float anchorX)
Returns the left x-coordinate of the string.

Parameters:
string - the string to display
font - the font to use for the display
anchorX - the x-coordinate of the anchor position
Returns:
the left x-coordinate of the string

getRightX

public float getRightX(String string,
                       Font font,
                       float anchorX)
Returns the right x-coordinate of the string.

Parameters:
string - the string to display
font - the font to use for the display
anchorX - the x-coordinate of the anchor position
Returns:
the right x-coordinate of the string

getCenterX

public float getCenterX(String string,
                        Font font,
                        float anchorX)
Returns the center x-coordinate of the string.

Parameters:
string - the string to display
font - the font to use for the display
anchorX - the x-coordinate of the anchor position
Returns:
the center x-coordinate of the string