Package ej.microui.display
Class RenderableString
- java.lang.Object
-
- ej.microui.display.RenderableString
-
public class RenderableString extends Object
Represents graphical information related to the drawing of a string with a font.Drawing a renderable string is faster than drawing a regular string. This optimization is done by caching the index within the font of every character of the string as soon as the renderable string is created. However a
RenderableStringconsumes significant heap memory.
-
-
Constructor Summary
Constructors Constructor Description RenderableString(String string, Font font)Creates a renderable string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char[]getCharArray()Returns the characters array associated with this renderable string.FontgetFont()Returns the font associated with this renderable string.intgetHeight()Returns the height of the graphical bounds of this renderable string.byte[]getSNIContext()Returns the SNI context data of this renderable string.StringgetString()Returns the string associated with this renderable string.intgetWidth()Returns the width of the graphical bounds of this renderable string.
-
-
-
Method Detail
-
getString
public String getString()
Returns the string associated with this renderable string.- Returns:
- the string associated with this renderable string.
-
getCharArray
public char[] getCharArray()
Returns the characters array associated with this renderable string.Same array is always returned, contrary to
renderableString.getString().toCharArray().. By consequence its content must not be modified.- Returns:
- the character array associated with this renderable string.
- See Also:
String.toCharArray()
-
getFont
public Font getFont()
Returns the font associated with this renderable string.- Returns:
- the font associated with this renderable string.
-
getWidth
public int getWidth()
Returns the width of the graphical bounds of this renderable string.This method has the same specifications as
Font.stringWidth(String).- Returns:
- the width taken by this renderable string, in pixels.
-
getHeight
public int getHeight()
Returns the height of the graphical bounds of this renderable string.This method has the same specifications as
Font.getHeight().- Returns:
- the height taken by this renderable string, in pixels.
-
getSNIContext
public byte[] getSNIContext()
Returns the SNI context data of this renderable string.The SNI context can be used to call a native method with SNI. This allows to identify and to use a renderable string in the native world.
The data format is implementation specific.
- Returns:
- the SNI context of this renderable string.
- See Also:
Font.allocateRenderableStringSNIContext(char[], int, int)
-
-