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 Detail

      • 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
      • 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
      • 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.