Interface VirtualScreen.FrameRenderer

  • All Known Implementing Classes:
    VirtualScreen.DefaultFrameRenderer
    Enclosing class:
    VirtualScreen

    public static interface VirtualScreen.FrameRenderer
    Interface for rendering the virtual screen's frame when the real terminal is too small for the virtual screen
    • Method Detail

      • getViewportSize

        TerminalSize getViewportSize​(TerminalSize realSize,
                                     TerminalSize virtualSize)
        Given the size of the real terminal and the current size of the virtual screen, how large should the viewport where the screen content is drawn be?
        Parameters:
        realSize - Size of the real terminal
        virtualSize - Size of the virtual screen
        Returns:
        Size of the viewport, according to this FrameRenderer
      • getViewportOffset

        TerminalPosition getViewportOffset()
        Where in the virtual screen should the top-left position of the viewport be? To draw the viewport from the top-left position of the screen, return 0x0 (or TerminalPosition.TOP_LEFT_CORNER) here.
        Returns:
        Position of the top-left corner of the viewport inside the screen
      • drawFrame

        void drawFrame​(TextGraphics graphics,
                       TerminalSize realSize,
                       TerminalSize virtualSize,
                       TerminalPosition virtualScrollPosition)
        Drawn the 'frame', meaning anything that is outside the viewport (title, scrollbar, etc)
        Parameters:
        graphics - Graphics to use to text drawing operations
        realSize - Size of the real terminal
        virtualSize - Size of the virtual screen
        virtualScrollPosition - If the virtual screen is larger than the real terminal, this is the current scroll offset the VirtualScreen is using