public class TextFieldComponent extends ImageComponent
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DOUBLE_FORMAT |
static java.lang.String |
INTEGER_FORMAT |
BACKGROUND_DISABLED_INDEX, BACKGROUND_HOVER_INDEX, BACKGROUND_INDEX, BACKGROUND_PRESSED_INDEXICON_FONT| Constructor and Description |
|---|
TextFieldComponent(double x,
double y,
double width,
double height,
java.lang.String text) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFormat() |
int |
getMaxLength() |
java.lang.String |
getText()
Gets the entire Text associated with this GuiComponent.
|
void |
handleTypedKey(java.awt.event.KeyEvent event) |
void |
onChangeConfirmed(java.util.function.Consumer<java.lang.String> cons) |
void |
render(java.awt.Graphics2D g)
Renders the visual contents of this instance onto the provided graphics context.
|
void |
setFormat(java.lang.String format) |
void |
setMaxLength(int maxLength) |
void |
setText(java.lang.String text)
Sets the text.
|
getBackground, getImage, getImageAlign, getImageScaleMode, getImageValign, getSpritesheet, setImage, setImageAlign, setImageScaleMode, setImageValign, setSpriteSheetdrawTextShadow, getAppearance, getAppearanceDisabled, getAppearanceHovered, getBoundingBox, getClickConsumer, getComponentId, getComponents, getCurrentAppearance, getFont, getHeight, getHorizontalTextMargin, getHoverConsumer, getHoverSound, getLocation, getMouseDraggedConsumer, getMouseEnterConsumer, getMouseLeaveConsumer, getMouseMovedConsumer, getMousePressedConsumer, getMouseReleasedConsumer, getMouseWheelConsumer, getName, getShape, getTag, getTextAlign, getTextAngle, getTextShadowColor, getTextToRender, getTextX, getTextY, getWidth, getX, getY, initializeComponents, isEnabled, isForwardMouseEvents, isHovered, isPressed, isSelected, isSuspended, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseEventShouldBeForwarded, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, onClicked, onHovered, onMouseDragged, onMouseEnter, onMouseLeave, onMouseMoved, onMousePressed, onMouseReleased, onMouseWheelScrolled, onTextChanged, prepare, setDimension, setEnabled, setFont, setFontSize, setForwardMouseEvents, setHeight, setHorizontalTextMargin, setHovered, setHoverSound, setLocation, setLocation, setName, setSelected, setTag, setTextAlign, setTextAngle, setTextShadow, setTextShadowColor, setTextX, setTextY, setVisible, setWidth, setX, setY, suspend, toggleSelectionpublic static final java.lang.String DOUBLE_FORMAT
public static final java.lang.String INTEGER_FORMAT
public TextFieldComponent(double x,
double y,
double width,
double height,
java.lang.String text)
public java.lang.String getFormat()
public int getMaxLength()
public java.lang.String getText()
GuiComponentGuiComponent.getTextToRender(Graphics2D g).getText in class GuiComponentpublic void handleTypedKey(java.awt.event.KeyEvent event)
public void onChangeConfirmed(java.util.function.Consumer<java.lang.String> cons)
public void render(java.awt.Graphics2D g)
IRenderable
If an Entity implements this interface, this method will be called right after the entity was rendered from the environment.
Allowing for a custom rendering mechanism.
This interface can be implemented in general by anything that should be rendered to the game's screen.
render in interface IRenderablerender in class ImageComponentg - The current graphics object onto which this instance will render its visual contents.RenderEngine.renderEntity(Graphics2D, de.gurkenlabs.litiengine.entities.IEntity)public void setFormat(java.lang.String format)
public void setMaxLength(int maxLength)
public void setText(java.lang.String text)
GuiComponentsetText in class GuiComponenttext - the new text