Top Description Inners Fields Constructors Methods
com.dlsc.gemsfx

public Class AutoscrollListView<T>

extends ListView<T>
Class Inheritance
Type Parameters
<T>
the item type
Imports
javafx.application.Platform, javafx.collections.FXCollections, .ObservableList, javafx.scene.Node, javafx.scene.control.ListView, javafx.scene.control.skin.VirtualFlow, javafx.scene.input.DragEvent, .TransferMode, javafx.scene.layout.Region

A specialization of ListView that will automatically start to scroll up or down during drag and drop operations whenever the mouse cursor reaches the top or bottom of the view. The view currently only supports vertical orientation, although it should be straight-forward to add horizontal orientation as well.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
pack-priv final double
private AutoscrollListView<T>.ScrollThread

Constructor Summary

AccessConstructor and Description
public
AutoscrollListView()

Constructs a new list view.

public
AutoscrollListView(ObservableList<T>
the list of items to show
items
)

Constructs a new list view.

Method Summary

Modifier and TypeMethod and Description
private void
autoscroll(double yOffset)

private void
private Region
private VirtualFlow<?>
private void
Inherited from javafx.scene.control.ListView:
cellFactoryPropertycreateDefaultSkinediteditablePropertyeditAnyEventeditCancelEventeditCommitEventeditingIndexPropertyeditStartEventfixedCellSizePropertyfocusModelPropertygetCellFactorygetClassCssMetaDatagetControlCssMetaDatagetEditingIndexgetFixedCellSizegetFocusModelgetItemsgetOnEditCancelgetOnEditCommitgetOnEditStartgetOnScrollTogetOrientationgetPlaceholdergetSelectionModelisEditableitemsPropertyonEditCancelPropertyonEditCommitPropertyonEditStartPropertyonScrollToPropertyorientationPropertyplaceholderPropertyqueryAccessibleAttributerefreshscrollToscrollToselectionModelPropertysetCellFactorysetEditablesetFixedCellSizesetFocusModelsetItemssetOnEditCancelsetOnEditCommitsetOnEditStartsetOnScrollTosetOrientationsetPlaceholdersetSelectionModel

Field Detail

proximityback to summary
pack-priv final double proximity
scrollThreadback to summary
private AutoscrollListView<T>.ScrollThread scrollThread

Constructor Detail

AutoscrollListViewback to summary
public AutoscrollListView()

Constructs a new list view.

AutoscrollListViewback to summary
public AutoscrollListView(ObservableList<T> items)

Constructs a new list view.

Parameters
items:ObservableList<T>

the list of items to show

Method Detail

autoscrollback to summary
private void autoscroll(double yOffset)
autoscrollIfNeededback to summary
private void autoscrollIfNeeded(DragEvent evt)
getClippedContainerback to summary
private Region getClippedContainer()
getVirtualFlowback to summary
private VirtualFlow<?> getVirtualFlow()
stopAutoScrollIfNeededback to summary
private void stopAutoScrollIfNeeded(DragEvent evt)
com.dlsc.gemsfx back to summary

private Class AutoscrollListView.ScrollThread

extends Thread
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
private double
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

private void
public void
setDelta(double yOffset)

public void
Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopthreadIdtoStringyield

Field Detail

runningback to summary
private boolean running
yOffsetback to summary
private double yOffset

Constructor Detail

ScrollThreadback to summary
pack-priv ScrollThread()

Method Detail

runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.

Annotations
@Override
scrollYback to summary
private void scrollY()
setDeltaback to summary
public void setDelta(double yOffset)
stopRunningback to summary
public void stopRunning()