Class VirtualScreen.DefaultFrameRenderer

java.lang.Object
com.googlecode.lanterna.screen.VirtualScreen.DefaultFrameRenderer
All Implemented Interfaces:
VirtualScreen.FrameRenderer
Enclosing class:
VirtualScreen

private static class VirtualScreen.DefaultFrameRenderer extends Object implements VirtualScreen.FrameRenderer
  • Constructor Details

    • DefaultFrameRenderer

      private DefaultFrameRenderer()
  • Method Details

    • getViewportSize

      public TerminalSize getViewportSize(TerminalSize realSize, TerminalSize virtualSize)
      Description copied from interface: VirtualScreen.FrameRenderer
      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?
      Specified by:
      getViewportSize in interface VirtualScreen.FrameRenderer
      Parameters:
      realSize - Size of the real terminal
      virtualSize - Size of the virtual screen
      Returns:
      Size of the viewport, according to this FrameRenderer
    • getViewportOffset

      public TerminalPosition getViewportOffset()
      Description copied from interface: VirtualScreen.FrameRenderer
      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.
      Specified by:
      getViewportOffset in interface VirtualScreen.FrameRenderer
      Returns:
      Position of the top-left corner of the viewport inside the screen
    • drawFrame

      public void drawFrame(TextGraphics graphics, TerminalSize realSize, TerminalSize virtualSize, TerminalPosition virtualScrollPosition)
      Description copied from interface: VirtualScreen.FrameRenderer
      Drawn the 'frame', meaning anything that is outside the viewport (title, scrollbar, etc)
      Specified by:
      drawFrame in interface VirtualScreen.FrameRenderer
      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