Skip to content

IntegerFieldNode

class IntegerFieldNode
Extends: LineFieldNode<Integer>
Package: dev.joid.lib.ui.node.impl.control.field · Module: core · Source: IntegerFieldNode.java

A one-line field that holds an Integer between a minimum and a maximum, stepped by Up, Down and the wheel.

The user types digits, and a minus sign when min is below 0. A typed value out of the range shows as its bound when the field loses the focus. An empty field that the user leaves takes back its last value, 0 before any; with allowEmpty(true), it holds null.

ReturnsSignatureSummary
IntegerFieldNodecreate(double x, double y, double width) factoryCreates the field at x, y with a width in design pixels; its height is the height of its font plus its top and bottom margins.
IntegerFieldNodecreate(double x, double y, double width, double height) factoryCreates the field at x, y with a width and a height in design pixels.
IntegerFieldNode(double x, double y, double width, double height) protectedCreates the field, from the constructor of a subclass.

PropertyTypeDefaultSummary
min signalintno lower bound (Integer.MIN_VALUE)The smallest value; a typed value below it shows as min when the field loses the focus.
max signalint2147483647The largest value; a typed value above it shows as max when the field loses the focus.
step signalint1The amount that Up, Down and the wheel add or remove.
Inherited from LineFieldNode (3)

align · alignX · alignY

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

ReturnsSignatureSummary
Integerparse(String text) protectedReads an optional minus sign and digits; a number beyond the range of int gives Integer.MAX_VALUE or Integer.MIN_VALUE, any other text null.
Stringformat(Integer value) protectedWrites the value in decimal digits.
Integercorrect(Integer value) protectedBrings the value between min and max.
Integerincrement(Integer value, int count) protectedReturns the value count steps away, kept between min and max.
thisvalue(int value) fluentGives the field its start value, brought into the range.
thisvalue(Signal value) fluentBinds the value to a signal both ways: the field shows the signal, and writes the value of each valid edit into it.
thischange(int value) fluentSets the value as if the user typed it: beforeChange can refuse it, then onChange fires.
ReturnsSignatureSummary
booleanaccepts(String text) hook protectedAccepts digits only, with a leading minus sign when min is below 0.
Inherited from LineFieldNode (1)

getCursorArea

Inherited from FieldNode (16)

cursorPosition · moveCursor · beforeCursorMove · focused · focus · beforeFocus · isFocused · getValue · isValid · getSelection · selection · 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

Inherited from LineFieldNode (1)

onSubmit

Inherited from FieldNode (5)

onChange · onFocus · onBlur · onCursorMove · onSelect

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

IntegerFieldNode create(double x, double y, double width) factory

Creates the field at x, y with a width in design pixels; its height is the height of its font plus its top and bottom margins.

IntegerFieldNode 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.

IntegerFieldNode(double x, double y, double width, double height) protected

Creates the field, from the constructor of a subclass.

  • this min(int min) fluent
  • this min(Supplier<Integer> min) fluent signal
  • int getMin()

Default: no lower bound (Integer.MIN_VALUE)

The smallest value; a typed value below it shows as min when the field loses the focus.

  • this max(int max) fluent
  • this max(Supplier<Integer> max) fluent signal
  • int getMax()

Default: 2147483647

The largest value; a typed value above it shows as max when the field loses the focus.

  • this step(int step) fluent
  • this step(Supplier<Integer> step) fluent signal
  • int getStep()

Default: 1

Throws:

  • IllegalArgumentException: The step … of the IntegerFieldNode must be positive, pass a step of 1 or more

The amount that Up, Down and the wheel add or remove. A step of 0 or less throws an IllegalArgumentException.

Integer parse(String text) protected

Reads an optional minus sign and digits; a number beyond the range of int gives Integer.MAX_VALUE or Integer.MIN_VALUE, any other text null.

String format(Integer value) protected

Writes the value in decimal digits.

Integer correct(Integer value) protected

Brings the value between min and max.

Integer increment(Integer value, int count) protected

Returns the value count steps away, kept between min and max.

this value(int value) fluent

Gives the field its start value, brought into the range.

this value(Signal<Integer> value) fluent

Binds the value to a signal both ways: the field shows the signal, and writes the value of each valid edit into it. Throws an IllegalArgumentException for a signal that cannot be written.

this change(int value) fluent

Sets the value as if the user typed it: beforeChange can refuse it, then onChange fires.

boolean accepts(String text) hook protected

Accepts digits only, with a leading minus sign when min is below 0.


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

Report a problem with this page