|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectcontrolP5.Controller
controlP5.Textfield
public class Textfield
description for singleline textfield. create a texfield with
controlP5.addTextfield(theName,theX,theY,theWidth,theHeight);
the Textfield implementation for ControlP5 tries its best to imitate the
usage and behavior of a terminal, the command line.
Field Summary |
---|
Fields inherited from class controlP5.Controller |
---|
MOVE, PRESSED, RELEASE |
Fields inherited from interface controlP5.ControlP5Constants |
---|
acceptClassList, ALT, ARRAY, BACKSPACE, BOOLEAN, CONTROL, DECREASE, DELETE, DOWN, ENTER, ESCAPE, eventMethod, FIELD, FLOAT, HALF_PI, HIDE, INCREASE, INTEGER, INVALID, KEYCONTROL, LEFT, LOAD, MENU, METHOD, PI, PRINT, RESET, RIGHT, SAVE, SHIFT, STRING, SWITCH_BACK, SWITCH_FORE, TAB, TWO_PI, UP, VERBOSE |
Constructor Summary | |
---|---|
Textfield(ControlP5 theControlP5,
ControllerGroup theParent,
java.lang.String theName,
java.lang.String theDefaultValue,
int theX,
int theY,
int theWidth,
int theHeight)
|
Method Summary | |
---|---|
void |
addToXMLElement(ControlP5XMLElement theElement)
|
void |
clear()
clear the current content of the textfield. |
void |
draw(processing.core.PApplet theApplet)
|
java.lang.String |
getText()
get the current text of the textfield. |
java.lang.String[] |
getTextList()
returns a string array that lists all text lines that have been confirmed with a return. |
boolean |
isAutoClear()
returns the current state of the autoClear flag. |
boolean |
isFocus()
check if the textfield is active and in focus. |
void |
keepFocus(boolean theFlag)
use true as parameter to force the textfield to stay in focus. |
void |
keyEvent(java.awt.event.KeyEvent theKeyEvent)
flip throught the texfield history with cursor keys UP and DOWN. |
void |
setAutoClear(boolean theFlag)
use setAutoClear(false) to not clear the content of the textfield after confirming with return. |
void |
setFocus(boolean theFlag)
set the textfield's focus to true or false. |
void |
setPasswordMode(boolean theFlag)
set the mode of the textfield to password mode, each character is shown as a "*" like e.g. |
void |
setText(java.lang.String theValue)
setText does set the text of a textfield, but will not broadcast its value. |
void |
setValue(float theValue)
set the value of the controller. |
void |
setValue(java.lang.String theValue)
set the value of the textfield and will broadcast the new string value immediately. |
void |
submit()
make the controller execute a return event. |
void |
update()
updates the value of the controller without having to set the value explicitly. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Textfield(ControlP5 theControlP5, ControllerGroup theParent, java.lang.String theName, java.lang.String theDefaultValue, int theX, int theY, int theWidth, int theHeight)
theControllerProperties
- ControllerPropertiesMethod Detail |
---|
public void setValue(float theValue)
Controller
setValue
in class Controller
theValue
- floatpublic void setPasswordMode(boolean theFlag)
theFlag
- booleanpublic void setFocus(boolean theFlag)
theFlag
- booleanpublic void keepFocus(boolean theFlag)
theFlag
- public boolean isFocus()
public void setValue(java.lang.String theValue)
theValue
- Stringpublic void setText(java.lang.String theValue)
theValue
- public void update()
Controller
update
in interface ControllerInterface
update
in class Controller
public void draw(processing.core.PApplet theApplet)
draw
in interface CDrawable
draw
in interface ControllerInterface
draw
in class Controller
theApplet
- PAppletpublic void keyEvent(java.awt.event.KeyEvent theKeyEvent)
keyEvent
in interface ControllerInterface
keyEvent
in class Controller
theKeyEvent
- KeyEventpublic java.lang.String getText()
public java.lang.String[] getTextList()
public void clear()
public void setAutoClear(boolean theFlag)
theFlag
- public boolean isAutoClear()
public void submit()
public void addToXMLElement(ControlP5XMLElement theElement)
theElement
- ControlP5XMLElement
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |