net.ctdp.rfdynhud.render
Class DrawnString

java.lang.Object
  extended by net.ctdp.rfdynhud.render.DrawnString

public class DrawnString
extends java.lang.Object

A DrawnString is an abstraction of a String to be drawn. It handles alignment and clearing.

Author:
Marvin Froehlich (CTDP)

Nested Class Summary
static class DrawnString.Alignment
           
 
Field Summary
 Rect2i clearRect
           
 
Method Summary
 int calcMaxHeight(boolean includingDescent)
          Gets the last drawn string's height.
 void draw(int offsetX, int offsetY, java.lang.String str, java.awt.Color fontColor, TextureImage2D texture)
          Draws the specified String as configured in this class instance.
 void draw(int offsetX, int offsetY, java.lang.String str, java.awt.Color fontColor, TextureImage2D texture, boolean clearBefore)
          Draws the specified String as configured in this class instance.
 int draw(int offsetX, int offsetY, java.lang.String str, java.awt.Color fontColor, TextureImage2D texture, java.awt.Color clearColor)
          Draws the specified String as configured in this class instance.
 int draw(int offsetX, int offsetY, java.lang.String str, java.awt.Color fontColor, TextureImage2D texture, TextureImage2D clearBackground, int clearOffsetX, int clearOffsetY)
          Draws the specified String as configured in this class instance.
 void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture)
          Draws the specified String as configured in this class instance.
 void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture, boolean clearBefore)
          Draws the specified String as configured in this class instance.
 void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture, java.awt.Color clearColor)
          Draws the specified String as configured in this class instance.
 void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture, TextureImage2D clearBackground)
          Draws the specified String as configured in this class instance.
 void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture, TextureImage2D clearBackground, int clearOffsetX, int clearOffsetY)
          Draws the specified String as configured in this class instance.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color[] fontColors, TextureImage2D texture)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color[] fontColors, TextureImage2D texture, boolean clearBefore)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color[] fontColors, TextureImage2D texture, java.awt.Color clearColor)
          Draws the specified Strings as configured in this class instance.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color[] fontColors, TextureImage2D texture, TextureImage2D clearBackground, int clearOffsetX, int clearOffsetY)
          Draws the specified Strings as configured in this class instance.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture, boolean clearBefore)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture, java.awt.Color clearColor)
          Draws the specified Strings as configured in this class instance.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture, TextureImage2D clearBackground, int clearOffsetX, int clearOffsetY)
          Draws the specified Strings as configured in this class instance.
 void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, TextureImage2D texture)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, TextureImage2D texture, boolean clearBefore)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, TextureImage2D texture, java.awt.Color clearColor)
          Draws the specified Strings as configured in this class instance.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture, boolean clearBefore)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture, java.awt.Color clearColor)
          Draws the specified Strings as configured in this class instance.
 int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture, TextureImage2D clearBackground, int clearOffsetX, int clearOffsetY)
          Draws the specified Strings as configured in this class instance.
 void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, TextureImage2D texture)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, TextureImage2D texture, boolean clearBefore)
          Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.
 void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, TextureImage2D texture, java.awt.Color clearColor)
          Draws the specified Strings as configured in this class instance.
 void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, TextureImage2D texture, TextureImage2D clearBackground, int clearOffsetX, int clearOffsetY)
          Draws the specified Strings as configured in this class instance.
 int getAbsX()
          Gets the x-location of the String with respect to "relativeTo".
 int getAbsY()
          Gets the y-location of the String with respect to "relativeTo".
 DrawnString.Alignment getAlignment()
          Gets the alignment affecting the x-location.
 java.awt.Font getFont()
          Gets the used Font.
 java.awt.Color getFontColor()
          Gets the used Font-Color.
 int getLastWidth()
          Gets the last drawn string's width.
 int getMaxColWidths(java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths)
          Gets the drawn strings' maximum column-widths and the total width in pixels.
 int getMaxHeight(boolean includingDescent)
          Gets the last drawn string's height.
 int getMinColWidths(java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths)
          Gets the drawn strings' minimum column-widths and the total width in pixels.
 java.lang.String getName()
           
 java.lang.String getPostfix()
          Gets the postfix.
 java.lang.String getPrefix()
          Gets the prefix.
 int getWidth(java.lang.String str)
          Gets the drawn string's width in pixels.
 int getX()
          Gets the x-location of the String.
 DrawnString getXRelativeTo()
           
 int getY()
          Gets the y-location of the String.
 DrawnString getYRelativeTo()
           
 boolean isYAtBaseline()
          Gets, whether the y-coordinate indicates the String's baseline position or the top-bound.
 void resetClearRect()
           
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clearRect

public final Rect2i clearRect
Method Detail

getName

public final java.lang.String getName()

resetClearRect

public void resetClearRect()

getXRelativeTo

public final DrawnString getXRelativeTo()

getYRelativeTo

public final DrawnString getYRelativeTo()

getX

public final int getX()
Gets the x-location of the String.

Returns:
the x-location of the String.
See Also:
getAlignment()

getY

public final int getY()
Gets the y-location of the String.

Returns:
the y-location of the String.
See Also:
isYAtBaseline()

getAbsX

public final int getAbsX()
Gets the x-location of the String with respect to "relativeTo".

Returns:
the x-location of the String.
See Also:
getAlignment()

getAbsY

public final int getAbsY()
Gets the y-location of the String with respect to "relativeTo".

Returns:
the y-location of the String.
See Also:
isYAtBaseline()

getAlignment

public final DrawnString.Alignment getAlignment()
Gets the alignment affecting the x-location.

Returns:
the alignment affecting the x-location.

isYAtBaseline

public final boolean isYAtBaseline()
Gets, whether the y-coordinate indicates the String's baseline position or the top-bound.

Returns:
whether the y-coordinate indicates the String's baseline position or the top-bound.

getFont

public final java.awt.Font getFont()
Gets the used Font.

Returns:
the used Font.

getFontColor

public final java.awt.Color getFontColor()
Gets the used Font-Color.

Returns:
the used Font-Color.

getPrefix

public final java.lang.String getPrefix()
Gets the prefix.

Returns:
the prefix.

getPostfix

public final java.lang.String getPostfix()
Gets the postfix.

Returns:
the postfix.

getWidth

public int getWidth(java.lang.String str)
Gets the drawn string's width in pixels.

Parameters:
str - the string to draw
Returns:
the drawn string's width in pixels.

getMinColWidths

public int getMinColWidths(java.lang.String[] strs,
                           DrawnString.Alignment[] aligns,
                           int padding,
                           int[] colWidths)
Gets the drawn strings' minimum column-widths and the total width in pixels.

Parameters:
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - padding per column
colWidths - the array to write column widths to
Returns:
the drawn strings' minimum total width in pixels.

getMaxColWidths

public int getMaxColWidths(java.lang.String[] strs,
                           DrawnString.Alignment[] aligns,
                           int padding,
                           int[] colWidths)
Gets the drawn strings' maximum column-widths and the total width in pixels.

Parameters:
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - padding per column
colWidths - the array to write column widths to
Returns:
the drawn strings' maximum total width in pixels.

getLastWidth

public final int getLastWidth()
Gets the last drawn string's width.
This value will be invalid, if this DrawnString has not yet been drawn.

Returns:
the last drawn string's width.

getMaxHeight

public final int getMaxHeight(boolean includingDescent)
Gets the last drawn string's height.
This value will be invalid, if this DrawnString has not yet been drawn.

Parameters:
includingDescent - include font descent?
Returns:
the last drawn string's height.

calcMaxHeight

public final int calcMaxHeight(boolean includingDescent)
Gets the last drawn string's height.

Parameters:
includingDescent - include font descent?
Returns:
the last drawn string's height.

draw

public int draw(int offsetX,
                int offsetY,
                java.lang.String str,
                java.awt.Color fontColor,
                TextureImage2D texture,
                java.awt.Color clearColor)
Draws the specified String as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
str - the string to draw
fontColor - (null for predefined)
texture - the texture to draw on
clearColor - the color to use for clearing (null to skip clearing)
Returns:
the drawn string's width in pixels.

draw

public void draw(int offsetX,
                 int offsetY,
                 java.lang.String str,
                 TextureImage2D texture,
                 java.awt.Color clearColor)
Draws the specified String as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
str - the string to draw
texture - the texture to draw on
clearColor - the color to use for clearing (null to skip clearing)

draw

public int draw(int offsetX,
                int offsetY,
                java.lang.String str,
                java.awt.Color fontColor,
                TextureImage2D texture,
                TextureImage2D clearBackground,
                int clearOffsetX,
                int clearOffsetY)
Draws the specified String as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
str - the string to draw
fontColor - (null for predefined)
texture - the texture to draw on
clearBackground - the image to use for clearing (null to skip clearing)
clearOffsetX - the x-offset of the clear texture on the background
clearOffsetY - the y-offset of the clear texture on the background
Returns:
the drawn string's width in pixels.

draw

public void draw(int offsetX,
                 int offsetY,
                 java.lang.String str,
                 TextureImage2D texture,
                 TextureImage2D clearBackground,
                 int clearOffsetX,
                 int clearOffsetY)
Draws the specified String as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
str - the string to draw
texture - the texture to draw on
clearBackground - the image to use for clearing (null to skip clearing)
clearOffsetX - the x-offset of the clear texture on the background
clearOffsetY - the y-offset of the clear texture on the background

draw

public void draw(int offsetX,
                 int offsetY,
                 java.lang.String str,
                 TextureImage2D texture,
                 TextureImage2D clearBackground)
Draws the specified String as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
str - the string to draw
texture - the texture to draw on
clearBackground - the image to use for clearing (null to skip clearing)

draw

public void draw(int offsetX,
                 int offsetY,
                 java.lang.String str,
                 java.awt.Color fontColor,
                 TextureImage2D texture,
                 boolean clearBefore)
Draws the specified String as configured in this class instance. This method doesn't clear the area before!

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
str - the string to draw
fontColor - (null for predefined)
texture - the texture to draw on
clearBefore - clear the area before drawing?

draw

public void draw(int offsetX,
                 int offsetY,
                 java.lang.String str,
                 TextureImage2D texture,
                 boolean clearBefore)
Draws the specified String as configured in this class instance. This method doesn't clear the area before!

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
str - the string to draw
texture - the texture to draw on
clearBefore - clear the area before drawing?

draw

public void draw(int offsetX,
                 int offsetY,
                 java.lang.String str,
                 java.awt.Color fontColor,
                 TextureImage2D texture)
Draws the specified String as configured in this class instance. This method doesn't clear the area before!

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
str - the string to draw
fontColor - (null for predefined)
texture - the texture to draw on

draw

public void draw(int offsetX,
                 int offsetY,
                 java.lang.String str,
                 TextureImage2D texture)
Draws the specified String as configured in this class instance. This method doesn't clear the area before!

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
str - the string to draw
texture - the texture to draw on

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       int[] colWidths,
                       java.awt.Color fontColor,
                       TextureImage2D texture,
                       java.awt.Color clearColor)
Draws the specified Strings as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
colWidths - the column widths to use
fontColor - (null for predefined)
texture - the texture to draw on
clearColor - the color to use for clearing (null to skip clearing)
Returns:
the drawn string's width in pixels.

drawColumns

public void drawColumns(int offsetX,
                        int offsetY,
                        java.lang.String[] strs,
                        int[] colWidths,
                        TextureImage2D texture,
                        java.awt.Color clearColor)
Draws the specified Strings as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
colWidths - the column widths to use
texture - the texture to draw on
clearColor - the color to use for clearing (null to skip clearing)

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       int[] colWidths,
                       java.awt.Color fontColor,
                       TextureImage2D texture,
                       TextureImage2D clearBackground,
                       int clearOffsetX,
                       int clearOffsetY)
Draws the specified Strings as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
colWidths - the column widths to use
fontColor - (null for predefined)
texture - the texture to draw on
clearBackground - the image to use for clearing (null to skip clearing)
clearOffsetX - the x-offset of the clear texture on the background
clearOffsetY - the y-offset of the clear texture on the background
Returns:
the drawn string's width in pixels.

drawColumns

public void drawColumns(int offsetX,
                        int offsetY,
                        java.lang.String[] strs,
                        int[] colWidths,
                        TextureImage2D texture,
                        TextureImage2D clearBackground,
                        int clearOffsetX,
                        int clearOffsetY)
Draws the specified Strings as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
colWidths - the column widths to use
texture - the texture to draw on
clearBackground - the image to use for clearing (null to skip clearing)
clearOffsetX - the x-offset of the clear texture on the background
clearOffsetY - the y-offset of the clear texture on the background

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       DrawnString.Alignment[] aligns,
                       int padding,
                       int[] colWidths,
                       java.awt.Color[] fontColors,
                       TextureImage2D texture,
                       java.awt.Color clearColor)
Draws the specified Strings as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
fontColors - (null for predefined)
texture - the texture to draw on
clearColor - the color to use for clearing (null to skip clearing)
Returns:
the drawn string's width in pixels.

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       DrawnString.Alignment[] aligns,
                       int padding,
                       int[] colWidths,
                       java.awt.Color fontColor,
                       TextureImage2D texture,
                       java.awt.Color clearColor)
Draws the specified Strings as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
fontColor - (null for predefined)
texture - the texture to draw on
clearColor - the color to use for clearing (null to skip clearing)
Returns:
the drawn string's width in pixels.

drawColumns

public void drawColumns(int offsetX,
                        int offsetY,
                        java.lang.String[] strs,
                        DrawnString.Alignment[] aligns,
                        int padding,
                        int[] colWidths,
                        TextureImage2D texture,
                        java.awt.Color clearColor)
Draws the specified Strings as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
texture - the texture to draw on
clearColor - the color to use for clearing (null to skip clearing)

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       DrawnString.Alignment[] aligns,
                       int padding,
                       int[] colWidths,
                       java.awt.Color[] fontColors,
                       TextureImage2D texture,
                       TextureImage2D clearBackground,
                       int clearOffsetX,
                       int clearOffsetY)
Draws the specified Strings as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
fontColors - (null for predefined)
texture - the texture to draw on
clearBackground - the image to use for clearing (null to skip clearing)
clearOffsetX - the x-offset of the clear texture on the background
clearOffsetY - the y-offset of the clear texture on the background
Returns:
the drawn string's width in pixels.

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       DrawnString.Alignment[] aligns,
                       int padding,
                       int[] colWidths,
                       java.awt.Color fontColor,
                       TextureImage2D texture,
                       TextureImage2D clearBackground,
                       int clearOffsetX,
                       int clearOffsetY)
Draws the specified Strings as configured in this class instance.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
fontColor - (null for predefined)
texture - the texture to draw on
clearBackground - the image to use for clearing (null to skip clearing)
clearOffsetX - the x-offset of the clear texture on the background
clearOffsetY - the y-offset of the clear texture on the background
Returns:
the drawn string's width in pixels.

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       int[] colWidths,
                       java.awt.Color fontColor,
                       TextureImage2D texture,
                       boolean clearBefore)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
colWidths - the column widths to use
fontColor - (null for predefined)
texture - the texture to draw on
clearBefore - clear the area before drawing?
Returns:
the drawn string's width in pixels.

drawColumns

public void drawColumns(int offsetX,
                        int offsetY,
                        java.lang.String[] strs,
                        int[] colWidths,
                        TextureImage2D texture,
                        boolean clearBefore)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
colWidths - the column widths to use
texture - the texture to draw on
clearBefore - clear the area before drawing?

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       DrawnString.Alignment[] aligns,
                       int padding,
                       int[] colWidths,
                       java.awt.Color[] fontColors,
                       TextureImage2D texture,
                       boolean clearBefore)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
fontColors - (null for predefined)
texture - the texture to draw on
clearBefore - clear the area before drawing?
Returns:
the drawn string's width in pixels.

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       DrawnString.Alignment[] aligns,
                       int padding,
                       int[] colWidths,
                       java.awt.Color fontColor,
                       TextureImage2D texture,
                       boolean clearBefore)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
fontColor - (null for predefined)
texture - the texture to draw on
clearBefore - clear the area before drawing?
Returns:
the drawn string's width in pixels.

drawColumns

public void drawColumns(int offsetX,
                        int offsetY,
                        java.lang.String[] strs,
                        DrawnString.Alignment[] aligns,
                        int padding,
                        int[] colWidths,
                        TextureImage2D texture,
                        boolean clearBefore)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
texture - the texture to draw on
clearBefore - clear the area before drawing?

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       int[] colWidths,
                       java.awt.Color fontColor,
                       TextureImage2D texture)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
colWidths - the column widths to use
fontColor - (null for predefined)
texture - the texture to draw on
Returns:
the drawn string's width in pixels.

drawColumns

public void drawColumns(int offsetX,
                        int offsetY,
                        java.lang.String[] strs,
                        int[] colWidths,
                        TextureImage2D texture)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
colWidths - the column widths to use
texture - the texture to draw on

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       DrawnString.Alignment[] aligns,
                       int padding,
                       int[] colWidths,
                       java.awt.Color[] fontColors,
                       TextureImage2D texture)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
fontColors - (null for predefined)
texture - the texture to draw on
Returns:
the drawn string's width in pixels.

drawColumns

public int drawColumns(int offsetX,
                       int offsetY,
                       java.lang.String[] strs,
                       DrawnString.Alignment[] aligns,
                       int padding,
                       int[] colWidths,
                       java.awt.Color fontColor,
                       TextureImage2D texture)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
fontColor - (null for predefined)
texture - the texture to draw on
Returns:
the drawn string's width in pixels.

drawColumns

public void drawColumns(int offsetX,
                        int offsetY,
                        java.lang.String[] strs,
                        DrawnString.Alignment[] aligns,
                        int padding,
                        int[] colWidths,
                        TextureImage2D texture)
Draws the specified Strings as configured in this class instance and clears the previously used area with the Widget's background, if necessary.

Parameters:
offsetX - the x-offset on the texture
offsetY - the y-offset on the texture
strs - the strings to draw
aligns - alignment per column (default is the DrawnString's alignment)
padding - the padding to honor when aligning right
colWidths - the column widths to use
texture - the texture to draw on

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object