类 LayoutManager<T,C extends Cell<T>>
java.lang.Object
io.github.palexdev.virtualizedfx.flow.simple.LayoutManager<T,C>
- 类型参数:
T- the type of objects to representC- the type of Cell to use
Helper class to keep track of some parameters like:
- the amount of pixels scrolled down/right in the viewport
- the estimated height property, estimatedHeightProperty()
- the estimated width property, estimatedWidthProperty()
- The cells fixes size (both height and width)
-
属性概要
属性类型属性说明The total height property, the sum of all cells' height.The total width property, the sum of all cells' width. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明The total height property, the sum of all cells' height.The total width property, the sum of all cells' width.intDelegate method ofOrientationHelper.firstVisible().doubledoubledoubledoubledoubleprotected voidinitFlow()Callsbindings()andCellsManager.initCells(int), the num of cells passed is computed by callingOrientationHelper.computeCellsNumber().protected voidGets the first item from the items list and builds a cell from it.protected booleanintDelegate method ofOrientationHelper.lastVisible().protected voidretrieveCellsSizes(C cell) Called during initialization to compute the sizes of a Cell before it's laid out.protected voidsetInitialized(boolean initialized) Sets the init state of the LayoutManagervoidupdate(double scrolled) Called on scroll to update the amount of pixels scrolled and then callsCellsManager.updateCells(int), the passed start index is computed byfirstVisible().
-
属性详细资料
-
estimatedHeight
The total height property, the sum of all cells' height. This is needed by the VirtualFlow to properly compute the scroll bars max values.- 另请参阅:
-
estimatedWidth
The total width property, the sum of all cells' width. This is needed by the VirtualFlow to properly compute the scroll bars max values.- 另请参阅:
-
-
构造器详细资料
-
LayoutManager
-
-
方法详细资料
-
initialize
protected void initialize()Gets the first item from the items list and builds a cell from it. This is needed to get the Cell's fixed height and width values. Then callsinitFlow().If the list is empty the method exits immediately, when the list property changes or the current list is not empty anymore the
SimpleVirtualFlowContainerwill tell the LayoutManager to initialize. -
initFlow
protected void initFlow()Callsbindings()andCellsManager.initCells(int), the num of cells passed is computed by callingOrientationHelper.computeCellsNumber(). -
update
public void update(double scrolled) Called on scroll to update the amount of pixels scrolled and then callsCellsManager.updateCells(int), the passed start index is computed byfirstVisible(). -
firstVisible
public int firstVisible()Delegate method ofOrientationHelper.firstVisible(). -
lastVisible
public int lastVisible()Delegate method ofOrientationHelper.lastVisible(). -
retrieveCellsSizes
Called during initialization to compute the sizes of a Cell before it's laid out.This is done by adding the cell to a
Groupand then the group is set as the root of a newScene.By calling
Node.applyCss()andParent.layout(), the cell will be properly resized, and we can get its sizes withOrientationHelper.getHeight(Node)andOrientationHelper.getWidth(Node). -
getEstimatedHeight
public double getEstimatedHeight()- 返回:
- the sum of all cells' height
-
estimatedHeightProperty
The total height property, the sum of all cells' height. This is needed by the VirtualFlow to properly compute the scroll bars max values.- 另请参阅:
-
getEstimatedWidth
public double getEstimatedWidth()- 返回:
- the sum of all cells' width
-
estimatedWidthProperty
The total width property, the sum of all cells' width. This is needed by the VirtualFlow to properly compute the scroll bars max values.- 另请参阅:
-
getCellHeight
public double getCellHeight()- 返回:
- the fixed Cells height
-
getCellWidth
public double getCellWidth()- 返回:
- the fixed Cells width
-
getScrolled
public double getScrolled()- 返回:
- the amount of scrolled pixels
-
isInitialized
protected boolean isInitialized()- 返回:
- the init state of the LayoutManager
-
setInitialized
protected void setInitialized(boolean initialized) Sets the init state of the LayoutManager
-