public class TextArea extends AbstractInteractableComponent
Interactable.FocusChangeDirection, Interactable.Result
Component.Alignment
Constructor and Description |
---|
TextArea() |
TextArea(String text) |
TextArea(TerminalSize preferredSize,
String text) |
Modifier and Type | Method and Description |
---|---|
void |
appendLine(String line) |
protected TerminalSize |
calculatePreferredSize() |
void |
clear() |
String |
getLine(int index) |
TerminalSize |
getMaximumSize() |
TerminalSize |
getMinimumSize()
This method is called by the layout system to figure out what the
absolute minimum size is for this component.
|
void |
insertLine(int index,
String line) |
boolean |
isScrollable()
This method is used by the layout system when it needs to shrink components
because the available space is too small.
|
Interactable.Result |
keyboardInteraction(Key key)
This method is called when this component has focus and the user has
pressed a key on the keyboard.
|
protected void |
printItem(TextGraphics graphics,
int x,
int y,
String text) |
void |
removeLine(int lineNumber) |
void |
repaint(TextGraphics graphics)
This is the main 'paint' method for a component, it's called when
lanterna wants the component to re-draw itself.
|
void |
setLine(int index,
String line) |
void |
setMaximumSize(TerminalSize maximumSize) |
void |
setMinimumSize(TerminalSize minimumSize) |
afterEnteredFocus, afterLeftFocus, getHotspot, hasFocus, onEnterFocus, onLeaveFocus, setHotspot
addBorder, addComponentListener, getAlignment, getComponentListeners, getGUIScreen, getParent, getPreferredSize, getWindow, invalidate, isVisible, removeComponentListener, setAlignment, setParent, setPreferredSize, setVisible, transformAccordingToAlignment
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBorder, addComponentListener, getAlignment, getParent, getPreferredSize, getWindow, isVisible, removeComponentListener, setAlignment, setPreferredSize, setVisible
public TextArea()
public TextArea(String text)
public TextArea(TerminalSize preferredSize, String text)
protected TerminalSize calculatePreferredSize()
calculatePreferredSize
in class AbstractComponent
public void repaint(TextGraphics graphics)
Component
graphics
- TextGraphics object to use for drawing the component and
getting information about the drawing contextpublic Interactable.Result keyboardInteraction(Key key)
Interactable
key
- Key pressed on the keyboardpublic boolean isScrollable()
Component
isScrollable
in interface Component
isScrollable
in class AbstractComponent
public void setMaximumSize(TerminalSize maximumSize)
public TerminalSize getMaximumSize()
public void setMinimumSize(TerminalSize minimumSize)
public TerminalSize getMinimumSize()
Component
getMinimumSize
in interface Component
getMinimumSize
in class AbstractComponent
public void clear()
public String getLine(int index)
public void appendLine(String line)
public void insertLine(int index, String line)
public void setLine(int index, String line)
public void removeLine(int lineNumber)
protected void printItem(TextGraphics graphics, int x, int y, String text)
Copyright © 2015. All Rights Reserved.