apwidgets
Class PTextView

java.lang.Object
  extended by apwidgets.PWidget
      extended by apwidgets.PTextView
All Implemented Interfaces:
android.text.NoCopySpan, android.text.TextWatcher, android.view.View.OnClickListener
Direct Known Subclasses:
PButton, PEditText

public abstract class PTextView
extends PWidget
implements android.text.TextWatcher


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.text.NoCopySpan
android.text.NoCopySpan.Concrete
 
Constructor Summary
PTextView(int x, int y, int width, int height, java.lang.String text)
           
 
Method Summary
 void afterTextChanged(android.text.Editable s)
          Updating the text variable.
 void beforeTextChanged(java.lang.CharSequence s, int start, int count, int after)
           
 java.lang.String getText()
           
 int getTextColor()
           
 int getTextSize()
           
 void init(processing.core.PApplet pApplet)
          Initializes the text field.
 void onTextChanged(java.lang.CharSequence s, int start, int before, int count)
           
 void setText(java.lang.String text)
           
 void setTextColor(int r, int g, int b, int a)
          Sets the color of the text content.
 void setTextSize(int textSize)
           
 
Methods inherited from class apwidgets.PWidget
addOnClickWidgetListener, getHeight, getPApplet, getWidth, getView, getX, getY, onClick, setPosition, setSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PTextView

public PTextView(int x,
                 int y,
                 int width,
                 int height,
                 java.lang.String text)
Method Detail

getText

public java.lang.String getText()
Returns:
The text content.

setTextSize

public void setTextSize(int textSize)
Parameters:
textSize - The size of the text.

setText

public void setText(java.lang.String text)
Parameters:
text - The text content.

setTextColor

public void setTextColor(int r,
                         int g,
                         int b,
                         int a)
Sets the color of the text content.

Parameters:
r - Red
g - Green
b - Blue
a - Alpha

init

public void init(processing.core.PApplet pApplet)
Initializes the text field. Is called by PWidgetContainer as it is added to it.

Overrides:
init in class PWidget

getTextSize

public int getTextSize()
Returns:
The size of the text content.

getTextColor

public int getTextColor()
Returns:
The color of the text content.

afterTextChanged

public void afterTextChanged(android.text.Editable s)
Updating the text variable.

Specified by:
afterTextChanged in interface android.text.TextWatcher

beforeTextChanged

public void beforeTextChanged(java.lang.CharSequence s,
                              int start,
                              int count,
                              int after)
Specified by:
beforeTextChanged in interface android.text.TextWatcher

onTextChanged

public void onTextChanged(java.lang.CharSequence s,
                          int start,
                          int before,
                          int count)
Specified by:
onTextChanged in interface android.text.TextWatcher