Interface BareScreen

All Known Subinterfaces:
Screen

public interface BareScreen
A BareScreen represents a host screen. It is rectangular in shape. A screen contains text arranged in equal sized rows or lines. You can retrieve specific portions of the text, addressing it by either x,y coordinates (upper left is 0,0) or by character offsets. The text can be treated as one contiguous "flow" where the last character of one line is immediately followed by the first character of the next line. Or it can be treated as a list of lines.
Version:
$Id$
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Write this screen to the provided OutputStream in XML format.
    void
    createScreenShot(OutputStream outputStream, String exename, String buildnumber, String exeversion, String productName, String modelVersion)
    Write this screen to the provided OutputStream in XML format.
    Returns the entire screen text with no line-endings.
    getCell(int offset)
    Returns the Cell at a location of the screen.
    getCell(int x, int y)
    Returns the Cell at a location of the screen.
    getCell(com.seagullsw.common.toolbox.geometry.Point at)
    Returns the Cell at a location of the screen.
    getCellList(int start, int length)
    Returns a collection of Cells.
    getCellList(int x, int y, int length)
    Returns a collection of Cells.
    getCellList(com.seagullsw.common.toolbox.geometry.Point at, int length)
    Returns a collection of Cells.
    getCellList(com.seagullsw.common.toolbox.geometry.Rectangle r)
    Returns a collection of Cells of a rectangular portion of the screen.
    long
    Get the change count.
    Returns the cursor for the screen.
    Get a collection with all cursors of this screen.
    Get the name that identifies the emulator.
    com.seagullsw.common.emulator.physical.base.screen.EmulatorState
    Get the input state of the client.
    getHostField(com.seagullsw.common.toolbox.geometry.Point at)
    Returns the host-defined field at the given location.
    Returns a list of the host-defined fields.
    Returns the keyboard for the screen.
    int
    Get the keyboard restore count.
    com.seagullsw.common.toolbox.geometry.Dimension
    Returns the size of the screen.
    Returns an immutable snapshot, created (if necessary) from this BareScreen.
    getText(int start, int length)
    Returns the text content of a portion of the screen.
    getText(int x, int y, int length)
    Returns the text content of a portion of the screen.
    getText(com.seagullsw.common.toolbox.geometry.Point at, int length)
    Returns the text content of a portion of the screen.
    getTextLine(int line)
    Returns a single line of text content.
    getTextLines(com.seagullsw.common.toolbox.geometry.Point at, int length)
    Returns the text content of a portion of the screen, divided into individual lines matching the lines on the screen.
    getTextLines(com.seagullsw.common.toolbox.geometry.Rectangle r)
    Returns the text content of a rectangular portion of the screen, divided into individual lines matching the lines on the screen.
    boolean
    Check if the input inhibit flag is raised.
    boolean
    Check if the colors on the BareScreen are reversed.
    boolean
    Tests if this BareScreen is an immutable snapshot.
    toDebugString(boolean includeHidden)
    Return a string representation of the screen suitable for inclusion in debug logging.
    int
    toOffset(com.seagullsw.common.toolbox.geometry.Point point)
    Convert a screen coordinate to a character offset.
    com.seagullsw.common.toolbox.geometry.Point
    toPoint(int offset)
    Convert a character offset to a screen coordinate.
  • Method Details

    • getSize

      com.seagullsw.common.toolbox.geometry.Dimension getSize()
      Returns the size of the screen.
      Returns:
      the size of the screen.
    • getSnapshot

      BareScreen getSnapshot()
      Returns an immutable snapshot, created (if necessary) from this BareScreen. The implementation possibly returns this BareScreen, if it is already an immutable snapshot.
      Returns:
      an immutable snapshot, created (if necessary) from this BareScreen.
    • isSnapshot

      boolean isSnapshot()
      Tests if this BareScreen is an immutable snapshot.
      Returns:
      true if this BareScreen is an immutable snapshot.
    • createScreenShot

      void createScreenShot(OutputStream outputStream) throws IOException
      Write this screen to the provided OutputStream in XML format. The outputStream will not be closed, it is up to the caller to close the outputStream.
      Parameters:
      outputStream - the provided OutputStream
      Throws:
      IOException - thrown when there is a problem generating the screen shot
    • createScreenShot

      void createScreenShot(OutputStream outputStream, String exename, String buildnumber, String exeversion, String productName, String modelVersion) throws IOException
      Write this screen to the provided OutputStream in XML format. The outputStream will not be closed, it is up to the caller to close the outputStream.
      Parameters:
      outputStream - the provided OutputStream
      exename - value for the exename attribute of the VersionInfo processing instruction, if null a default is supplied.
      buildnumber - value for the buildnumber attribute of the VersionInfo processing instruction, if null a default is supplied.
      exeversion - value for the exeversion attribute of the VersionInfo processing instruction, if null a default is supplied.
      productName - value for the productName attribute of the VersionInfo processing instruction, if null it is omitted.
      modelVersion - value for the modelVersion attribute of the VersionInfo processing instruction, if null it is omitted.
      Throws:
      IOException - thrown when there is a problem generating the screen shot
    • getText

      String getText(com.seagullsw.common.toolbox.geometry.Point at, int length)
      Returns the text content of a portion of the screen. If the prescribed portion crosses a line boundary, the text returned is contiguous - there are no line break characters.
      Parameters:
      at - the screen location of the beginning of the string to retrieve.
      length - the number of characters to retrieve.
      Returns:
      the text content of the specified portion of the screen.
    • getText

      String getText(int start, int length)
      Returns the text content of a portion of the screen. If the prescribed portion crosses a line boundary, the text returned is contiguous - there are no line break characters.
      Parameters:
      start - the zero-based character offset of the beginning of the text to retrieve.
      length - the number of characters to retrieve.
      Returns:
      the text content of the specified portion of the screen.
    • getText

      String getText(int x, int y, int length)
      Returns the text content of a portion of the screen. If the prescribed portion crosses a line boundary, the text returned is contiguous - there are no line break characters.
      Parameters:
      x - the horizontal screen coordinate of the beginning of the text to retrieve.
      y - the vertical screen coordinate of the beginning of the text to retrieve.
      length - the number of characters to retrieve.
      Returns:
      the text content of the specified portion of the screen.
    • getTextLine

      String getTextLine(int line)
      Returns a single line of text content.
      Parameters:
      line - the line number, the top line is 0.
      Returns:
      a single line of text content
    • getTextLines

      List<String> getTextLines(com.seagullsw.common.toolbox.geometry.Point at, int length)
      Returns the text content of a portion of the screen, divided into individual lines matching the lines on the screen. So the first and last lines in the list will be less than full width unless the prescribed portion starts exactly at the left edge and ends at the right.
      Parameters:
      at - the screen location of the beginning of the lines to retrieve.
      length - the number of characters to retrieve.
      Returns:
      a list of strings, one for each line included in specified screen portion.
    • getTextLines

      List<String> getTextLines(com.seagullsw.common.toolbox.geometry.Rectangle r)
      Returns the text content of a rectangular portion of the screen, divided into individual lines matching the lines on the screen.
      Parameters:
      r - the rectangle to retrieve.
      Returns:
      a list of strings, one for each line.
    • getAllText

      String getAllText()
      Returns the entire screen text with no line-endings. End of one line is immediately followed by start of next line. Empty areas are filled with blanks.
      Returns:
      the entire screen text.
    • toPoint

      com.seagullsw.common.toolbox.geometry.Point toPoint(int offset)
      Convert a character offset to a screen coordinate.
      Parameters:
      offset - the character offset to convert.
      Returns:
      the screen coordinate of the offset.
    • toOffset

      int toOffset(com.seagullsw.common.toolbox.geometry.Point point)
      Convert a screen coordinate to a character offset.
      Parameters:
      point - the screen coordinate to convert.
      Returns:
      the character offset of the screen coordinate.
    • getKeyboard

      Keyboard getKeyboard()
      Returns the keyboard for the screen.
      Returns:
      the keyboard for the screen.
    • getCursor

      BareCursor getCursor()
      Returns the cursor for the screen.
      Returns:
      the cursor.
    • getCursorList

      List<BareCursor> getCursorList()
      Get a collection with all cursors of this screen.
      Returns:
      a collection with all cursors of this screen
    • getCell

      Cell getCell(com.seagullsw.common.toolbox.geometry.Point at)
      Returns the Cell at a location of the screen.
      Parameters:
      at - the screen location of the Cell
      Returns:
      the Cell at the specified location of the screen.
    • getCell

      Cell getCell(int offset)
      Returns the Cell at a location of the screen.
      Parameters:
      offset - the zero-based offset of the Cell to retrieve.
      Returns:
      the Cell at the specified location of the screen.
    • getCell

      Cell getCell(int x, int y)
      Returns the Cell at a location of the screen.
      Parameters:
      x - the horizontal screen coordinate of the Cell to retrieve.
      y - the vertical screen coordinate of the Cell to retrieve.
      Returns:
      the Cell at the specified location of the screen.
    • getCellList

      List<Cell> getCellList(com.seagullsw.common.toolbox.geometry.Point at, int length)
      Returns a collection of Cells.
      Parameters:
      at - the screen location of the first Cell
      length - the number of Cells to retrieve.
      Returns:
      the collection of Cells
    • getCellList

      List<Cell> getCellList(int start, int length)
      Returns a collection of Cells.
      Parameters:
      start - the zero-based offset of the first Cell to retrieve.
      length - the number of Cells to retrieve.
      Returns:
      the collection of Cells
    • getCellList

      List<Cell> getCellList(int x, int y, int length)
      Returns a collection of Cells.
      Parameters:
      x - the horizontal screen coordinate of the first Cell to retrieve.
      y - the vertical screen coordinate of the first Cell to retrieve.
      length - the number of Cells to retrieve.
      Returns:
      the collection of Cells
    • getCellList

      List<Cell> getCellList(com.seagullsw.common.toolbox.geometry.Rectangle r)
      Returns a collection of Cells of a rectangular portion of the screen.
      Parameters:
      r - the rectangle to retrieve.
      Returns:
      the collection of Cells
    • isReverse

      boolean isReverse() throws UnsupportedOperationException
      Check if the colors on the BareScreen are reversed.
      Returns:
      true if the colors on the BareScreen are reversed
      Throws:
      UnsupportedOperationException - when the emulator does not support reverse screens
    • isInputInhibit

      boolean isInputInhibit() throws UnsupportedOperationException
      Check if the input inhibit flag is raised.
      Returns:
      true if the input inhibit flag is raised
      Throws:
      UnsupportedOperationException - when the emulator does not support the input inhibit flag
    • getKeyboardRestoreCount

      int getKeyboardRestoreCount() throws UnsupportedOperationException
      Get the keyboard restore count.
      Returns:
      the keyboard restore count
      Throws:
      UnsupportedOperationException - when the emulator does not support the keyboard restore count
    • getEmulatorState

      com.seagullsw.common.emulator.physical.base.screen.EmulatorState getEmulatorState() throws UnsupportedOperationException
      Get the input state of the client.
      Returns:
      the input state of the client
      Throws:
      UnsupportedOperationException - when the emulator does not support the 'emulator state' property
    • getChangeCount

      long getChangeCount()
      Get the change count.
      Returns:
      the change count
    • getEmulatorName

      String getEmulatorName()
      Get the name that identifies the emulator. Possible values are described in the NAME constants of Emulators.Ibm5250, Emulators.Ibm3270 and Emulators.AnsiPlus.
      Returns:
      the name that identifies the emulator
    • getHostFields

      List<BareField> getHostFields()
      Returns a list of the host-defined fields.
      Returns:
      a list of the host-defined fields.
      Throws:
      UnsupportedOperationException - when the emulator does not support fields (e.g. VT).
    • getHostField

      BareField getHostField(com.seagullsw.common.toolbox.geometry.Point at)
      Returns the host-defined field at the given location.
      Parameters:
      at - a screen location anywhere within the desired host-defined field.
      Returns:
      if there is a host-defined field at the given location, return it, else return null.
    • toDebugString

      String toDebugString(boolean includeHidden)
      Return a string representation of the screen suitable for inclusion in debug logging.
      Parameters:
      includeHidden - if true, hidden cells (e.g. password fields) are included, else they are replaced by blanks.
      Returns:
      a string representation of the screen suitable for inclusion in debug logging.