Package com.spinyowl.legui.component
Class TextArea
java.lang.Object
com.spinyowl.legui.component.Component
com.spinyowl.legui.component.TextArea
- All Implemented Interfaces:
TextComponent,Viewport,Serializable
Panel with scroll bars. Default container layout is null.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns animation of scrollable panel.intReturns caret position.intReturns end selection index.Returns horizontal scrollbar.intReturns mouse caret position.Returns selected text.intReturns start selection index.intReturns tab size in spaces.Returns current text state.Returns vertical scrollbar.org.joml.Vector2forg.joml.Vector2finthashCode()booleanReturns true if text is editable.voidvoidsetAnimation(Animation animation) Used to set scrollable panel animation.voidsetCaretPosition(int caretPosition) Used to set caret position.voidsetEditable(boolean editable) Used to set editable text or not.voidsetEndSelectionIndex(int endSelectionIndex) Used to set end selection index.voidsetHorizontalScrollBar(ScrollBar horizontalScrollBar) Used to set horizontal scroll bar.voidsetHorizontalScrollBarHeight(float height) voidsetHorizontalScrollBarVisible(boolean enabled) voidsetMouseCaretPosition(int mouseCaretPosition) Used to set mouse caret position.voidsetStartSelectionIndex(int startSelectionIndex) Used to set start selection index.voidsetTabSize(int tabSize) Used to set tab size in spaces.voidsetTextState(TextState textState) Used to set text statevoidsetVerticalScrollBar(ScrollBar verticalScrollBar) Used to set vertical scroll bar.voidsetVerticalScrollBarVisible(boolean enabled) voidsetVerticalScrollBarWidth(float width) toString()Methods inherited from class com.spinyowl.legui.component.Component
add, add, addAll, clearChildComponents, containerIterator, contains, containsAll, count, forEach, getAbsolutePosition, getChildComponents, getFocusedStyle, getFrame, getHoveredStyle, getIntersector, getLayer, getListenerMap, getMetadata, getParent, getPosition, getPressedStyle, getSize, getStyle, getTabIndex, getTooltip, indexOfChild, intersects, isEmpty, isEnabled, isFocusable, isFocused, isHovered, isPressed, isTabFocusable, isVisible, keepRendering, keepRendering, parallelStream, remove, remove, removeAll, removeIf, setEnabled, setFocusable, setFocused, setHovered, setIntersector, setListenerMap, setParent, setPosition, setPosition, setPressed, setSize, setSize, setStyle, setTabFocusable, setTabIndex, setTooltip, stream
-
Constructor Details
-
TextArea
public TextArea()Default constructor. Used to create component instance without any parameters.Also if you want to make it easy to use with Json marshaller/unmarshaller component should contain empty constructor.
-
TextArea
public TextArea(float x, float y, float width, float height) Constructor with position and size parameters.- Parameters:
x- x position position in parent component.y- y position position in parent component.width- width of component.height- height of component.
-
TextArea
public TextArea(org.joml.Vector2f position, org.joml.Vector2f size) Constructor with position and size parameters.- Parameters:
position- position position in parent component.size- size of component.
-
-
Method Details
-
getAnimation
Returns animation of scrollable panel.- Returns:
- animation.
-
setAnimation
Used to set scrollable panel animation. Automatically starts animation.- Parameters:
animation- scroll bar animation to set.
-
getVerticalScrollBar
Returns vertical scrollbar.- Returns:
- vertical scrollbar.
-
setVerticalScrollBar
Used to set vertical scroll bar.- Parameters:
verticalScrollBar- vertical scroll bar to set.
-
getHorizontalScrollBar
Returns horizontal scrollbar.- Returns:
- horizontal scrollbar.
-
setHorizontalScrollBar
Used to set horizontal scroll bar.- Parameters:
horizontalScrollBar- horizontal scroll bar to set.
-
setHorizontalScrollBarVisible
public void setHorizontalScrollBarVisible(boolean enabled) -
setVerticalScrollBarVisible
public void setVerticalScrollBarVisible(boolean enabled) -
setHorizontalScrollBarHeight
public void setHorizontalScrollBarHeight(float height) -
setVerticalScrollBarWidth
public void setVerticalScrollBarWidth(float width) -
getTextAreaField
-
equals
-
toString
-
hashCode
public int hashCode() -
getViewport
-
getViewportSize
public org.joml.Vector2f getViewportSize()- Specified by:
getViewportSizein interfaceViewport
-
getViewportViewSize
public org.joml.Vector2f getViewportViewSize()- Specified by:
getViewportViewSizein interfaceViewport
-
getTextState
Description copied from interface:TextComponentReturns current text state.- Specified by:
getTextStatein interfaceTextComponent- Returns:
- text state of component.
-
setTextState
Description copied from interface:TextComponentUsed to set text state- Specified by:
setTextStatein interfaceTextComponent- Parameters:
textState- new text state to set.
-
getCaretPosition
public int getCaretPosition()Returns caret position.- Returns:
- caret position.
-
setCaretPosition
public void setCaretPosition(int caretPosition) Used to set caret position.- Parameters:
caretPosition- caret position to set.
-
isEditable
public boolean isEditable()Returns true if text is editable.- Returns:
- true if text is editable.
-
setEditable
public void setEditable(boolean editable) Used to set editable text or not.- Parameters:
editable- editable text or not.
-
getMouseCaretPosition
public int getMouseCaretPosition()Returns mouse caret position.- Returns:
- mouse caret position.
-
setMouseCaretPosition
public void setMouseCaretPosition(int mouseCaretPosition) Used to set mouse caret position.- Parameters:
mouseCaretPosition- mouse caret position to set.
-
getStartSelectionIndex
public int getStartSelectionIndex()Returns start selection index.- Returns:
- start selection index.
-
setStartSelectionIndex
public void setStartSelectionIndex(int startSelectionIndex) Used to set start selection index.- Parameters:
startSelectionIndex- start selection index to set.
-
getEndSelectionIndex
public int getEndSelectionIndex()Returns end selection index.- Returns:
- end selection index.
-
setEndSelectionIndex
public void setEndSelectionIndex(int endSelectionIndex) Used to set end selection index.- Parameters:
endSelectionIndex- end selection index to set.
-
getSelection
Returns selected text.- Returns:
- selected text.
-
getTabSize
public int getTabSize()Returns tab size in spaces.- Returns:
- tab size in spaces.
-
setTabSize
public void setTabSize(int tabSize) Used to set tab size in spaces.- Parameters:
tabSize- tab size in spaces.
-
resizeTextAreaField
public void resizeTextAreaField()
-