APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javafx.scene.input

public final Class ScrollEvent

extends GestureEvent
Class Inheritance
Imports
javafx.beans.NamedArg, javafx.event.EventTarget, .EventType

Scroll event indicates that user performed scrolling by mouse wheel, track pad, touch screen or other similar device.

When the scrolling is produced by a touch gesture (such as dragging a finger over a touch screen), it is surrounded by the SCROLL_STARTED and SCROLL_FINISHED events. Changing number of involved touch points during the scrolling is considered a new gesture, so the pair of SCROLL_FINISHED and SCROLL_STARTED notifications is delivered each time the touchCount changes. When the scrolling is caused by a mouse wheel rotation, only a one-time SCROLL event is delivered, without the started/finished surroundings. If scrolling inertia is active on the given platform, some SCROLL events with isInertia() returning true can come after SCROLL_FINISHED.

The event is delivered to the top-most node picked on the gesture coordinates in time of the gesture start - the whole gesture is delivered to the same node even if the coordinates change during the gesture. For mouse wheel rotation the event is delivered to the top-most node picked on mouse cursor location. The delivery is independent of current focus owner.

The event provides two different types of scrolling values: pixel-based and character/line-based. The basic deltaX and deltaY values give reasonable results when used as number of pixels to scroll (The totalDeltaX and totalDeltaY contain the cumulative values for the whole gesture, zeros for mouse wheel). For scrolling text (or other line-based content as tables) the textDelta values should be used if they are available. The textDeltaXUnits and textDeltaYUnits determine how to interpret the textDeltaX and textDeltaY values. If the units are set to NONE, the text-based values are not available (not provided by the underlying platform) and the pixel-based values need to be used.

As all gestures, scrolling can be direct (performed directly at the concrete coordinates as on touch screen - the center point among all the touches is usually used as the gesture coordinates) or indirect (performed indirectly as on track pad or with mouse - the mouse cursor location is usually used as the gesture coordinates).

For example, scrolling a graphical node can be achieved by following code:


    node.setOnScroll(new EventHandler<ScrollEvent>() {
        @Override public void handle(ScrollEvent event) {
            node.setTranslateX(node.getTranslateX() + event.getDeltaX());
            node.setTranslateY(node.getTranslateY() + event.getDeltaY());
        }
    });

A scroll event handler on text-based component behaving according to system settings on all platforms should contain following logic:

switch(event.getTextDeltaYUnits()) {
        case LINES:
            // scroll about event.getTextDeltaY() lines
            break;
        case PAGES:
            // scroll about event.getTextDeltaY() pages
            break;
        case NONE:
            // scroll about event.getDeltaY() pixels
            break;
    }
 
Since
JavaFX 2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
ScrollEvent.HorizontalTextScrollUnits

Horizontal text-based scrolling units.

public static enum
ScrollEvent.VerticalTextScrollUnits

Vertical text-based scrolling units.

Field Summary

Modifier and TypeField and Description
public static final EventType<ScrollEvent>
ANY

Hides javafx.scene.input.GestureEvent.ANY.

Common supertype for all scroll event types.
private final double
private final double
private final double
private final double
public static final EventType<ScrollEvent>
SCROLL

This event occurs when user performs a scrolling action such as rotating mouse wheel or dragging a finger over touch screen.

public static final EventType<ScrollEvent>
SCROLL_FINISHED

This event occurs when a scrolling gesture ends.

public static final EventType<ScrollEvent>
SCROLL_STARTED

This event occurs when a scrolling gesture is detected.

private static final long
private final double
private final ScrollEvent.HorizontalTextScrollUnits
private final double
private final ScrollEvent.VerticalTextScrollUnits
private double
private final double
private final int

Constructor Summary

AccessConstructor and Description
private
ScrollEvent(Object source, EventTarget target, final EventType<ScrollEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, double deltaX, double deltaY, double totalDeltaX, double totalDeltaY, double multiplierX, double multiplierY, ScrollEvent.HorizontalTextScrollUnits textDeltaXUnits, double textDeltaX, ScrollEvent.VerticalTextScrollUnits textDeltaYUnits, double textDeltaY, int touchCount, PickResult pickResult)

public
ScrollEvent(Object
the source of the event. Can be null.
source
,
EventTarget
the target of the event. Can be null.
target
,
final EventType<ScrollEvent>
The type of the event.
eventType
,
double
The x with respect to the scene.
x
,
double
The y with respect to the scene.
y
,
double
The x coordinate relative to screen.
screenX
,
double
The y coordinate relative to screen.
screenY
,
boolean
true if shift modifier was pressed.
shiftDown
,
boolean
true if control modifier was pressed.
controlDown
,
boolean
true if alt modifier was pressed.
altDown
,
boolean
true if meta modifier was pressed.
metaDown
,
boolean
true if the event was caused by direct input device. See isDirect()
direct
,
boolean
if represents inertia of an already finished gesture.
inertia
,
double
horizontal scroll amount
deltaX
,
double
vertical scroll amount
deltaY
,
double
cumulative horizontal scroll amount
totalDeltaX
,
double
cumulative vertical scroll amount
totalDeltaY
,
ScrollEvent.HorizontalTextScrollUnits
units for horizontal text-based scroll amount
textDeltaXUnits
,
double
horizontal text-based scroll amount
textDeltaX
,
ScrollEvent.VerticalTextScrollUnits
units for vertical text-based scroll amount
textDeltaYUnits
,
double
vertical text-based scroll amount
textDeltaY
,
int
number of touch points
touchCount
,
PickResult
pick result. Can be null, in this case a 2D pick result without any further values is constructed based on the scene coordinates and the target
pickResult
)

Constructs new ScrollEvent event.

public
ScrollEvent(final EventType<ScrollEvent>
The type of the event.
eventType
,
double
The x with respect to the scene.
x
,
double
The y with respect to the scene.
y
,
double
The x coordinate relative to screen.
screenX
,
double
The y coordinate relative to screen.
screenY
,
boolean
true if shift modifier was pressed.
shiftDown
,
boolean
true if control modifier was pressed.
controlDown
,
boolean
true if alt modifier was pressed.
altDown
,
boolean
true if meta modifier was pressed.
metaDown
,
boolean
true if the event was caused by direct input device. See isDirect()
direct
,
boolean
if represents inertia of an already finished gesture.
inertia
,
double
horizontal scroll amount
deltaX
,
double
vertical scroll amount
deltaY
,
double
cumulative horizontal scroll amount
totalDeltaX
,
double
cumulative vertical scroll amount
totalDeltaY
,
ScrollEvent.HorizontalTextScrollUnits
units for horizontal text-based scroll amount
textDeltaXUnits
,
double
horizontal text-based scroll amount
textDeltaX
,
ScrollEvent.VerticalTextScrollUnits
units for vertical text-based scroll amount
textDeltaYUnits
,
double
vertical text-based scroll amount
textDeltaY
,
int
number of touch points
touchCount
,
PickResult
pick result. Can be null, in this case a 2D pick result without any further values is constructed based on the scene coordinates
pickResult
)

Constructs new ScrollEvent event with null source and target

public
ScrollEvent(final EventType<ScrollEvent>
The type of the event.
eventType
,
double
The x with respect to the scene.
x
,
double
The y with respect to the scene.
y
,
double
The x coordinate relative to screen.
screenX
,
double
The y coordinate relative to screen.
screenY
,
boolean
true if shift modifier was pressed.
shiftDown
,
boolean
true if control modifier was pressed.
controlDown
,
boolean
true if alt modifier was pressed.
altDown
,
boolean
true if meta modifier was pressed.
metaDown
,
boolean
true if the event was caused by direct input device. See isDirect()
direct
,
boolean
if represents inertia of an already finished gesture.
inertia
,
double
horizontal scroll amount
deltaX
,
double
vertical scroll amount
deltaY
,
double
cumulative horizontal scroll amount
totalDeltaX
,
double
cumulative vertical scroll amount
totalDeltaY
,
double
an X multiplier used to convert wheel rotations to pixels
multiplierX
,
double
an Y multiplier used to convert wheel rotations to pixels
multiplierY
,
ScrollEvent.HorizontalTextScrollUnits
units for horizontal text-based scroll amount
textDeltaXUnits
,
double
horizontal text-based scroll amount
textDeltaX
,
ScrollEvent.VerticalTextScrollUnits
units for vertical text-based scroll amount
textDeltaYUnits
,
double
vertical text-based scroll amount
textDeltaY
,
int
number of touch points
touchCount
,
PickResult
pick result. Can be null, in this case a 2D pick result without any further values is constructed based on the scene coordinates
pickResult
)

Constructs new ScrollEvent event with null source and target

Method Summary

Modifier and TypeMethod and Description
public ScrollEvent
copyFor(Object newSource, EventTarget newTarget)

Overrides javafx.scene.input.GestureEvent.copyFor.

Creates and returns a copy of this event with the specified event source and target.

public ScrollEvent

Returns:

the event copy with the fields substituted
copyFor
(Object
the new source of the copied event
newSource
,
EventTarget
the new target of the copied event
newTarget
,
EventType<ScrollEvent>
the new eventType
type
)

Creates a copy of the given event with the given fields substituted.

public double

Returns:

Number of pixels to scroll horizontally
getDeltaX
()

Gets the horizontal scroll amount.

public double

Returns:

Number of pixels to scroll vertically
getDeltaY
()

Gets the vertical scroll amount.

public EventType<ScrollEvent>
getEventType()

Overrides javafx.scene.input.GestureEvent.getEventType.

Gets the event type of this event.

public double

Returns:

the x multiplier
getMultiplierX
()

Gets the multiplier used to convert mouse wheel rotation units to pixels

public double

Returns:

the y multiplier
getMultiplierY
()

Gets the multiplier used to convert mouse wheel rotation units to pixels

public double

Returns:

Number of units to scroll horizontally, zero if the text-based horizontal scrolling data is not available getTextDeltaXUnits() returns NONE
getTextDeltaX
()

Gets the horizontal text-based scroll amount.

public ScrollEvent.HorizontalTextScrollUnits

Returns:

the horizontal scrolling units for text-based scrolling
getTextDeltaXUnits
()

Gets the horizontal scrolling units for text-based scrolling.

public double

Returns:

Number of units to scroll vertically, zero if the text-based vertical scrolling data is not available getTextDeltaYUnits() returns NONE
getTextDeltaY
()

Gets the vertical text-based scroll amount.

public ScrollEvent.VerticalTextScrollUnits

Returns:

the vertical scrolling units for text-based scrolling
getTextDeltaYUnits
()

Gets the vertical scrolling units for text-based scrolling.

public double

Returns:

Number of pixels scrolled horizontally during the gesture
getTotalDeltaX
()

Gets the cumulative horizontal scroll amount for the whole gesture.

public double

Returns:

Number of pixels to scrolled vertically during the gesture
getTotalDeltaY
()

Gets the cumulative vertical scroll amount for the whole gesture.

public int

Returns:

Number of touch points that caused this event
getTouchCount
()

Gets number of touch points that caused this event.

public String

Returns:

a string representation of this ScrollEvent object.
toString
()

Overrides javafx.scene.input.GestureEvent.toString.

Returns a string representation of this ScrollEvent object.

Inherited from javafx.scene.input.GestureEvent:
getPickResultgetSceneXgetSceneYgetScreenXgetScreenYgetXgetYgetZisAltDownisControlDownisDirectisInertiaisMetaDownisShiftDownisShortcutDown

Field Detail

ANYback to summary
public static final EventType<ScrollEvent> ANY

Hides javafx.scene.input.GestureEvent.ANY.

Common supertype for all scroll event types.

deltaXback to summary
private final double deltaX
Annotations
@SuppressWarnings:doclint:missing
deltaYback to summary
private final double deltaY
Annotations
@SuppressWarnings:doclint:missing
multiplierXback to summary
private final double multiplierX
Annotations
@SuppressWarnings:doclint:missing
multiplierYback to summary
private final double multiplierY
Annotations
@SuppressWarnings:doclint:missing
SCROLLback to summary
public static final EventType<ScrollEvent> SCROLL

This event occurs when user performs a scrolling action such as rotating mouse wheel or dragging a finger over touch screen.

SCROLL_FINISHEDback to summary
public static final EventType<ScrollEvent> SCROLL_FINISHED

This event occurs when a scrolling gesture ends. It doesn't occur for mouse wheel scrolling.

Since
JavaFX 2.2
SCROLL_STARTEDback to summary
public static final EventType<ScrollEvent> SCROLL_STARTED

This event occurs when a scrolling gesture is detected. It doesn't occur for mouse wheel scrolling.

Since
JavaFX 2.2
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javafx.scene.input.GestureEvent.serialVersionUID.

textDeltaXback to summary
private final double textDeltaX
Annotations
@SuppressWarnings:doclint:missing
textDeltaXUnitsback to summary
private final ScrollEvent.HorizontalTextScrollUnits textDeltaXUnits
Annotations
@SuppressWarnings:doclint:missing
textDeltaYback to summary
private final double textDeltaY
Annotations
@SuppressWarnings:doclint:missing
textDeltaYUnitsback to summary
private final ScrollEvent.VerticalTextScrollUnits textDeltaYUnits
Annotations
@SuppressWarnings:doclint:missing
totalDeltaXback to summary
private double totalDeltaX
Annotations
@SuppressWarnings:doclint:missing
totalDeltaYback to summary
private final double totalDeltaY
Annotations
@SuppressWarnings:doclint:missing
touchCountback to summary
private final int touchCount
Annotations
@SuppressWarnings:doclint:missing

Constructor Detail

ScrollEventback to summary
private ScrollEvent(Object source, EventTarget target, final EventType<ScrollEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, double deltaX, double deltaY, double totalDeltaX, double totalDeltaY, double multiplierX, double multiplierY, ScrollEvent.HorizontalTextScrollUnits textDeltaXUnits, double textDeltaX, ScrollEvent.VerticalTextScrollUnits textDeltaYUnits, double textDeltaY, int touchCount, PickResult pickResult)
ScrollEventback to summary
public ScrollEvent(Object source, EventTarget target, final EventType<ScrollEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, double deltaX, double deltaY, double totalDeltaX, double totalDeltaY, ScrollEvent.HorizontalTextScrollUnits textDeltaXUnits, double textDeltaX, ScrollEvent.VerticalTextScrollUnits textDeltaYUnits, double textDeltaY, int touchCount, PickResult pickResult)

Constructs new ScrollEvent event.

Parameters
source:Object

the source of the event. Can be null.

target:EventTarget

the target of the event. Can be null.

eventType:EventType<ScrollEvent>

The type of the event.

x:double

The x with respect to the scene.

y:double

The y with respect to the scene.

screenX:double

The x coordinate relative to screen.

screenY:double

The y coordinate relative to screen.

shiftDown:boolean

true if shift modifier was pressed.

controlDown:boolean

true if control modifier was pressed.

altDown:boolean

true if alt modifier was pressed.

metaDown:boolean

true if meta modifier was pressed.

direct:boolean

true if the event was caused by direct input device. See isDirect()

inertia:boolean

if represents inertia of an already finished gesture.

deltaX:double

horizontal scroll amount

deltaY:double

vertical scroll amount

totalDeltaX:double

cumulative horizontal scroll amount

totalDeltaY:double

cumulative vertical scroll amount

textDeltaXUnits:ScrollEvent.HorizontalTextScrollUnits

units for horizontal text-based scroll amount

textDeltaX:double

horizontal text-based scroll amount

textDeltaYUnits:ScrollEvent.VerticalTextScrollUnits

units for vertical text-based scroll amount

textDeltaY:double

vertical text-based scroll amount

touchCount:int

number of touch points

pickResult:PickResult

pick result. Can be null, in this case a 2D pick result without any further values is constructed based on the scene coordinates and the target

Since
JavaFX 8.0
ScrollEventback to summary
public ScrollEvent(final EventType<ScrollEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, double deltaX, double deltaY, double totalDeltaX, double totalDeltaY, ScrollEvent.HorizontalTextScrollUnits textDeltaXUnits, double textDeltaX, ScrollEvent.VerticalTextScrollUnits textDeltaYUnits, double textDeltaY, int touchCount, PickResult pickResult)

Constructs new ScrollEvent event with null source and target

Parameters
eventType:EventType<ScrollEvent>

The type of the event.

x:double

The x with respect to the scene.

y:double

The y with respect to the scene.

screenX:double

The x coordinate relative to screen.

screenY:double

The y coordinate relative to screen.

shiftDown:boolean

true if shift modifier was pressed.

controlDown:boolean

true if control modifier was pressed.

altDown:boolean

true if alt modifier was pressed.

metaDown:boolean

true if meta modifier was pressed.

direct:boolean

true if the event was caused by direct input device. See isDirect()

inertia:boolean

if represents inertia of an already finished gesture.

deltaX:double

horizontal scroll amount

deltaY:double

vertical scroll amount

totalDeltaX:double

cumulative horizontal scroll amount

totalDeltaY:double

cumulative vertical scroll amount

textDeltaXUnits:ScrollEvent.HorizontalTextScrollUnits

units for horizontal text-based scroll amount

textDeltaX:double

horizontal text-based scroll amount

textDeltaYUnits:ScrollEvent.VerticalTextScrollUnits

units for vertical text-based scroll amount

textDeltaY:double

vertical text-based scroll amount

touchCount:int

number of touch points

pickResult:PickResult

pick result. Can be null, in this case a 2D pick result without any further values is constructed based on the scene coordinates

Since
JavaFX 8.0
ScrollEventback to summary
public ScrollEvent(final EventType<ScrollEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, double deltaX, double deltaY, double totalDeltaX, double totalDeltaY, double multiplierX, double multiplierY, ScrollEvent.HorizontalTextScrollUnits textDeltaXUnits, double textDeltaX, ScrollEvent.VerticalTextScrollUnits textDeltaYUnits, double textDeltaY, int touchCount, PickResult pickResult)

Constructs new ScrollEvent event with null source and target

Parameters
eventType:EventType<ScrollEvent>

The type of the event.

x:double

The x with respect to the scene.

y:double

The y with respect to the scene.

screenX:double

The x coordinate relative to screen.

screenY:double

The y coordinate relative to screen.

shiftDown:boolean

true if shift modifier was pressed.

controlDown:boolean

true if control modifier was pressed.

altDown:boolean

true if alt modifier was pressed.

metaDown:boolean

true if meta modifier was pressed.

direct:boolean

true if the event was caused by direct input device. See isDirect()

inertia:boolean

if represents inertia of an already finished gesture.

deltaX:double

horizontal scroll amount

deltaY:double

vertical scroll amount

totalDeltaX:double

cumulative horizontal scroll amount

totalDeltaY:double

cumulative vertical scroll amount

multiplierX:double

an X multiplier used to convert wheel rotations to pixels

multiplierY:double

an Y multiplier used to convert wheel rotations to pixels

textDeltaXUnits:ScrollEvent.HorizontalTextScrollUnits

units for horizontal text-based scroll amount

textDeltaX:double

horizontal text-based scroll amount

textDeltaYUnits:ScrollEvent.VerticalTextScrollUnits

units for vertical text-based scroll amount

textDeltaY:double

vertical text-based scroll amount

touchCount:int

number of touch points

pickResult:PickResult

pick result. Can be null, in this case a 2D pick result without any further values is constructed based on the scene coordinates

Since
JavaFX 8.0

Method Detail

copyForback to summary
public ScrollEvent copyFor(Object newSource, EventTarget newTarget)

Overrides javafx.scene.input.GestureEvent.copyFor.

Doc from javafx.scene.input.GestureEvent.copyFor.

Creates and returns a copy of this event with the specified event source and target. If the source or target is set to null, it is replaced by the NULL_SOURCE_TARGET value.

Annotations
@Override
copyForback to summary
public ScrollEvent copyFor(Object newSource, EventTarget newTarget, EventType<ScrollEvent> type)

Creates a copy of the given event with the given fields substituted.

Parameters
newSource:Object

the new source of the copied event

newTarget:EventTarget

the new target of the copied event

type:EventType<ScrollEvent>

the new eventType

Returns:ScrollEvent

the event copy with the fields substituted

Since
JavaFX 8.0
getDeltaXback to summary
public double getDeltaX()

Gets the horizontal scroll amount. This value should be interpreted as a number of pixels to scroll. When scrolling a text-based content, the textDeltaX and textDeltaXUnits values should be considered first.

The sign of the value is reversed compared to the coordinate system (when you scroll right, the content actually needs to go left). So the returned value can be simply added to the content's X coordinate.

Returns:double

Number of pixels to scroll horizontally

getDeltaYback to summary
public double getDeltaY()

Gets the vertical scroll amount. This value should be interpreted as a number of pixels to scroll. When scrolling a line-based content, the textDeltaY and textDeltaYUnits values should be considered first.

The sign of the value is reversed compared to the coordinate system (when you scroll down, the content actually needs to go up). So the returned value can be simply added to the content's Y coordinate.

Returns:double

Number of pixels to scroll vertically

getEventTypeback to summary
public EventType<ScrollEvent> getEventType()

Overrides javafx.scene.input.GestureEvent.getEventType.

Doc from javafx.event.Event.getEventType.

Gets the event type of this event. Objects of the same Event class can have different event types. These event types further specify what kind of event occurred.

Annotations
@Override
getMultiplierXback to summary
public double getMultiplierX()

Gets the multiplier used to convert mouse wheel rotation units to pixels

Returns:double

the x multiplier

Since
JavaFX 8.0
getMultiplierYback to summary
public double getMultiplierY()

Gets the multiplier used to convert mouse wheel rotation units to pixels

Returns:double

the y multiplier

Since
JavaFX 8.0
getTextDeltaXback to summary
public double getTextDeltaX()

Gets the horizontal text-based scroll amount. This value should be interpreted according to the getTextDeltaXUnits() value.

Returns:double

Number of units to scroll horizontally, zero if the text-based horizontal scrolling data is not available getTextDeltaXUnits() returns NONE

getTextDeltaXUnitsback to summary
public ScrollEvent.HorizontalTextScrollUnits getTextDeltaXUnits()

Gets the horizontal scrolling units for text-based scrolling. The returned value indicates how to interpret the getTextDeltaX() value. If the returned value is NONE, the text-based scrolling value is not available and the pixel-based getDeltaX() value needs to be used.

Returns:ScrollEvent.HorizontalTextScrollUnits

the horizontal scrolling units for text-based scrolling

getTextDeltaYback to summary
public double getTextDeltaY()

Gets the vertical text-based scroll amount. This value should be interpreted according to the getTextDeltaYUnits() value.

Returns:double

Number of units to scroll vertically, zero if the text-based vertical scrolling data is not available getTextDeltaYUnits() returns NONE

getTextDeltaYUnitsback to summary
public ScrollEvent.VerticalTextScrollUnits getTextDeltaYUnits()

Gets the vertical scrolling units for text-based scrolling. The returned value indicates how to interpret the getTextDeltaY() value. If the returned value is NONE, the text-based scrolling value is not available and the pixel-based getDeltaY() value needs to be used.

Returns:ScrollEvent.VerticalTextScrollUnits

the vertical scrolling units for text-based scrolling

getTotalDeltaXback to summary
public double getTotalDeltaX()

Gets the cumulative horizontal scroll amount for the whole gesture. This value should be interpreted as a number of pixels to scroll relatively to the state at the beginning of the gesture. Contains zeros for mouse wheel scrolling.

The sign of the value is reversed compared to the coordinate system (when you scroll right, the content actually needs to go left). So the returned value can be simply added to the content's X coordinate.

Returns:double

Number of pixels scrolled horizontally during the gesture

Since
JavaFX 2.2
getTotalDeltaYback to summary
public double getTotalDeltaY()

Gets the cumulative vertical scroll amount for the whole gesture. This value should be interpreted as a number of pixels to scroll relatively to the state at the beginning of the gesture. Contains zeros for mouse wheel scrolling.

The sign of the value is reversed compared to the coordinate system (when you scroll down, the content actually needs to go up). So the returned value can be simply added to the content's Y coordinate.

Returns:double

Number of pixels to scrolled vertically during the gesture

Since
JavaFX 2.2
getTouchCountback to summary
public int getTouchCount()

Gets number of touch points that caused this event. For non-touch source devices as mouse wheel and for inertia events after gesture finish it returns zero.

Returns:int

Number of touch points that caused this event

Since
JavaFX 2.2
toStringback to summary
public String toString()

Overrides javafx.scene.input.GestureEvent.toString.

Returns a string representation of this ScrollEvent object.

Returns:String

a string representation of this ScrollEvent object.

Annotations
@Override
javafx.scene.input back to summary

public final Enum ScrollEvent.HorizontalTextScrollUnits

extends Enum<ScrollEvent.HorizontalTextScrollUnits>
Class Inheritance

Horizontal text-based scrolling units.
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
public static final ScrollEvent.HorizontalTextScrollUnits
CHARACTERS

The horizontal text-based scrolling amount is a number of characters to scroll.

public static final ScrollEvent.HorizontalTextScrollUnits
NONE

The horizontal text-based scrolling data is not available (not provided by the underlying platform).

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ScrollEvent.HorizontalTextScrollUnits
public static ScrollEvent.HorizontalTextScrollUnits[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CHARACTERSback to summary
public static final ScrollEvent.HorizontalTextScrollUnits CHARACTERS

The horizontal text-based scrolling amount is a number of characters to scroll.

NONEback to summary
public static final ScrollEvent.HorizontalTextScrollUnits NONE

The horizontal text-based scrolling data is not available (not provided by the underlying platform).

Constructor Detail

HorizontalTextScrollUnitsback to summary
private HorizontalTextScrollUnits()

Method Detail

valueOfback to summary
public static ScrollEvent.HorizontalTextScrollUnits valueOf(String name)
valuesback to summary
public static ScrollEvent.HorizontalTextScrollUnits[] values()
javafx.scene.input back to summary

public final Enum ScrollEvent.VerticalTextScrollUnits

extends Enum<ScrollEvent.VerticalTextScrollUnits>
Class Inheritance

Vertical text-based scrolling units.
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
public static final ScrollEvent.VerticalTextScrollUnits
LINES

The vertical text-based scrolling amount is a number of lines to scroll.

public static final ScrollEvent.VerticalTextScrollUnits
NONE

The vertical text-based scrolling data is not available (not provided by the underlying platform).

public static final ScrollEvent.VerticalTextScrollUnits
PAGES

The vertical text-based scrolling amount is a number of pages to scroll.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ScrollEvent.VerticalTextScrollUnits
public static ScrollEvent.VerticalTextScrollUnits[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

LINESback to summary
public static final ScrollEvent.VerticalTextScrollUnits LINES

The vertical text-based scrolling amount is a number of lines to scroll.

NONEback to summary
public static final ScrollEvent.VerticalTextScrollUnits NONE

The vertical text-based scrolling data is not available (not provided by the underlying platform).

PAGESback to summary
public static final ScrollEvent.VerticalTextScrollUnits PAGES

The vertical text-based scrolling amount is a number of pages to scroll.

Constructor Detail

VerticalTextScrollUnitsback to summary
private VerticalTextScrollUnits()

Method Detail

valueOfback to summary
public static ScrollEvent.VerticalTextScrollUnits valueOf(String name)
valuesback to summary
public static ScrollEvent.VerticalTextScrollUnits[] values()