Class StartOffStart

java.lang.Object
org.fxmisc.flowless.StartOffStart
All Implemented Interfaces:
TargetPosition

final class StartOffStart extends Object implements TargetPosition
A TargetPosition that instructs its TargetPositionVisitor to use the cell at itemIndex as the anchor cell, showing it at the "top" of the viewport and to offset it by offsetFromStart.
  • Field Details

    • itemIndex

      final int itemIndex
    • offsetFromStart

      final double offsetFromStart
  • Constructor Details

    • StartOffStart

      StartOffStart(int itemIndex, double offsetFromStart)
  • Method Details

    • transformByChange

      public TargetPosition transformByChange(int pos, int removedSize, int addedSize)
      Description copied from interface: TargetPosition
      When the list of items, those displayed in the viewport, and those that are not, are modified, transforms this change to account for those modifications.
      Specified by:
      transformByChange in interface TargetPosition
      Parameters:
      pos - the cell index where the change begins
      removedSize - the amount of cells that were removed, starting from pos
      addedSize - the amount of cells that were added, starting from pos
    • scrollBy

      public TargetPosition scrollBy(double delta)
      Specified by:
      scrollBy in interface TargetPosition
    • accept

      public void accept(TargetPositionVisitor visitor)
      Description copied from interface: TargetPosition
      Visitor Pattern: prevents type-checking the implementation
      Specified by:
      accept in interface TargetPosition
    • clamp

      public TargetPosition clamp(int size)
      Description copied from interface: TargetPosition
      Insures this position's item index is between 0 and size
      Specified by:
      clamp in interface TargetPosition
    • clamp

      static int clamp(int idx, int size)