com.wrq.apptrieve.agent
Class ScreenField

java.lang.Object
  extended by com.wrq.apptrieve.agent.ScreenField
All Implemented Interfaces:
java.io.Serializable

public class ScreenField
extends java.lang.Object
implements java.io.Serializable

ScreenField provides information about a field on the terminal screen.

See Also:
Serialized Form

Constructor Summary
ScreenField(TerminalScreen screen, com.wrq.apptrieve.agent.ScreenFieldPosition pos)
          Constructor for internal use only.
 
Method Summary
 char charAt(int i)
          The character at a zero-based offset within the field.
 boolean equals(java.lang.Object o)
           
protected  int fieldToScreen(int i)
          Return absolute screen offset from field offset.
 int getColor()
          Return the color of the first character in this field.
 int getColor(int i)
          Return the color of the ith (zero-based) character in this field.
 int getColumn()
          Gets the 0-based column of the start of this field.
 int getLength()
          Gets the length of this field.
 int getOffset()
          Gets the 0-based start offset for this field.
 int getRow()
          Gets the 0-based row of the start of this field.
 java.lang.String getText()
          The screen text for this field.
 int getWrapLength()
          Return number of characters which occur before the field wrap.
 boolean hasCursor()
          Determine if the terminal cursor is within this field.
 boolean isBlink()
          Return true if the first character of the field is blinking text.
 boolean isBlink(int i)
          Return true if the ith character of the field is blinking text.
 boolean isColumnSeparated()
          Return true if the first character of the field is column separated (5250).
 boolean isColumnSeparated(int i)
          Return true if the ith character of the field is column separated (5250).
 boolean isHighIntensity()
          Return true if the first character of the field is high intensity.
 boolean isHighIntensity(int i)
          Return true if the ith character of the field is high intensity.
 boolean isInput()
          Return true if the first character of the field is for input.
 boolean isInput(int i)
          Return true if the ith (zero-based) character of the field is for input.
 boolean isNumeric()
          Return true if the first character of the field has numeric attribute.
 boolean isNumeric(int i)
          Return true if the ith character of the field has numeric attribute.
 boolean isPenDetect()
          Return true if the first field character is lightpen detectable.
 boolean isPenDetect(int i)
          Return true if the ith field character is lightpen detectable.
 boolean isReverseVideo()
          Return true if the first field character is reverse-video.
 boolean isReverseVideo(int i)
          Return true if the ith field character is reverse-video.
 boolean isUnderscore()
          Return true if the first field character is underlined.
 boolean isUnderscore(int i)
          Return true if the ith field character is underlined.
 boolean isUniformAttributes()
          Return true if the character attributes (color, highlighting, etc) are the same for each character within this field.
 boolean isVisible()
          Return true if the first character of the field is visible.
 boolean isVisible(int i)
          Return true if the ith character of the field is visible.
protected  boolean isWithinField(int i)
          Tell whether or not this offset is valid (0 <= i < length).
 boolean isWrapAround()
          Return true if this field wraps around on the screen.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenField

public ScreenField(TerminalScreen screen,
                   com.wrq.apptrieve.agent.ScreenFieldPosition pos)
Constructor for internal use only.

Parameters:
screen - screen
pos - pos
Method Detail

getText

public java.lang.String getText()
The screen text for this field.

Returns:
The text for the entire field. Note that when isWrapAround() is true the first getWrapLength() characters of the text should appear at the position getOffset() (or at getRow(), getColumn()). The next (getLength() - getWrapLength()) characters should appear at the top left of the terminal screen.

charAt

public char charAt(int i)
The character at a zero-based offset within the field.

Parameters:
i - zero-based offset within this field.
Returns:
The character at the specified offset within the field.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

getOffset

public int getOffset()
Gets the 0-based start offset for this field.

Returns:
the 0-based start offset for this field

getColumn

public int getColumn()
Gets the 0-based column of the start of this field.

Returns:
the 0-based column of the start of this field

getRow

public int getRow()
Gets the 0-based row of the start of this field.

Returns:
the 0-based row of the start of this field

getLength

public int getLength()
Gets the length of this field.

Returns:
the length of this field

getColor

public int getColor()
Return the color of the first character in this field.

Expected values are:

Returns:
Color value.

getColor

public int getColor(int i)
Return the color of the ith (zero-based) character in this field.

Parameters:
i - Zero-based index within the field for which the color is to be obtained.
Returns:
Color value for specified character within this field.

Expected return values are:

  • AppConnRejuvenationSession.HostRedColor
  • AppConnRejuvenationSession.HostBlueColor
  • AppConnRejuvenationSession.HostPinkColor
  • AppConnRejuvenationSession.HostGreenColor
  • AppConnRejuvenationSession.HostTurquoiseColor
  • AppConnRejuvenationSession.HostYellowColor
  • AppConnRejuvenationSession.HostWhiteColor
  • AppConnRejuvenationSession.StatusLineColor
  • AppConnRejuvenationSession.ProtectedNormalAlphaColor
  • AppConnRejuvenationSession.ProtectedNormalNumericColor
  • AppConnRejuvenationSession.ProtectedHighlightAlphaColor
  • AppConnRejuvenationSession.ProtectedHighlightNumericColor
  • AppConnRejuvenationSession.UnprotectedNormalAlphaColor
  • AppConnRejuvenationSession.UnprotectedNormalNumericColor
  • AppConnRejuvenationSession.UnprotectedHighlightAlphaColor
  • AppConnRejuvenationSession.UnprotectedHighlightNumericColor
  • AppConnRejuvenationSession.StatusLineColor
  • AppConnRejuvenationSession.MessageLineColor
  • AppConnRejuvenationSession.ErrorLineColor
  • AppConnRejuvenationSession.SysRequestColor

Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isInput

public boolean isInput()
Return true if the first character of the field is for input.

Returns:
Flag indicating this is an input field.

isInput

public boolean isInput(int i)
Return true if the ith (zero-based) character of the field is for input.

Parameters:
i - Zero-based character offset within the field.
Returns:
Flag indicating this is the character of an input field.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

hasCursor

public boolean hasCursor()
Determine if the terminal cursor is within this field.

Returns:
true if the terminal cursor is within this field

isNumeric

public boolean isNumeric()
Return true if the first character of the field has numeric attribute.

Returns:
Flag indicating that this is a numeric field.

isNumeric

public boolean isNumeric(int i)
Return true if the ith character of the field has numeric attribute.

Parameters:
i - Zero-based character offset within the field.
Returns:
Flag indicating that this is a character of a numeric field.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isHighIntensity

public boolean isHighIntensity()
Return true if the first character of the field is high intensity. Note: VHI emulation (3270 and 5250) never set this bit.

Returns:
Flag indicating that this is a high-intensity field.

isHighIntensity

public boolean isHighIntensity(int i)
Return true if the ith character of the field is high intensity. Note: VHI emulation (3270 and 5250) never set this bit.

Parameters:
i - Zero-based character offset within the field.
Returns:
Flag indicating that this is a character of a numeric field.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isVisible

public boolean isVisible()
Return true if the first character of the field is visible.

Returns:
Flag indicating that this is a visible field.

isVisible

public boolean isVisible(int i)
Return true if the ith character of the field is visible.

Parameters:
i - Zero-based character offset within the field.
Returns:
Flag indicating that this is a character of a visible field.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isBlink

public boolean isBlink()
Return true if the first character of the field is blinking text.

Returns:
Flag indicating that this is a blinking character.

isBlink

public boolean isBlink(int i)
Return true if the ith character of the field is blinking text.

Parameters:
i - Zero-based character offset within the field.
Returns:
Flag indicating that this is a blinking character.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isColumnSeparated

public boolean isColumnSeparated()
Return true if the first character of the field is column separated (5250).

Returns:
Flag indicating that this is a column-separated character.

isColumnSeparated

public boolean isColumnSeparated(int i)
Return true if the ith character of the field is column separated (5250).

Parameters:
i - Zero-based character offset within the field.
Returns:
Flag indicating that this is a column-separated character.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isPenDetect

public boolean isPenDetect()
Return true if the first field character is lightpen detectable.

Returns:
Flag indicating that this is a pen-detectable field.

isPenDetect

public boolean isPenDetect(int i)
Return true if the ith field character is lightpen detectable.

Parameters:
i - Zero-based character offset within the field.
Returns:
Flag indicating that this is a character in a pen-detectable field.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isReverseVideo

public boolean isReverseVideo()
Return true if the first field character is reverse-video.

Returns:
Flag indicating that this is a reverse-video character.

isReverseVideo

public boolean isReverseVideo(int i)
Return true if the ith field character is reverse-video.

Parameters:
i - Zero-based character offset within the field.
Returns:
Flag indicating that this is a reverse-video character.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isUnderscore

public boolean isUnderscore()
Return true if the first field character is underlined.

Returns:
Flag indicating that this is an underscored character.

isUnderscore

public boolean isUnderscore(int i)
Return true if the ith field character is underlined.

Parameters:
i - Zero-based character offset within the field.
Returns:
Flag indicating that this is an underscored character.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isUniformAttributes

public boolean isUniformAttributes()
Return true if the character attributes (color, highlighting, etc) are the same for each character within this field.

Returns:
Flag indicating that the attributes within this field are uniform.

isWrapAround

public boolean isWrapAround()
Return true if this field wraps around on the screen.

Returns:
Flag indicating that this field wraps the screen.

getWrapLength

public int getWrapLength()
Return number of characters which occur before the field wrap.

Returns:
Number of characters which occur before the field wraps.

isWithinField

protected boolean isWithinField(int i)
Tell whether or not this offset is valid (0 <= i < length).

Parameters:
i - 0-based absolute offset within this field.
Returns:
Flag indicating that the offset value is within this field.

fieldToScreen

protected int fieldToScreen(int i)
Return absolute screen offset from field offset. Handle the case of wrapping. If "i" is in the part of the field that's wrapped the screen fold back onto the beginning of the screen.

Parameters:
i - Zero-based field offset.
Returns:
Zero-based absolute screen offset of the specified field.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object