Class VirtualScreen.DefaultFrameRenderer

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void drawFrame​(TextGraphics graphics, TerminalSize realSize, TerminalSize virtualSize, TerminalPosition virtualScrollPosition)
      Drawn the 'frame', meaning anything that is outside the viewport (title, scrollbar, etc)
      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.
      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?
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultFrameRenderer

        private DefaultFrameRenderer()
    • Method Detail

      • 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