Class FixedTerminalSizeProvider

java.lang.Object
com.googlecode.lanterna.terminal.ansi.FixedTerminalSizeProvider
All Implemented Interfaces:
UnixTerminalSizeQuerier

public class FixedTerminalSizeProvider extends Object implements UnixTerminalSizeQuerier
Using this terminal size provider, your terminal will be set to a fixed size and will never receive any resize events. Of course if the physical terminal is resized, in reality it will have a different size, but the application won't know about it. The size reported to the user is always the size attached to this object.
  • Field Details

  • Constructor Details

    • FixedTerminalSizeProvider

      public FixedTerminalSizeProvider(TerminalSize size)
      Creating a FixedTerminalSizeProvider set to a particular size that it will always report whenever the associated Terminal interface queries.
      Parameters:
      size - Size the terminal should be statically initialized to
  • Method Details

    • queryTerminalSize

      public TerminalSize queryTerminalSize()
      Description copied from interface: UnixTerminalSizeQuerier
      Checks what the size of the terminal is, measured in number of rows and columns. The implementer of this interface is expected to know which terminal we are querying for and have all it needs to figure out the size. One way of implementing this could be to read of an external value or variable or calling IPCs or just return a static size at all times.
      Specified by:
      queryTerminalSize in interface UnixTerminalSizeQuerier
      Returns:
      Size of the terminal at this point in time