类 SimpleVirtualFlow<T,C extends Cell<T>>
- 类型参数:
T- the type of objects to representC- the type of Cell to use
- 所有已实现的接口:
VirtualFlow<T,,C> Styleable,EventTarget
VirtualFlow.
This VirtualFlow creates Cells of type Cell, it's features are:
- The items list is managed automatically (insertions, removals or updates to the items)
- The cell factory can be changed any time
- Can show the cells from TOP to BOTTOM or from LEFT to RIGHT, this is the orientation property
- It's possible to change the orientation even at runtime (but it's also recommended resizing both the VirtualFlow and the cells)
- It's not necessary to wrap the flow in a scroll pane as it already includes both the scroll bars
- It's possible to set the speed of both the scroll bars
- It's possible to scroll manually by pixels or to cell index
- It's possible to get the currently shown/built cells or a specific cell by index
The cells are contained in aGroup which is a SimpleVirtualFlowContainer.-
属性概要
属性类型属性说明Property for the cell factory function.Specifies whether the cells should take all the space available on the y axis.Specifies whether the cells should take all the space available on the x axis.Property for the horizontal scroll bar's value.Property for the items list.The orientation property of the VirtualFlow.Property for the vertical scroll bar's value.从类继承的属性 javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width从类继承的属性 javafx.scene.Parent
needsLayout从类继承的属性 javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible -
嵌套类概要
嵌套类修饰符和类型类说明static class已过时, 待删除: 此 API 元素将从以后的版本中删除。classHelper class to manage extra features of the VirtualFlow. -
字段概要
从类继承的字段 javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE从类继承的字段 javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
构造器概要
构造器限定符构造器说明protectedSimpleVirtualFlow(ObjectProperty<ObservableList<T>> items, Function<T, C> cellFactory, Orientation orientation) SimpleVirtualFlow(ObservableList<T> items, Function<T, C> cellFactory, Orientation orientation) -
方法概要
修饰符和类型方法说明Property for the cell factory function.protected doublecomputePrefHeight(double width) protected doublecomputePrefWidth(double height) features()Specifies whether the cells should take all the space available on the y axis.Specifies whether the cells should take all the space available on the x axis.getCell(int index) doublegetCells()doublegetHBar()doublegetItems()protected OrientationHelpergetVBar()doubleProperty for the horizontal scroll bar's value.protected voidAdds the container to the children list, callssetupScrollBars().boolean获取属性fitToHeight的值。boolean获取属性fitToWidth的值。Property for the items list.protected voidThe orientation property of the VirtualFlow.voidscrollBy(double pixels) Scrolls by the given amount of pixels.voidscrollTo(int index) Scrolls to the given cell index.voidScrolls to the first cell.voidScrolls to the last cell.voidscrollToPixel(double pixel) Scrolls to the given pixel value.voidsetCellFactory(Function<T, C> cellFactory) Sets the function used to build a Cell from an object of type T.voidsetFitToHeight(boolean fitToHeight) 设置属性fitToHeight的值。voidsetFitToWidth(boolean fitToWidth) 设置属性fitToWidth的值。voidsetHorizontalPosition(double hValue) Sets the horizontal scroll bar's valuevoidsetHSpeed(double unit, double block) Sets the horizontal scroll bar speeds.voidsetItems(ObservableList<T> items) Replaces the items list with the given one.voidsetOrientation(Orientation orientation) Sets the orientation of the VirtualFlow.voidsetVerticalPosition(double vValue) Sets the vertical scroll bar's valuevoidsetVSpeed(double unit, double block) Sets the vertical scroll bar speeds.Property for the vertical scroll bar's value.从类继承的方法 javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty从类继承的方法 javafx.scene.Parent
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBounds从类继承的方法 javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 javafx.css.Styleable
getStyleableNode
-
属性详细资料
-
items
Property for the items list. -
cellFactory
Property for the cell factory function.- 指定者:
cellFactoryProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
fitToWidth
Specifies whether the cells should take all the space available on the x axis.This is used by the
OrientationHelper.VerticalHelper.- 指定者:
fitToWidthProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
fitToHeight
Specifies whether the cells should take all the space available on the y axis.This is used by the
OrientationHelper.HorizontalHelper.- 指定者:
fitToHeightProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
verticalPosition
Property for the vertical scroll bar's value.- 指定者:
verticalPositionProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
horizontalPosition
Property for the horizontal scroll bar's value.- 指定者:
horizontalPositionProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
orientation
The orientation property of the VirtualFlow.
-
-
构造器详细资料
-
SimpleVirtualFlow
protected SimpleVirtualFlow() -
SimpleVirtualFlow
public SimpleVirtualFlow(ObservableList<T> items, Function<T, C> cellFactory, Orientation orientation) -
SimpleVirtualFlow
public SimpleVirtualFlow(ObjectProperty<ObservableList<T>> items, Function<T, C> cellFactory, Orientation orientation)
-
-
方法详细资料
-
initialize
protected void initialize()Adds the container to the children list, callssetupScrollBars().Also adds listeners for the cellFactory property and the orientation property. Also initializes the orientation helper and the container when
A little note: the orientation helper is initialized manually at this specific point because otherwise the added listeners cause an infinite loop that will eat RAM for some reason.Parent.needsLayoutProperty()is becomes false. -
getCell
- 返回:
- the cell at the specified index, null if not found
-
getCells
- 返回:
- all the currently shown cells
-
scrollBy
public void scrollBy(double pixels) Scrolls by the given amount of pixels. -
scrollTo
public void scrollTo(int index) Scrolls to the given cell index. -
scrollToFirst
public void scrollToFirst()Scrolls to the first cell. -
scrollToLast
public void scrollToLast()Scrolls to the last cell. -
scrollToPixel
public void scrollToPixel(double pixel) Scrolls to the given pixel value. -
setHSpeed
public void setHSpeed(double unit, double block) Sets the horizontal scroll bar speeds. -
setVSpeed
public void setVSpeed(double unit, double block) Sets the vertical scroll bar speeds. -
computePrefWidth
protected double computePrefWidth(double height) - 覆盖:
computePrefWidth在类中Region
-
computePrefHeight
protected double computePrefHeight(double width) - 覆盖:
computePrefHeight在类中Region
-
getUserAgentStylesheet
- 覆盖:
getUserAgentStylesheet在类中Region
-
layoutChildren
protected void layoutChildren()- 覆盖:
layoutChildren在类中Parent
-
getItems
-
itemsProperty
Property for the items list. -
setItems
Replaces the items list with the given one. -
getCellFactory
- 指定者:
getCellFactory在接口中VirtualFlow<T,C extends Cell<T>> - 返回:
- the function used to build a Cell from an object of type T
-
cellFactoryProperty
Property for the cell factory function.- 指定者:
cellFactoryProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
setCellFactory
Sets the function used to build a Cell from an object of type T.- 指定者:
setCellFactory在接口中VirtualFlow<T,C extends Cell<T>>
-
getCellWidth
public double getCellWidth()- 指定者:
getCellWidth在接口中VirtualFlow<T,C extends Cell<T>> - 返回:
- the width of the cells
-
getCellHeight
public double getCellHeight()- 指定者:
getCellHeight在接口中VirtualFlow<T,C extends Cell<T>> - 返回:
- the height of the cells
-
getHBar
-
getVBar
-
isFitToWidth
public boolean isFitToWidth()获取属性fitToWidth的值。- 指定者:
isFitToWidth在接口中VirtualFlow<T,C extends Cell<T>> - 属性说明:
-
fitToWidthProperty
Specifies whether the cells should take all the space available on the x axis.This is used by the
OrientationHelper.VerticalHelper.- 指定者:
fitToWidthProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
setFitToWidth
public void setFitToWidth(boolean fitToWidth) 设置属性fitToWidth的值。- 指定者:
setFitToWidth在接口中VirtualFlow<T,C extends Cell<T>> - 属性说明:
-
isFitToHeight
public boolean isFitToHeight()获取属性fitToHeight的值。- 指定者:
isFitToHeight在接口中VirtualFlow<T,C extends Cell<T>> - 属性说明:
-
fitToHeightProperty
Specifies whether the cells should take all the space available on the y axis.This is used by the
OrientationHelper.HorizontalHelper.- 指定者:
fitToHeightProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
setFitToHeight
public void setFitToHeight(boolean fitToHeight) 设置属性fitToHeight的值。- 指定者:
setFitToHeight在接口中VirtualFlow<T,C extends Cell<T>> - 属性说明:
-
getVerticalPosition
public double getVerticalPosition()- 指定者:
getVerticalPosition在接口中VirtualFlow<T,C extends Cell<T>> - 返回:
- the vertical scroll bar's value
-
verticalPositionProperty
Property for the vertical scroll bar's value.- 指定者:
verticalPositionProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
setVerticalPosition
public void setVerticalPosition(double vValue) Sets the vertical scroll bar's value- 指定者:
setVerticalPosition在接口中VirtualFlow<T,C extends Cell<T>>
-
getHorizontalPosition
public double getHorizontalPosition()- 指定者:
getHorizontalPosition在接口中VirtualFlow<T,C extends Cell<T>> - 返回:
- the horizontal scroll bar's value
-
horizontalPositionProperty
Property for the horizontal scroll bar's value.- 指定者:
horizontalPositionProperty在接口中VirtualFlow<T,C extends Cell<T>> - 另请参阅:
-
setHorizontalPosition
public void setHorizontalPosition(double hValue) Sets the horizontal scroll bar's value- 指定者:
setHorizontalPosition在接口中VirtualFlow<T,C extends Cell<T>>
-
getOrientation
- 返回:
- the orientation of the VirtualFlow
-
orientationProperty
The orientation property of the VirtualFlow. -
setOrientation
Sets the orientation of the VirtualFlow. -
getOrientationHelper
- 返回:
- the current
OrientationHelperinstance
-
features
-
getVirtualFlow
- 指定者:
getVirtualFlow在接口中VirtualFlow<T,C extends Cell<T>> - 返回:
- the instance of the virtual flow
-