Interface TerminalScrollController

All Known Implementing Classes:
ScrollingAWTTerminal.ScrollController, ScrollingSwingTerminal.ScrollController, TerminalScrollController.Null

public interface TerminalScrollController
This interface can be used to control the backlog scrolling of a SwingTerminal. It's used as a callback by the SwingTerminal when it needs to fetch the scroll position and also used whenever the backlog changes to that some view class, like a scrollbar for example, can update its view accordingly.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Implementation of TerminalScrollController that does nothing
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Called by the SwingTerminal to know the 'offset' into the backlog.
    void
    updateModel(int totalSize, int screenSize)
    Called by the SwingTerminal when the terminal has changed or more lines are entered into the terminal
  • Method Details

    • updateModel

      void updateModel(int totalSize, int screenSize)
      Called by the SwingTerminal when the terminal has changed or more lines are entered into the terminal
      Parameters:
      totalSize - Total number of lines in the backlog currently
      screenSize - Number of lines covered by the terminal window at its current size
    • getScrollingOffset

      int getScrollingOffset()
      Called by the SwingTerminal to know the 'offset' into the backlog. Returning 0 here will always draw the latest lines; if you return 5, it will draw from five lines into the backlog and skip the 5 most recent lines.
      Returns:
      According to this scroll controller, how far back into the backlog are we?