de.lessvoid.nifty.controls
Interface Button

All Superinterfaces:
NiftyControl
All Known Implementing Classes:
ButtonControl, ButtonNull

public interface Button
extends NiftyControl

A TextButton Control.

Author:
void

Method Summary
 void activate()
          Activate/Click this button.
 RenderFont getFont()
          Get the current Font of the button text.
 String getText()
          Get the current text the button shows.
 Color getTextColor()
          Get the text color of the Button Text.
 HorizontalAlign getTextHAlign()
          Get the Horizontal Align of the Button text.
 int getTextHeight()
          Get the height of the text.
 VerticalAlign getTextVAlign()
          Get the Vertical Align of the Button text.
 int getTextWidth()
          Get the width of the text.
 void setFont(RenderFont fontParam)
          Set the Font of the button text.
 void setText(String text)
          Set the current text the button shows.
 void setTextColor(Color newColor)
          Set the text color of the Button Text.
 void setTextHAlign(HorizontalAlign newTextHAlign)
          Set the Horizontal Align of the Button text.
 void setTextVAlign(VerticalAlign newTextVAlign)
          Set the Vertical Align of the Button text.
 
Methods inherited from interface de.lessvoid.nifty.controls.NiftyControl
disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidth
 

Method Detail

activate

void activate()
Activate/Click this button.


getText

String getText()
Get the current text the button shows.

Returns:
text

setText

void setText(String text)
Set the current text the button shows.

Parameters:
text - new text to show

getTextWidth

int getTextWidth()
Get the width of the text.

Returns:
width of text in px

getTextHeight

int getTextHeight()
Get the height of the text.

Returns:
height of text in px

getFont

RenderFont getFont()
Get the current Font of the button text.

Returns:
the current Font

setFont

void setFont(RenderFont fontParam)
Set the Font of the button text.

Parameters:
fontParam - new font

getTextVAlign

VerticalAlign getTextVAlign()
Get the Vertical Align of the Button text.

Returns:
VerticalAlign

setTextVAlign

void setTextVAlign(VerticalAlign newTextVAlign)
Set the Vertical Align of the Button text.

Parameters:
newTextVAlign - VerticalAlign

getTextHAlign

HorizontalAlign getTextHAlign()
Get the Horizontal Align of the Button text.

Returns:
HorizontalAlign

setTextHAlign

void setTextHAlign(HorizontalAlign newTextHAlign)
Set the Horizontal Align of the Button text.

Parameters:
newTextHAlign - HorizontalAlign

getTextColor

Color getTextColor()
Get the text color of the Button Text.

Returns:
Color of the Text

setTextColor

void setTextColor(Color newColor)
Set the text color of the Button Text.

Parameters:
newColor - new Color for the button text


Copyright © 2011. All Rights Reserved.