com.sun.emp.pathway.bean
Class TerminalField

java.lang.Object
  extended bycom.sun.emp.pathway.bean.TerminalField
All Implemented Interfaces:
Accessible

public class TerminalField
extends Object
implements Accessible

A representation of a 3270 field.

This class presents a set of methods for obtaining information about a field, along with methods for setting the data in it.

It should be noted that the setting of the data in a field does not affect the 3270 cursor position in the Terminal and does set the MDT for the field.


Field Summary
static int OUTLINE_BOTTOM
           
static int OUTLINE_LEFT
           
static int OUTLINE_NONE
           
static int OUTLINE_RIGHT
           
static int OUTLINE_TOP
           
 
Method Summary
 boolean containsCursor()
          Determines if this field contain the cursor of the Terminal.
 boolean equals(Object obj)
          Determines if this TerminalField object is equal to the specified object.
 AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this TerminalField.
 byte[] getCharAttributes()
          Gets the extended attributes.
 byte[] getCharColors()
          Gets the extended colors.
 byte getCharSet()
          Determines the character set of the field.
 byte getColor()
          Determines the 3270 color of the field.
 int getColumn()
          Gets the column of the start of the field.
 char[] getData()
          Gets a copy of the data associated with this field.
 int getDataLength()
          Gets the length of the data in the field.
 int getFirstCharOffset()
          Gets the offset of the first character in the field (as opposed to the attribute byte).
 int getLastCharOffset()
          Gets the offset of the last character in the field (as opposed to the attribute byte).
 int getLength()
          Gets the field length.
 int getOffset()
          Gets the field offset.
 int getOutlineFlags()
          Returns which edges are outlined on this field.
 int getRow()
          Gets the row of the start of the field.
 String getText()
          Gets a textual representation of the data in the field.
 int hashCode()
           
 boolean isAskip()
          Determines if the field is auto-skip.
 boolean isCursorSelectCapable()
          Determines if the field is cursor select capable.
 boolean isIntense()
          Determines if the field is intense.
 boolean isModified()
          Determines if the field has the MDT set.
 boolean isNumeric()
          Determines if the field is Numeric.
 boolean isOutlinedBottom()
          Determines if the field is outlined on the bottom.
 boolean isOutlinedLeft()
          Determines if the field is outlined on the left.
 boolean isOutlinedRight()
          Determines if the field is outlined on the right.
 boolean isOutlinedTop()
          Determines if the field is outlined on the top.
 boolean isProtected()
          Determines if the field is protected.
 boolean isSOSI()
          Determines if the field allows the user to enter SOSI data.
 boolean isVisible()
          Determines if the field is visible.
 void setData(char[] newData)
          Sets the data in the field to the data provided.
 void setText(String theText)
          Sets the value of the field from a String.
 String toString()
          Creates a string representation of this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OUTLINE_NONE

public static final int OUTLINE_NONE
See Also:
Constant Field Values

OUTLINE_BOTTOM

public static final int OUTLINE_BOTTOM
See Also:
Constant Field Values

OUTLINE_RIGHT

public static final int OUTLINE_RIGHT
See Also:
Constant Field Values

OUTLINE_TOP

public static final int OUTLINE_TOP
See Also:
Constant Field Values

OUTLINE_LEFT

public static final int OUTLINE_LEFT
See Also:
Constant Field Values
Method Detail

getAccessibleContext

public AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this TerminalField.

Specified by:
getAccessibleContext in interface Accessible
Since:
2.0.0 p2

getOutlineFlags

public int getOutlineFlags()
Returns which edges are outlined on this field.

Returns:
an int representing the outline state of the field. This correlates to the 'or'ing of 1 or more of the OUTLINE constant values defined in this class.
See Also:
isOutlinedTop(), isOutlinedBottom(), isOutlinedLeft(), isOutlinedRight()

isOutlinedTop

public boolean isOutlinedTop()
Determines if the field is outlined on the top.

Returns:
true if the field is outlined on the top.
See Also:
getOutlineFlags(), isOutlinedBottom(), isOutlinedLeft(), isOutlinedRight()

isOutlinedBottom

public boolean isOutlinedBottom()
Determines if the field is outlined on the bottom.

Returns:
true if the field is outlined on the bottom.
See Also:
getOutlineFlags(), isOutlinedTop(), isOutlinedLeft(), isOutlinedRight()

isOutlinedLeft

public boolean isOutlinedLeft()
Determines if the field is outlined on the left.

Returns:
true if the field is outlined on the left.
See Also:
getOutlineFlags(), isOutlinedTop(), isOutlinedBottom(), isOutlinedRight()

isOutlinedRight

public boolean isOutlinedRight()
Determines if the field is outlined on the right.

Returns:
true if the field is outlined on the right.
See Also:
getOutlineFlags(), isOutlinedTop(), isOutlinedBottom(), isOutlinedLeft()

getOffset

public int getOffset()
Gets the field offset.

Returns:
the offset.
See Also:
getRow(), getColumn()

getLength

public int getLength()
Gets the field length. This length includes the attribute byte.

Returns:
the length.

getRow

public int getRow()
Gets the row of the start of the field. This is the row of the attribute byte, rather than the first 'usable' character in the field.

Returns:
the row.
See Also:
getColumn(), getOffset()

getColumn

public int getColumn()
Gets the column of the start of the field. This is the column of the attribute byte, rather than the first 'usable' character in the field.

Returns:
the column.
See Also:
getRow(), getOffset()

getDataLength

public int getDataLength()
Gets the length of the data in the field. This does not include the attribute byte.

Returns:
the length.

isProtected

public boolean isProtected()
Determines if the field is protected.

Returns:
true if the field is protected.

isIntense

public boolean isIntense()
Determines if the field is intense.

Returns:
true if the field is intense.

isVisible

public boolean isVisible()
Determines if the field is visible.

Returns:
true if the field is visible.

isSOSI

public boolean isSOSI()
Determines if the field allows the user to enter SOSI data.

Returns:
true if SOSI data is allowed.

isModified

public boolean isModified()
Determines if the field has the MDT set.

Returns:
true if the MDT is set.

isNumeric

public boolean isNumeric()
Determines if the field is Numeric.

Returns:
true if the field is numeric.

isAskip

public boolean isAskip()
Determines if the field is auto-skip. An auto-skip field is defined by being both protected and numeric.

Returns:
true if it is auto-skip.

isCursorSelectCapable

public boolean isCursorSelectCapable()
Determines if the field is cursor select capable.

Returns:
true if it is cursor select capable.

getColor

public byte getColor()
Determines the 3270 color of the field.

Returns:
the color of the field as one of the constants defined in the Terminal class.
See Also:
Terminal

getCharSet

public byte getCharSet()
Determines the character set of the field.

Returns:
the character set of the field. This is the 3270 datastream defined value for the character set.

getData

public char[] getData()
Gets a copy of the data associated with this field.

Returns:
the data.
See Also:
setData(char[]), getDataLength()

setData

public void setData(char[] newData)
Sets the data in the field to the data provided. The data provided must be the same length as the getDataLength() method returns. The MDT also gets set.

Parameters:
newData - the data.
Throws:
NullPointerException - if newData is null.
IllegalArgumentException - if newData is not equal in length to the value returned by getDataLength().
IllegalStateException - if the field is protected.
See Also:
getData(), getDataLength()

getText

public String getText()
Gets a textual representation of the data in the field. All of the nulls in the field are removed, and the other data is placed in a String.

See Also:
setText(java.lang.String)

setText

public void setText(String theText)
Sets the value of the field from a String.

Parameters:
theText - the text.
Throws:
NullPointerException - if theText is null.
IllegalArgumentException - if the text is too long for the field.
IllegalStateException - if the field is protected.
See Also:
getText()

getCharAttributes

public byte[] getCharAttributes()
Gets the extended attributes. This is an array of extended attributes, one for each location in the field.

Returns:
the attributes.

getCharColors

public byte[] getCharColors()
Gets the extended colors.

Returns:
the colors.

getFirstCharOffset

public int getFirstCharOffset()
Gets the offset of the first character in the field (as opposed to the attribute byte).

Returns:
the offset.
See Also:
getLastCharOffset()

getLastCharOffset

public int getLastCharOffset()
Gets the offset of the last character in the field (as opposed to the attribute byte).

Returns:
the offset.
See Also:
getFirstCharOffset()

toString

public String toString()
Creates a string representation of this object.

Returns:
a String representation.

containsCursor

public boolean containsCursor()
Determines if this field contain the cursor of the Terminal.


equals

public boolean equals(Object obj)
Determines if this TerminalField object is equal to the specified object.

Parameters:
obj - the reference object with which to compare
Returns:
true if and only if the argument is a TerminalField object which represents the same TerminalField as this object.

hashCode

public int hashCode()