Package com.rs.seagull.emulator.api
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 TypeMethodDescriptionvoidcreateScreenShot(OutputStream outputStream) Write this screen to the providedOutputStreamin XML format.voidcreateScreenShot(OutputStream outputStream, String exename, String buildnumber, String exeversion, String productName, String modelVersion) Write this screen to the providedOutputStreamin XML format.Returns the entire screen text with no line-endings.getCell(int offset) Returns theCellat a location of the screen.getCell(int x, int y) Returns theCellat a location of the screen.getCell(com.seagullsw.common.toolbox.geometry.Point at) Returns theCellat a location of the screen.getCellList(int start, int length) Returns a collection ofCells.getCellList(int x, int y, int length) Returns a collection ofCells.getCellList(com.seagullsw.common.toolbox.geometry.Point at, int length) Returns a collection ofCells.getCellList(com.seagullsw.common.toolbox.geometry.Rectangle r) Returns a collection ofCells of a rectangular portion of the screen.longGet 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.EmulatorStateGet 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.intGet the keyboard restore count.com.seagullsw.common.toolbox.geometry.DimensiongetSize()Returns the size of the screen.Returns an immutable snapshot, created (if necessary) from thisBareScreen.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.booleanCheck if the input inhibit flag is raised.booleanCheck if the colors on theBareScreenare reversed.booleanTests if thisBareScreenis an immutable snapshot.toDebugString(boolean includeHidden) Return a string representation of the screen suitable for inclusion in debug logging.inttoOffset(com.seagullsw.common.toolbox.geometry.Point point) Convert a screen coordinate to a character offset.com.seagullsw.common.toolbox.geometry.PointtoPoint(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 thisBareScreen. The implementation possibly returns thisBareScreen, if it is already an immutable snapshot.- Returns:
- an immutable snapshot, created (if necessary) from this
BareScreen.
-
isSnapshot
boolean isSnapshot()Tests if thisBareScreenis an immutable snapshot.- Returns:
trueif thisBareScreenis an immutable snapshot.
-
createScreenShot
Write this screen to the providedOutputStreamin XML format. The outputStream will not be closed, it is up to the caller to close the outputStream.- Parameters:
outputStream- the providedOutputStream- 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 providedOutputStreamin XML format. The outputStream will not be closed, it is up to the caller to close the outputStream.- Parameters:
outputStream- the providedOutputStreamexename- 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
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
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
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
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
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
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
Returns theCellat a location of the screen. -
getCell
Returns theCellat a location of the screen. -
getCell
Returns theCellat a location of the screen. -
getCellList
Returns a collection ofCells. -
getCellList
Returns a collection ofCells. -
getCellList
Returns a collection ofCells. -
getCellList
Returns a collection ofCells of a rectangular portion of the screen.- Parameters:
r- the rectangle to retrieve.- Returns:
- the collection of
Cells
-
isReverse
Check if the colors on theBareScreenare reversed.- Returns:
trueif the colors on theBareScreenare reversed- Throws:
UnsupportedOperationException- when the emulator does not support reverse screens
-
isInputInhibit
Check if the input inhibit flag is raised.- Returns:
trueif the input inhibit flag is raised- Throws:
UnsupportedOperationException- when the emulator does not support the input inhibit flag
-
getKeyboardRestoreCount
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 UnsupportedOperationExceptionGet 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 theNAMEconstants ofEmulators.Ibm5250,Emulators.Ibm3270andEmulators.AnsiPlus.- Returns:
- the name that identifies the emulator
-
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
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
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.
-