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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| 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. |
Properties
Section titled “Properties”| Property | Type | Default | Summary |
|---|---|---|---|
| inset signal | double | 0D | The 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
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
double | getProgress() | Returns the place of the value along the track, from 0D at the first option to 1D at the last. |
boolean | isSliding() | If true, the user drags the slider. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
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. |
Inherited from BaseChoiceNode (3)
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 BaseChoiceNode (1)
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”BaseSliderNode
Section titled “BaseSliderNode”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.
Property details
Section titled “Property details”this inset(double inset)fluentthis inset(Supplier<Double> inset)fluent signaldouble 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.
Method details
Section titled “Method details”getProgress
Section titled “getProgress”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.
isSliding
Section titled “isSliding”boolean isSliding()
If true, the user drags the slider.
mousePressed
Section titled “mousePressed”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.
mouseReleased
Section titled “mouseReleased”void mouseReleased(NodeMouseEvent<?> event) hook
Picks the step under the pointer and ends the slide.
mouseDragged
Section titled “mouseDragged”void mouseDragged(NodeMouseEvent<?> event) hook
Picks the step under the pointer while the slide goes on.
detach
Section titled “detach”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
