All Packages Class Hierarchy This Package Previous Next Index
Interface org.ohio.iOhioScreen
- public interface iOhioScreen
- extends iOhio
iOhioScreen encapsulates the host presentation space. The presentation
space is a virtual screen which contains all the characters and
attributes that would be seen on a traditional emulator screen. This
virtual screen is the primary object for text-based interactions
with the host. The iOhioScreen provides methods that manipulate text,
search the screen, send keystrokes to the host, and work with the
cursor.
An iOhioScreen object can be obtained using the GetScreen() method
on an instance of iOhioSession.
The raw presentation space data is maintained in a series of planes
which can be accessed by various methods within this class. The text
plane contains the actual characters in the presentation space. Most
of the methods in iOhioScreen class work exclusively with the text plane.
The remaining planes contain the corresponding attributes for each
character in the text plane. The color plane contains color
characteristics. The field plane contains the field attributes. The
extended plane contains the extended field attributes. The color,
field, and extended planes are not interpreted by any of the methods in
this class.
Once an instance of iOhioScreen has been obtained, an application can
register for iOhioScreen events using the addScreenListener() method. iOhioScreen
events are sent to registered listeners whenever the virtual screen is changed
for any reason, be it host or operator initiated.
- See Also:
- iOhioSession, iOhioFields, iOhioField
-
addScreenListener(iOhioScreenListener)
- Registers a listener object for events dispatched by this iOhioScreen
object.
-
findString(String, iOhioPosition, int, int, boolean)
- Searches the text plane for the target string.
-
getColumns()
- Returns the number of columns in the presentation space.
-
getCursor()
- Returns the location of the cursor in the presentation space.
-
getData(iOhioPosition, iOhioPosition, int)
- Returns data from the Text, Color, Field or Extended plane of the
virtual screen.
-
getFields()
- Returns the iOhioFields object associated with this presentation space.
-
getOIA()
- Returns the iOhioOIA associated with this presentation space.
-
getRows()
- Returns the number of rows in the presentation space.
-
getString()
- Returns the entire text plane of the presentation space as a string.
-
removeScreenListener(iOhioScreenListener)
- Unregisters a listener object for events dispatched by this iOhioScreen
object.
-
sendAid(int)
- The sendAid method sends an "aid" keystroke to the virtual screen.
-
sendKeys(String, iOhioPosition)
- The sendKeys method sends a string of keys to the virtual screen.
-
setCursor(iOhioPosition)
- Sets the location of the cursor in the presentation space.
-
setString(String, iOhioPosition)
- The setString method sends a string to the virtual screen at the
specified location.
getCursor
public abstract iOhioPosition getCursor()
- Returns the location of the cursor in the presentation space. The row and column
of the cursor is contained within the iOhioPosition object.
- Returns:
- The cursor location.
setCursor
public abstract void setCursor(iOhioPosition cursorPos)
- Sets the location of the cursor in the presentation space. The iOhioPosition
object provided as input contains the target row and column position for the
cursor.
- Parameters:
- cursorPos - The new cursor position
getOIA
public abstract iOhioOIA getOIA()
- Returns the iOhioOIA associated with this presentation space. This object can
be used to query the status of the operator information area.
- Returns:
- The iOhioOIA object for this presentation space.
- See Also:
- iOhioOIA
getFields
public abstract iOhioFields getFields()
- Returns the iOhioFields object associated with this presentation space. This
provides another convenient way to access the data in the virtual screen. The
iOhioFields object contains a snapshot of all the fields in the current virtual
screen. Fields provide convenient methods for interpreting the data in the
non-text planes. Zero length fields (due to adjacent field attributes) are
not returned in the iOhioFields collection. For unformatted screens, the
returned collection contains only one iOhioField that contains the whole
presentation space.
- Returns:
- The iOhioFields object for this presentation space.
- See Also:
- iOhioFields
getRows
public abstract int getRows()
- Returns the number of rows in the presentation space.
- Returns:
- The number of rows.
getColumns
public abstract int getColumns()
- Returns the number of columns in the presentation space.
- Returns:
- The number of columns.
getString
public abstract String getString()
- Returns the entire text plane of the presentation space as a string. All
null characters and Field Attribute characters are returned as blank space
characters.
- Returns:
- The entire text plane as a string
getData
public abstract char[] getData(iOhioPosition start,
iOhioPosition end,
int plane)
- Returns data from the Text, Color, Field or Extended plane of the
virtual screen.
- Parameters:
- start - The row and column where to start the search. The position is
inclusive (for example, row 1, col 1 means that position
1,1 will be used as the starting location and 1,1 will
be included in the data). "start" must be positionally
less than "end".
- end - The row and column where to end the search. The position is
inclusive (for example, row 1, col 1 means that position
1,1 will be used as the ending location and 1,1 will
be included in the data). "end" must be positionally
greater than "start".
- plane - A valid OHIO_PLANE value that indicates:
Constant |
Value |
Description |
OHIO_PLANE_TEXT |
1 |
Extract data from text plane. OHIO_PLANE_TEXT returns
null characters and Field Attribute characters as nulls (OPEN
ISSUE>. |
OHIO_PLANE_COLOR |
2 |
Extract data from color plane |
OHIO_PLANE_FIELD |
4 |
Extract data from field plane |
OHIO_PLANE_EXTENDED |
8 |
Extract data from extended plane |
- Returns:
- A character array containing the data that was extracted from the
target plane.
- See Also:
- OHIO_PLANE_TEXT, OHIO_PLANE_COLOR, OHIO_PLANE_FIELD, OHIO_PLANE_EXTENDED
findString
public abstract iOhioPosition findString(String targetString,
iOhioPosition start,
int length,
int dir,
boolean ignoreCase)
- Searches the text plane for the target string. Null characters in the
text plane are treated as blank spaces during search processing.
- Parameters:
- targetString - The target string.
- startPos - The row and column where to start the search. The position is
inclusive (for example, row 1, col 1 means that position
1,1 will be used as the starting location and 1,1 will
be included in the search).
- length - The length from startPos to include in the search.
- dir - An OHIO_DIRECTION value:
Constant |
Value |
Description |
OHIO_DIRECTION_FORWARD |
0 |
Forward (beginning towards end) |
OHIO_DIRECTION_BACKWARD |
1 |
Backward (end towards beginning) |
- ignoreCase - Indicates whether the search is case sensitive. True means
that case will be ignored. False means the search will be
case sensitive.
- Returns:
- If found, an iOhioPosition object containing the target location. If not
found, returns a null. The targetString must be completely contained by
the target area for the search to be successful.
sendKeys
public abstract void sendKeys(String text,
iOhioPosition location)
- The sendKeys method sends a string of keys to the virtual screen.
This method acts as if keystrokes were being typed from the keyboard.
The keystrokes will be sent to the location given. If no location is
provided, the keystrokes will be sent to the current cursor location.
- Parameters:
- text - The string of characters to be sent.
- location - Where to send the string of characters.
- See Also:
- sendAid
sendAid
public abstract void sendAid(int aidKey)
- The sendAid method sends an "aid" keystroke to the virtual screen. These
aid keys can be thought of as special keystrokes, like the Enter key, the
Tab key, or the Page Up key. All the valid special key values are contained
in the OHIO_AID enumeration:
- Parameters:
- aidKey - The aid key to send to the virtual screen.
- See Also:
- sendKeys
setString
public abstract void setString(String text,
iOhioPosition location)
- The setString method sends a string to the virtual screen at the
specified location. The string will overlay only unprotected
fields, and any parts of the string which fall over protected fields
will be discarded.
- Parameters:
- text - String to place in the virtual screen.
- location - Position where the string should be written.
addScreenListener
public abstract void addScreenListener(iOhioScreenListener listener)
- Registers a listener object for events dispatched by this iOhioScreen
object. The listener object must implement the iOhioScreenListener
interface. iOhioScreen events are generated whenever the virtual
screen is changed for whatever reason. The source of the change can
be the host or it can be user initiated (for example, sendKeys method
call).
Listener objects can be unregistered using the removeScreenListener()
method.
- Parameters:
- listener - iOhioScreenListener object which is notified when
iOhioScreen events occur.
- See Also:
- removeScreenListener
removeScreenListener
public abstract void removeScreenListener(iOhioScreenListener listener)
- Unregisters a listener object for events dispatched by this iOhioScreen
object.
Listener objects can be registered using the addScreenListener()
method.
- Parameters:
- listener - iOhioScreenListener object which is to be removed
from the notification list.
- See Also:
- addScreenListener
All Packages Class Hierarchy This Package Previous Next Index