|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lessvoid.nifty.elements.render.TextRenderer
public class TextRenderer
The TextRenderer implementation.
Nested Class Summary | |
---|---|
class |
TextRenderer.RenderFontNull
RenderFont Null Object. |
Constructor Summary | |
---|---|
TextRenderer(Nifty nifty)
default constructor. |
|
TextRenderer(Nifty nifty,
RenderFont newFont,
String newText)
create new renderer with the given font and text. |
Method Summary | |
---|---|
Color |
getColor()
|
RenderFont |
getFont()
Get RenderFont. |
String |
getOriginalText()
get original text. |
protected static int |
getStartXWithHorizontalAlign(int textWidth,
int elementWidth,
HorizontalAlign horizontalAlign)
Get start x for text rendering given the textWidth and the elementWidth. |
protected static int |
getStartYWithVerticalAlign(int textHeight,
int elementHeight,
VerticalAlign verticalAlign)
Get start Y for text rendering given the textHeight and the elementHeight. |
HorizontalAlign |
getTextHAlign()
|
int |
getTextHeight()
Helper method to get height of text. |
VerticalAlign |
getTextVAlign()
|
int |
getTextWidth()
Helper method to get width of text. |
String |
getWrappedText()
|
boolean |
isLineWrapping()
|
void |
render(Element w,
NiftyRenderEngine r)
render the stuff. |
void |
resetLayout(Element element)
|
void |
setColor(Color newColor)
set color. |
void |
setFont(RenderFont fontParam)
set font. |
void |
setLineWrapping(boolean lineWrapping)
|
void |
setSelection(int selectionStartParam,
int selectionEndParam)
set a new selection. |
void |
setText(String newText)
set Text. |
void |
setTextHAlign(HorizontalAlign newTextHAlign)
set text horizontal alignment. |
void |
setTextLineHeight(SizeValue textLineHeight)
|
void |
setTextMinHeight(SizeValue textMinHeight)
|
void |
setTextSelectionColor(Color textSelectionColorParam)
set new text selection color. |
void |
setTextVAlign(VerticalAlign newTextVAlign)
set text vertical alignment. |
void |
setWidthConstraint(Element element,
SizeValue elementConstraintWidth,
int parentWidth,
NiftyRenderEngine renderEngine)
|
void |
setXoffsetHack(int newXoffsetHack)
set thing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextRenderer(Nifty nifty)
public TextRenderer(Nifty nifty, RenderFont newFont, String newText)
newFont
- the font to usenewText
- the text to useMethod Detail |
---|
public void setText(String newText)
newText
- textpublic void render(Element w, NiftyRenderEngine r)
render
in interface ElementRenderer
w
- the widget we're connected tor
- the renderDevice we should useprotected static int getStartYWithVerticalAlign(int textHeight, int elementHeight, VerticalAlign verticalAlign)
textHeight
- text heightelementHeight
- element heightverticalAlign
- verticalAlign
protected static int getStartXWithHorizontalAlign(int textWidth, int elementWidth, HorizontalAlign horizontalAlign)
textWidth
- text widthelementWidth
- element widthhorizontalAlign
- horizontalAlign
public int getTextWidth()
public int getTextHeight()
public void setXoffsetHack(int newXoffsetHack)
newXoffsetHack
- xoffsetpublic RenderFont getFont()
public void setSelection(int selectionStartParam, int selectionEndParam)
selectionStartParam
- startselectionEndParam
- endpublic void setFont(RenderFont fontParam)
fontParam
- fontpublic void setTextSelectionColor(Color textSelectionColorParam)
textSelectionColorParam
- text selection colorpublic void setTextVAlign(VerticalAlign newTextVAlign)
newTextVAlign
- text vertical alignmentpublic void setTextHAlign(HorizontalAlign newTextHAlign)
newTextHAlign
- text horizontal alignmentpublic void setColor(Color newColor)
newColor
- colorpublic String getOriginalText()
public String getWrappedText()
public void setTextLineHeight(SizeValue textLineHeight)
public void setTextMinHeight(SizeValue textMinHeight)
public void setWidthConstraint(Element element, SizeValue elementConstraintWidth, int parentWidth, NiftyRenderEngine renderEngine)
public void setLineWrapping(boolean lineWrapping)
public boolean isLineWrapping()
public VerticalAlign getTextVAlign()
public HorizontalAlign getTextHAlign()
public Color getColor()
public void resetLayout(Element element)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |