Interface OrientationHelper

All Known Implementing Classes:
OrientationHelper.HorizontalHelper, OrientationHelper.VerticalHelper

public interface OrientationHelper
Helper class to avoid as much as possible if/else statements to check the VirtualFlow orientation.
  • Method Details

    • firstVisible

      int firstVisible()
      Returns:
      the index of the first visible cell in the viewport
    • lastVisible

      int lastVisible()
      Returns:
      the index of the last visible cell in the viewport
    • computeCellsNumber

      int computeCellsNumber()
      Returns:
      the number of cells to show
    • computeEstimatedHeight

      double computeEstimatedHeight(double cellHeight)
      Computes the estimated height of the flow.
    • computeEstimatedWidth

      double computeEstimatedWidth(double cellWidth)
      Computes the estimated width of the flow.
    • getHeight

      double getHeight(Node node)
      Returns:
      the height of the given node
    • getWidth

      double getWidth(Node node)
      Returns:
      the width of the given node
    • resizeRelocate

      void resizeRelocate(Node node, double pos, double w, double h)
      Resizes and relocates the given node with the given parameters.
    • layout

      void layout(Node node, int index, double cellW, double cellH)
      Lays out the given node.
    • boundSize

      static double boundSize(double pref, double min, double max)
      Computes size of a Node between its pref, min and max sizes.

      The formula is:

       
           double a = Math.max(pref, min);
           double b = Math.max(min, max);
           return Math.min(a, b);
       
       

    • boundWidth

      static double boundWidth(Node node)
    • boundHeight

      static double boundHeight(Node node)
    • scrollBy

      void scrollBy(double pixels)
      Scrolls the flow by the given amount of pixels.
    • scrollTo

      void scrollTo(int index)
      Scrolls the flow to the given cell index.
    • scrollToFirst

      void scrollToFirst()
      Scrolls the flow to the first cell.
    • scrollToLast

      void scrollToLast()
      Scrolls the flow to the last cell.
    • scrollToPixel

      void scrollToPixel(double pixel)
      Scrolls the flow to the given pixel value.
    • dispose

      void dispose()
      Removes and clears any listener.

      This must be called every time the OrientationHelper of the VirtualFlow is changed (typically occurs when the orientation changes).