Package limn.scene

Interface Scrollable

All Known Implementing Classes:
ListView, ScrollView

public interface Scrollable
SPI for widgets that can scroll their content programmatically: scroll containers (ScrollView), virtualized lists (ListView), overflow strips, popup panels. The one required operation is revealRect(float, float, float, float): make a rectangle of content visible, scrolling as little as possible (a no-op when it already is). Revealing a specific point is the degenerate revealRect(x, y, 0, 0).

This is what Widget.revealInView() talks to: it walks the ancestor chain and asks every Scrollable on the way to bring the widget into view, which the Scene triggers automatically whenever keyboard focus moves, so Tab/Shift+Tab never land on an off-screen widget.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    revealRect(float x, float y, float width, float height)
    Scrolls the minimum amount so the rectangle becomes visible.
  • Method Details

    • revealRect

      void revealRect(float x, float y, float width, float height)
      Scrolls the minimum amount so the rectangle becomes visible. The rectangle is given in this widget's local (viewport) coordinates, i.e. the same space a child's x()/y() resolve to. Rectangles larger than the viewport align their near edge. Implementations clamp to their content bounds; already-visible rects are a no-op. UI thread only.