Class DoublePrintingTextGraphics

java.lang.Object
com.googlecode.lanterna.graphics.AbstractTextGraphics
com.googlecode.lanterna.graphics.DoublePrintingTextGraphics
All Implemented Interfaces:
StyleSet<TextGraphics>, TextGraphics

public class DoublePrintingTextGraphics extends AbstractTextGraphics
This TextGraphics implementation wraps another TextGraphics and forwards all operations to it, but with a few differences. First of all, each individual character being printed is printed twice. Secondly, if you call getSize(), it will return a size that has half the width of the underlying TextGraphics. This presents the writable view as somewhat squared, since normally terminal characters are twice as tall as wide. You can see some examples of how this looks by running the Triangle test in com.googlecode.lanterna.screen.ScreenTriangleTest and compare it when running with the --square parameter and without.
  • Field Details

    • underlyingTextGraphics

      private final TextGraphics underlyingTextGraphics
  • Constructor Details

    • DoublePrintingTextGraphics

      public DoublePrintingTextGraphics(TextGraphics underlyingTextGraphics)
      Creates a new DoublePrintingTextGraphics on top of a supplied TextGraphics
      Parameters:
      underlyingTextGraphics - backend TextGraphics to forward all the calls to
  • Method Details

    • setCharacter

      public TextGraphics setCharacter(int columnIndex, int rowIndex, TextCharacter textCharacter)
      Description copied from interface: TextGraphics
      Sets the character at the current position to the specified value, without using the current colors and modifiers of this TextGraphics.
      Parameters:
      columnIndex - column of the location to set the character
      rowIndex - row of the location to set the character
      textCharacter - Character data to set at the current position
      Returns:
      Itself
    • getCharacter

      public TextCharacter getCharacter(int columnIndex, int rowIndex)
      Description copied from interface: TextGraphics
      Returns the character at the specific position in the terminal. May return null if the TextGraphics implementation doesn't support it or doesn't know what the character is.
      Parameters:
      columnIndex - Column to return the character for
      rowIndex - Row to return the character for
      Returns:
      The text character at the specified position or null if not available
    • getSize

      public TerminalSize getSize()
      Description copied from interface: TextGraphics
      Returns the size of the area that this text graphic can write to. Any attempts of placing characters outside of this area will be silently ignored.
      Returns:
      Size of the writable area that this TextGraphics can write too