类 LayoutManager<T,C extends Cell<T>>

java.lang.Object
io.github.palexdev.virtualizedfx.flow.simple.LayoutManager<T,C>
类型参数:
T - the type of objects to represent
C - the type of Cell to use

public class LayoutManager<T,C extends Cell<T>> extends Object
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)

  • 属性详细资料

    • estimatedHeight

      public DoubleProperty 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.
      另请参阅:
    • estimatedWidth

      public DoubleProperty 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.
      另请参阅:
  • 构造器详细资料

  • 方法详细资料

    • 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 calls initFlow().

      If the list is empty the method exits immediately, when the list property changes or the current list is not empty anymore the SimpleVirtualFlowContainer will tell the LayoutManager to initialize.

    • initFlow

      protected void initFlow()
      Calls bindings() and CellsManager.initCells(int), the num of cells passed is computed by calling OrientationHelper.computeCellsNumber().
    • update

      public void update(double scrolled)
      Called on scroll to update the amount of pixels scrolled and then calls CellsManager.updateCells(int), the passed start index is computed by firstVisible().
    • firstVisible

      public int firstVisible()
    • lastVisible

      public int lastVisible()
    • retrieveCellsSizes

      protected void retrieveCellsSizes(C cell)
      Called during initialization to compute the sizes of a Cell before it's laid out.

      This is done by adding the cell to a Group and then the group is set as the root of a new Scene.

      By calling Node.applyCss() and Parent.layout(), the cell will be properly resized, and we can get its sizes with OrientationHelper.getHeight(Node) and OrientationHelper.getWidth(Node).

    • getEstimatedHeight

      public double getEstimatedHeight()
      返回:
      the sum of all cells' height
    • estimatedHeightProperty

      public DoubleProperty 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

      public DoubleProperty 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