Skip to content

SliderNode

abstract class SliderNode<V>
Extends: BaseSliderNode<V>
Known subtypes: DoubleSliderNode, IntegerSliderNode, StringSliderNode
Package: dev.joid.lib.ui.node.impl.control.slider · Module: core · Source: SliderNode.java

A slider made of two parts: a track that covers the control and a thumb placed at the value.

A skin extends one of its subclasses and gives its parts in its constructor; the slider places them on every frame. A thumb of size 0 is a square of the height of the slider, and the inset is half the width of the thumb unless the skin gives another one. Attaching a slider without a thumb throws an IllegalStateException.

ReturnsSignatureSummary
SliderNode(double x, double y, double width, double height) protectedCreates the slider at x, y with a width and a height in design pixels, from the constructor of a subclass.

PropertyTypeDefaultSummary
trackNodenullThe node drawn behind the thumb, over the whole slider, with a zindex of -1; optional.
thumbNodenullThe node centered on the place of the value; required.
speed signalfloat1FHow fast the thumb reaches a value set from the code or a signal: the part of the remaining way that it covers in 1/60 s, at any frame rate.
Inherited from BaseSliderNode (1)

inset

Inherited from BaseChoiceNode (3)

values · value · valueIndex

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:

PropertyDefault hereInherited default
insetthis.thumb == null ? 0D : this.thumb.getWidth() / 2D0D in BaseSliderNode

ReturnsSignatureSummary
voidupdate() hookGives a thumb of size 0 the size of a square of the height of the slider.
voidlayout() hookPlaces the track over the slider and moves the thumb toward the place of the value.
voiddetach() hookForgets the place of the thumb, so that the slider shows its value at once when it comes back.
Inherited from BaseSliderNode (2)

getProgress · isSliding

Inherited from BaseChoiceNode (3)

getValueList · change · beforeChange

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 BaseChoiceNode (1)

onChange

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

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

Creates the slider at x, y with a width and a height in design pixels, from the constructor of a subclass.

  • this track(Node track) fluent
  • Node getTrack()

Default: null

The node drawn behind the thumb, over the whole slider, with a zindex of -1; optional.

  • this thumb(Node thumb) fluent
  • Node getThumb()

Default: null

The node centered on the place of the value; required.

  • this speed(float speed) fluent
  • this speed(Supplier<Float> speed) fluent signal
  • float getSpeed()

Default: 1F

How fast the thumb reaches a value set from the code or a signal: the part of the remaining way that it covers in 1/60 s, at any frame rate. 1F moves it at once; during a drag, the thumb follows the pointer at once, up to half a step past the last accepted value.

void update() hook

Gives a thumb of size 0 the size of a square of the height of the slider.

void layout() hook

Places the track over the slider and moves the thumb toward the place of the value.

void detach() hook

Forgets the place of the thumb, so that the slider shows its value at once when it comes back.


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