|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ctdp.rfdynhud.render.DrawnString
public class DrawnString
A DrawnString
is an abstraction of a String to be drawn.
It handles alignment and clearing.
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 |
---|
public final Rect2i clearRect
Method Detail |
---|
public final java.lang.String getName()
public void resetClearRect()
public final DrawnString getXRelativeTo()
public final DrawnString getYRelativeTo()
public final int getX()
getAlignment()
public final int getY()
isYAtBaseline()
public final int getAbsX()
getAlignment()
public final int getAbsY()
isYAtBaseline()
public final DrawnString.Alignment getAlignment()
public final boolean isYAtBaseline()
public final java.awt.Font getFont()
public final java.awt.Color getFontColor()
public final java.lang.String getPrefix()
public final java.lang.String getPostfix()
public int getWidth(java.lang.String str)
str
- the string to draw
public int getMinColWidths(java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths)
strs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- padding per columncolWidths
- the array to write column widths to
public int getMaxColWidths(java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths)
strs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- padding per columncolWidths
- the array to write column widths to
public final int getLastWidth()
DrawnString
has not yet been drawn.
public final int getMaxHeight(boolean includingDescent)
DrawnString
has not yet been drawn.
includingDescent
- include font descent?
public final int calcMaxHeight(boolean includingDescent)
includingDescent
- include font descent?
public int draw(int offsetX, int offsetY, java.lang.String str, java.awt.Color fontColor, TextureImage2D texture, java.awt.Color clearColor)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestr
- the string to drawfontColor
- (null for predefined)texture
- the texture to draw onclearColor
- the color to use for clearing (null to skip clearing)
public void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture, java.awt.Color clearColor)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestr
- the string to drawtexture
- the texture to draw onclearColor
- the color to use for clearing (null to skip clearing)public int draw(int offsetX, int offsetY, java.lang.String str, java.awt.Color fontColor, TextureImage2D texture, TextureImage2D clearBackground, int clearOffsetX, int clearOffsetY)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestr
- the string to drawfontColor
- (null for predefined)texture
- the texture to draw onclearBackground
- the image to use for clearing (null to skip clearing)clearOffsetX
- the x-offset of the clear texture on the backgroundclearOffsetY
- the y-offset of the clear texture on the background
public void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture, TextureImage2D clearBackground, int clearOffsetX, int clearOffsetY)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestr
- the string to drawtexture
- the texture to draw onclearBackground
- the image to use for clearing (null to skip clearing)clearOffsetX
- the x-offset of the clear texture on the backgroundclearOffsetY
- the y-offset of the clear texture on the backgroundpublic void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture, TextureImage2D clearBackground)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestr
- the string to drawtexture
- the texture to draw onclearBackground
- the image to use for clearing (null to skip clearing)public void draw(int offsetX, int offsetY, java.lang.String str, java.awt.Color fontColor, TextureImage2D texture, boolean clearBefore)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestr
- the string to drawfontColor
- (null for predefined)texture
- the texture to draw onclearBefore
- clear the area before drawing?public void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture, boolean clearBefore)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestr
- the string to drawtexture
- the texture to draw onclearBefore
- clear the area before drawing?public void draw(int offsetX, int offsetY, java.lang.String str, java.awt.Color fontColor, TextureImage2D texture)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestr
- the string to drawfontColor
- (null for predefined)texture
- the texture to draw onpublic void draw(int offsetX, int offsetY, java.lang.String str, TextureImage2D texture)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestr
- the string to drawtexture
- the texture to draw onpublic int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture, java.awt.Color clearColor)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawcolWidths
- the column widths to usefontColor
- (null for predefined)texture
- the texture to draw onclearColor
- the color to use for clearing (null to skip clearing)
public void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, TextureImage2D texture, java.awt.Color clearColor)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawcolWidths
- the column widths to usetexture
- the texture to draw onclearColor
- the color to use for clearing (null to skip clearing)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)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawcolWidths
- the column widths to usefontColor
- (null for predefined)texture
- the texture to draw onclearBackground
- the image to use for clearing (null to skip clearing)clearOffsetX
- the x-offset of the clear texture on the backgroundclearOffsetY
- the y-offset of the clear texture on the background
public void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, TextureImage2D texture, TextureImage2D clearBackground, int clearOffsetX, int clearOffsetY)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawcolWidths
- the column widths to usetexture
- the texture to draw onclearBackground
- the image to use for clearing (null to skip clearing)clearOffsetX
- the x-offset of the clear texture on the backgroundclearOffsetY
- the y-offset of the clear texture on the backgroundpublic 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)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usefontColors
- (null for predefined)texture
- the texture to draw onclearColor
- the color to use for clearing (null to skip clearing)
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)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usefontColor
- (null for predefined)texture
- the texture to draw onclearColor
- the color to use for clearing (null to skip clearing)
public void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, TextureImage2D texture, java.awt.Color clearColor)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usetexture
- the texture to draw onclearColor
- the color to use for clearing (null to skip clearing)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)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usefontColors
- (null for predefined)texture
- the texture to draw onclearBackground
- the image to use for clearing (null to skip clearing)clearOffsetX
- the x-offset of the clear texture on the backgroundclearOffsetY
- the y-offset of the clear texture on the background
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)
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usefontColor
- (null for predefined)texture
- the texture to draw onclearBackground
- the image to use for clearing (null to skip clearing)clearOffsetX
- the x-offset of the clear texture on the backgroundclearOffsetY
- the y-offset of the clear texture on the background
public int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture, boolean clearBefore)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawcolWidths
- the column widths to usefontColor
- (null for predefined)texture
- the texture to draw onclearBefore
- clear the area before drawing?
public void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, TextureImage2D texture, boolean clearBefore)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawcolWidths
- the column widths to usetexture
- the texture to draw onclearBefore
- clear the area before drawing?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)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usefontColors
- (null for predefined)texture
- the texture to draw onclearBefore
- clear the area before drawing?
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)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usefontColor
- (null for predefined)texture
- the texture to draw onclearBefore
- clear the area before drawing?
public void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, TextureImage2D texture, boolean clearBefore)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usetexture
- the texture to draw onclearBefore
- clear the area before drawing?public int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawcolWidths
- the column widths to usefontColor
- (null for predefined)texture
- the texture to draw on
public void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, int[] colWidths, TextureImage2D texture)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawcolWidths
- the column widths to usetexture
- the texture to draw onpublic int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color[] fontColors, TextureImage2D texture)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usefontColors
- (null for predefined)texture
- the texture to draw on
public int drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, java.awt.Color fontColor, TextureImage2D texture)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usefontColor
- (null for predefined)texture
- the texture to draw on
public void drawColumns(int offsetX, int offsetY, java.lang.String[] strs, DrawnString.Alignment[] aligns, int padding, int[] colWidths, TextureImage2D texture)
Widget
's background, if necessary.
offsetX
- the x-offset on the textureoffsetY
- the y-offset on the texturestrs
- the strings to drawaligns
- alignment per column (default is the DrawnString
's alignment)padding
- the padding to honor when aligning rightcolWidths
- the column widths to usetexture
- the texture to draw onpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |