Skip to content

BaseSliderNode

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

The behavior of a slider without its look: a choice whose options sit along the width of the node, picked by a press or a drag.

A left press jumps to the step nearest to the pointer, and a drag follows the pointer until the release; each new step goes through change(...), so beforeChange can refuse it. A refused step does not stop the drag: the value keeps the last step that passed. Use IntegerSliderNode, DoubleSliderNode or StringSliderNode for the options, and SliderNode for a look made of a track and a thumb.

ReturnsSignatureSummary
BaseSliderNode(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
inset signaldouble0DThe space, in design pixels, between each end of the node and the first or the last step.
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

ReturnsSignatureSummary
doublegetProgress()Returns the place of the value along the track, from 0D at the first option to 1D at the last.
booleanisSliding()If true, the user drags the slider.
ReturnsSignatureSummary
voidmousePressed(NodeMouseEvent<?> event) hookOn a left press over the slider that no one consumed, starts sliding, picks the step under the pointer and consumes the press.
voidmouseReleased(NodeMouseEvent<?> event) hookPicks the step under the pointer and ends the slide.
voidmouseDragged(NodeMouseEvent<?> event) hookPicks the step under the pointer while the slide goes on.
voiddetach() hookEnds a slide in progress when the slider leaves the tree.
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

BaseSliderNode(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 inset(double inset) fluent
  • this inset(Supplier<Double> inset) fluent signal
  • double getInset()

Default: 0D

The space, in design pixels, between each end of the node and the first or the last step. A press inside that space picks the first or the last step.

double getProgress()

Returns the place of the value along the track, from 0D at the first option to 1D at the last. During a drag, the place of the pointer, so that a thumb follows it between the steps, kept within half a step of the value: past a refused value, the thumb stops half a step after the last accepted one.

boolean isSliding()

If true, the user drags the slider.

void mousePressed(NodeMouseEvent<?> event) hook

On a left press over the slider that no one consumed, starts sliding, picks the step under the pointer and consumes the press.

void mouseReleased(NodeMouseEvent<?> event) hook

Picks the step under the pointer and ends the slide.

void mouseDragged(NodeMouseEvent<?> event) hook

Picks the step under the pointer while the slide goes on.

void detach() hook

Ends a slide in progress when the slider leaves the tree.


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