MultilineTextFieldNode
class MultilineTextFieldNode
Extends: FieldNode<String>
Package: dev.joid.lib.ui.node.impl.control.field · Module: core · Source: MultilineTextFieldNode.java
A field of several lines whose value is its text, wrapped in its width.
Description
Section titled “Description”Enter starts a new line, Up and Down move the cursor between lines, and the wheel scrolls a text taller than the field by one line per notch.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
MultilineTextFieldNode | create(double x, double y, double width, double height) factory | Creates the field at x, y with a width and a height in design pixels. |
| MultilineTextFieldNode(double x, double y, double width, double height) protected | Creates the field, from the constructor of a subclass. |
Properties
Section titled “Properties”Inherited from FieldNode (21)
background · cursorColor · selectionColor · placeholderColor · cursorMargin · cursorPosition · text · placeholder · info · accept · normalize · allowEmpty · maxTextLength · markup · margin · marginTop · marginBottom · marginLeft · marginRight · marginHorizontal · marginVertical
Inherited from Node (24)
x · y · width · height · position · anchor · anchorX · anchorY · aspectRatio · zindex · zlevel · skeleton · visible · enabled · interactive · cursor · hoverDuration · hoverEquation · hover · overflow · scrollSpeed · scrollbar · label · draggable
Redefined defaults:
| Property | Default here | Inherited default |
|---|---|---|
| margin | 2D | not read in FieldNode |
| cursorMargin | super.getInfo() == null ? 0D : this.getLineHeight() * 2D | 0D in FieldNode |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
BoundingBox | getCursorArea() | Returns the area of the cursor on its wrapped line, with the vertical scroll of the text. |
boolean | isMultiline() protected | Returns true: the text keeps its line breaks. |
boolean | handleKey(Key key) protected | Handles Up and Down, which move the cursor to the nearest place on the line above or below, Home and End, which move it to the start or the end of its line, wrapped lines included, and Enter, which inserts a line break. |
int | getPositionAt(double mouseX, double mouseY) protected | Returns the index in the text nearest to the pointer, on the line under it. |
void | followCursorForward() protected | Scrolls the text up when the cursor goes below the visible lines. |
void | followCursorBackward() protected | Scrolls the text down when the cursor goes above the visible lines. |
String | parse(String text) protected | Returns the text itself: every text is a value. |
String | format(String value) protected | Returns the value itself. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
void | mouseScroll(NodeMouseScrollEvent<?> event) hook | Over the field, scrolls the text by one line per notch, and consumes the wheel while it can still scroll in that direction. |
void | drawField() hook protected | Draws the wrapped lines or the placeholder inside the margins, with the cursor while the field has the focus and the selection over each line. |
Inherited from FieldNode (17)
cursorPosition · moveCursor · beforeCursorMove · focused · focus · beforeFocus · isFocused · getValue · isValid · getSelection · selection · change · beforeChange · blur · beforeBlur · select · beforeSelect
Inherited from Node (128)
load · render · renderHover · updateScroll · updateScrollX · updateScrollY · append · attach · body · clearChildren · getChild · getChildren · getNodeListAt · getParent · isAttached · getAbsoluteX · getAbsoluteY · getAbsoluteDefaultX · getAbsoluteDefaultY · toDrawX · toDrawY · w · h · dw · dh · mw · mh · aw · ah · ax · ay · getDefaultWidth · getDefaultHeight · removeHover · clearHover · refreshHover · getResolvedCursor · hoverValue · getHoverAnimator · isHovered · handleMousePressed · handleMouseReleased · handleMouseDragged · handleMouseScroll · handleCharTyped · handleKeyPressed · handleKeyReleased · getLastClickTime · getLastClickButton · getLastKey · getLastKeyTime · scrollX · scrollY · scrollTo · beforeScroll · hasOverflowX · hasOverflowY · getOverflowArea · getScrollX · getScrollY · getTargetScrollX · getTargetScrollY · getMaxScrollX · getMaxScrollY · isScrollEndX · isScrollEndY · startDragging · stopDragging · beforeDragStart · beforeDragDrop · isDragging · getDragX · getDragY · isDragged · getDragSource · getDraggedNode · getStartDragX · getStartDragY · getTargetDragX · getTargetDragY · effect · removeEffect · clearEffects · hasEffect · getEffect · layer · clearLayers · animate · removeAnimator · wait · watch · hasListener · isVisibleProperty · isMounted · getIndex · getUi · getHierarchy · getMappedIndex · getTaskList · getShortcutList · toJson · toString · getEventBus · getBodyConsumer · getDefaultX · getDefaultY · getLayoutX · getLayoutY · getShiftX · getShiftY · isStepping · getLastCodepoint · getLoadCount · getRenderTime · remove · self · copy · useStore · addTask · removeTask · addShortcut · removeShortcut · layoutPosition · layoutSize · fit · move · beforeMove · hoverColor
Events
Section titled “Events”Inherited from Node (21)
onUpdate · onDetach · onInit · onRender · onDraw · onMount · onHoverStart · onHover · onHoverEnd · onScroll · onScrollToEnd · onScrollEndReached · onDragStart · onDrag · onDragDrop · onDragSnap · onMove · onChildAppend · onClick · onAnimate · onWatch
Creation details
Section titled “Creation details”create
Section titled “create”MultilineTextFieldNode create(double x, double y, double width, double height) factory
Creates the field at x, y with a width and a height in design pixels.
MultilineTextFieldNode
Section titled “MultilineTextFieldNode”MultilineTextFieldNode(double x, double y, double width, double height) protected
Creates the field, from the constructor of a subclass.
Method details
Section titled “Method details”getCursorArea
Section titled “getCursorArea”BoundingBox getCursorArea()
Returns the area of the cursor on its wrapped line, with the vertical scroll of the text.
isMultiline
Section titled “isMultiline”boolean isMultiline() protected
Returns true: the text keeps its line breaks.
handleKey
Section titled “handleKey”boolean handleKey(Key key) protected
Handles Up and Down, which move the cursor to the nearest place on the line above or below, Home and End, which move it to the start or the end of its line, wrapped lines included, and Enter, which inserts a line break.
getPositionAt
Section titled “getPositionAt”int getPositionAt(double mouseX, double mouseY) protected
Returns the index in the text nearest to the pointer, on the line under it.
followCursorForward
Section titled “followCursorForward”void followCursorForward() protected
Scrolls the text up when the cursor goes below the visible lines.
followCursorBackward
Section titled “followCursorBackward”void followCursorBackward() protected
Scrolls the text down when the cursor goes above the visible lines.
String parse(String text) protected
Returns the text itself: every text is a value.
format
Section titled “format”String format(String value) protected
Returns the value itself.
mouseScroll
Section titled “mouseScroll”void mouseScroll(NodeMouseScrollEvent<?> event) hook
Over the field, scrolls the text by one line per notch, and consumes the wheel while it can still scroll in that direction.
drawField
Section titled “drawField”void drawField() hook protected
Draws the wrapped lines or the placeholder inside the margins, with the cursor while the field has the focus and the selection over each line.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
