public class TextArea extends Component implements TextComponent
Modifier and Type | Field and Description |
---|---|
protected TextState |
textState
Used to hold text state of text area.
|
Constructor and Description |
---|
TextArea()
Default constructor.
|
TextArea(float x,
float y,
float width,
float height)
Constructor with position and size parameters.
|
TextArea(java.lang.String text)
Default constructor with text.
|
TextArea(java.lang.String text,
float x,
float y,
float width,
float height)
Constructor with text, position and size parameters.
|
TextArea(java.lang.String text,
org.joml.Vector2f position,
org.joml.Vector2f size)
Constructor with text, position and size parameters.
|
TextArea(org.joml.Vector2f position,
org.joml.Vector2f size)
Constructor with position and size parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
getCaretPosition()
Returns caret position.
|
int |
getEndSelectionIndex()
Returns end selection index.
|
int |
getMouseCaretPosition()
Returns mouse caret position.
|
java.lang.String |
getSelection()
Returns selected text.
|
int |
getStartSelectionIndex()
Returns start selection index.
|
TextState |
getTextState()
Returns current text state.
|
int |
hashCode() |
boolean |
isEditable()
Returns true if text is editable.
|
void |
setCaretPosition(int caretPosition)
Used to set caret position.
|
void |
setEditable(boolean editable)
Used to set editable text or not.
|
void |
setEndSelectionIndex(int endSelectionIndex)
Used to set end selection index.
|
void |
setMouseCaretPosition(int mouseCaretPosition)
Used to set mouse caret position.
|
void |
setStartSelectionIndex(int startSelectionIndex)
Used to set start selection index.
|
java.lang.String |
toString() |
add, addAll, clearChilds, containerIterator, contains, containsAll, count, forEach, getAbsolutePosition, getBackgroundColor, getBorder, getChilds, getCornerRadius, getFocusedStrokeColor, getIntersector, getListenerMap, getMetadata, getParent, getPosition, getSize, getTooltip, intersects, isEmpty, isEnabled, isFocused, isHovered, isPressed, isVisible, parallelStream, remove, removeAll, removeIf, setBackgroundColor, setBackgroundColor, setBorder, setCornerRadius, setEnabled, setFocused, setFocusedStrokeColor, setFocusedStrokeColor, setHovered, setIntersector, setListenerMap, setParent, setPosition, setPosition, setPressed, setSize, setSize, setTooltip, setVisible, stream
protected TextState textState
public TextArea()
Also if you want to make it easy to use with Json marshaller/unmarshaller component should contain empty constructor.
public TextArea(float x, float y, float width, float height)
x
- x position position in parent component.y
- y position position in parent component.width
- width of component.height
- height of component.public TextArea(org.joml.Vector2f position, org.joml.Vector2f size)
position
- position position in parent component.size
- size of component.public TextArea(java.lang.String text)
Also if you want to make it easy to use with Json marshaller/unmarshaller component should contain empty constructor.
text
- text to set.public TextArea(java.lang.String text, float x, float y, float width, float height)
text
- text to set.x
- x position position in parent component.y
- y position position in parent component.width
- width of component.height
- height of component.public TextArea(java.lang.String text, org.joml.Vector2f position, org.joml.Vector2f size)
text
- text to set.position
- position position in parent component.size
- size of component.public TextState getTextState()
getTextState
in interface TextComponent
public int getCaretPosition()
public void setCaretPosition(int caretPosition)
caretPosition
- caret position to set.public boolean isEditable()
public void setEditable(boolean editable)
editable
- editable text or not.public int getMouseCaretPosition()
public void setMouseCaretPosition(int mouseCaretPosition)
mouseCaretPosition
- mouse caret position to set.public int getStartSelectionIndex()
public void setStartSelectionIndex(int startSelectionIndex)
startSelectionIndex
- start selection index to set.public int getEndSelectionIndex()
public void setEndSelectionIndex(int endSelectionIndex)
endSelectionIndex
- end selection index to set.public java.lang.String getSelection()