Class IFTextField
java.lang.Object
interfascia.GUIComponent
interfascia.IFTextField
- Direct Known Subclasses:
IFPasswordField
The IFTextField class is used for a simple one-line text field
-
Constructor Summary
ConstructorsConstructorDescriptionIFTextField(String label, int x, int y) creates an empty IFTextField with the specified label, with specified position, and a default width of 100 pixels.IFTextField(String argLabel, int argX, int argY, int argWidth) creates an empty IFTextField with the specified label and with specified position and width.IFTextField(String argLabel, int argX, int argY, int argWidth, String argContents) creates an IFTextField with the specified label, with specified position and width, and with specified contents. -
Method Summary
Modifier and TypeMethodDescriptionvoidintintintgetValue()returns the string that is displayed in the text area.intintvoidvoidreceives KeyEvents forwarded to it by the GUIController if the current instance is currently in focus.voidimplemented to conform to Processing's mouse event handler requirements.voiddraws the text field, contents, selection, and cursor to the screen.voidsetCursorPosition(int CursorPos) voidsetEndSelect(int EndSelect) voidsetStartSelect(int StartSelect) voidsets the contents of the text box and displays the specified string in the text box widget.voidsetVisiblePortionEnd(int VisiblePortionEnd) voidsetVisiblePortionStart(int VisiblePortionStart) static booleanvalidUnicode(char b) Methods inherited from class interfascia.GUIComponent
addActionListener, canReceiveFocus, draw, fireEventNotification, getAbsoluteX, getAbsoluteY, getController, getHeight, getIndex, getLabel, getLookAndFeel, getWidth, getX, getY, isMouseOver, setController, setHeight, setIndex, setLabel, setLookAndFeel, setPosition, setSize, setWidth, setX, setY, update
-
Constructor Details
-
IFTextField
creates an empty IFTextField with the specified label, with specified position, and a default width of 100 pixels.- Parameters:
label- the text field's labelx- the text field's X location on the screen, relative to the PApplet.y- the text filed's Y location on the screen, relative to the PApplet.
-
IFTextField
creates an empty IFTextField with the specified label and with specified position and width.- Parameters:
argLabel- the text field's labelargX- the text field's X location on the screen, relative to the PApplet.argY- the text filed's Y location on the screen, relative to the PApplet.argWidth- the text field's width
-
IFTextField
creates an IFTextField with the specified label, with specified position and width, and with specified contents.- Parameters:
argLabel- the text field's labelargX- the text field's X location on the screen, relative to the PApplet.argY- the text filed's Y location on the screen, relative to the PApplet.argWidth- the text field's widthargContents- the default contents of the text field
-
-
Method Details
-
validUnicode
public static boolean validUnicode(char b) -
initWithParent
public void initWithParent()- Overrides:
initWithParentin classGUIComponent
-
getVisiblePortionStart
public int getVisiblePortionStart() -
setVisiblePortionStart
public void setVisiblePortionStart(int VisiblePortionStart) -
getVisiblePortionEnd
public int getVisiblePortionEnd() -
setVisiblePortionEnd
public void setVisiblePortionEnd(int VisiblePortionEnd) -
getStartSelect
public int getStartSelect() -
setStartSelect
public void setStartSelect(int StartSelect) -
getEndSelect
public int getEndSelect() -
setEndSelect
public void setEndSelect(int EndSelect) -
getCursorPosition
public int getCursorPosition() -
setCursorPosition
public void setCursorPosition(int CursorPos) -
setValue
sets the contents of the text box and displays the specified string in the text box widget.- Parameters:
val- the string to become the text field's contents
-
getValue
returns the string that is displayed in the text area. If the contents have not been initialized, getValue() returns NULL, if the contents have been initialized but not set, it returns an empty string.- Returns:
- contents the contents of the text field
-
mouseEvent
implemented to conform to Processing's mouse event handler requirements. You shouldn't call this method directly, as Processing will forward mouse events to this object directly. mouseEvent() handles mouse clicks, drags, and releases sent from the parent PApplet.- Overrides:
mouseEventin classGUIComponent- Parameters:
e- the MouseEvent to handle
-
keyEvent
receives KeyEvents forwarded to it by the GUIController if the current instance is currently in focus.- Overrides:
keyEventin classGUIComponent- Parameters:
e- the KeyEvent to be handled
-
render
draws the text field, contents, selection, and cursor to the screen.- Overrides:
renderin classGUIComponent
-
actionPerformed
- Overrides:
actionPerformedin classGUIComponent
-