CICS® Transaction Gateway Programming Reference V3.1

com.ibm.ctg.epi
Class Screen

java.lang.Object
  |
  +--com.ibm.ctg.epi.Screen

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

This class represents a 3270 terminal screen and provides methods to query and set screen information.

See Also:
Serialized Form

Field Summary
(package private)  boolean readMode
          read mode flag - this is set to true when a read buffer command is received so that the Terminal knows to reply to the server
 
Constructor Summary
Screen(int rows, int cols, java.lang.String enc)
          Constructs a screen of the given size.
 
Method Summary
 void analyse(byte[] buffer, int length)
          Converts from 3270 data stream to set of fields
 Field field(int index)
          Get a field by index.
 Field field(int row, int col)
          Get a field by screen position.
 int fieldCount()
          Get the number of fields.
 java.util.Enumeration fields()
          Returns an Enumeration of the fields in the screen.
 int format(byte[] buffer)
          Convert from set of fields into 3270 data stream
 int formatRB(byte[] buffer)
          Convert from set of fields into 3270 data stream for read buffer command
 AID getAID()
          Get the AID that will be sent back to the server
 int getCursorColumn()
          Get the column position of the cursor
 int getCursorRow()
          Get the row position of the cursor
 int getDepth()
          Get the screen depth.
 java.lang.String getEncoding()
          Returns the character encoding that the Screen will use
(package private)  Field getField(int buffAddr)
          Get a field at a given buffer address
 int getWidth()
          Get the screen width.
(package private)  void initList()
          Initialise vector of fields
(package private)  void insertField(Field newfield)
          Insert a field into vector of fields
(package private)  void reset()
          Reset vector of fields
(package private)  void resetFields(int start, int end)
          Reset fields from start and upto but not including the end buffer position
 void setAID(AID aidkey)
          Set the AID that will be sent back to the server
 void setCursor(int row, int column)
          Set the cursor getPosition
(package private)  void setDataStream(com.ibm.ctg.epi.DataStream data)
          Set the DataStream analyzer
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readMode

boolean readMode
read mode flag - this is set to true when a read buffer command is received so that the Terminal knows to reply to the server
Constructor Detail

Screen

public Screen(int rows,
              int cols,
              java.lang.String enc)
Constructs a screen of the given size. You do not need to construct a Screen if you are using the Terminal class.
Parameters:
rows - the number of rows
cols - the number of columns
enc - the character encoding to use, null to use the default
Method Detail

setDataStream

void setDataStream(com.ibm.ctg.epi.DataStream data)
Set the DataStream analyzer
Parameters:
data - an object that implements the DataStream interface

getEncoding

public java.lang.String getEncoding()
Returns the character encoding that the Screen will use
Returns:
the character encoding

analyse

public void analyse(byte[] buffer,
                    int length)
             throws EPIException
Converts from 3270 data stream to set of fields
Parameters:
buffer - 3270 data stream as byte array
length - length of data stream in bytes
Throws:
EPIException - if it is not possible to analyze the data stream

format

public int format(byte[] buffer)
           throws EPIException
Convert from set of fields into 3270 data stream
Parameters:
buffer - byte array to write into
Returns:
the length of the data stream in bytes
Throws:
EPIException - if it is not possible to format the data stream

formatRB

public int formatRB(byte[] buffer)
             throws EPIException
Convert from set of fields into 3270 data stream for read buffer command
Parameters:
buffer - byte array to write into
Returns:
the length of the data stream in bytes
Throws:
EPIException - if it is not possible to format the data stream

initList

void initList()
Initialise vector of fields

reset

void reset()
Reset vector of fields

insertField

void insertField(Field newfield)
Insert a field into vector of fields
Parameters:
newfield - a Field

resetFields

void resetFields(int start,
                 int end)
Reset fields from start and upto but not including the end buffer position
Parameters:
start - the starting buffer position
end - the starting buffer position

getField

Field getField(int buffAddr)
Get a field at a given buffer address
Parameters:
buffAddr - a buffer position
Returns:
the Field, or null if not found

fields

public java.util.Enumeration fields()
Returns an Enumeration of the fields in the screen.
Returns:
Enumeration of fields

field

public Field field(int index)
Get a field by index. Fields are numbered from 1.
Parameters:
index - the index of the field
Returns:
the field or null if not found

field

public Field field(int row,
                   int col)
Get a field by screen position.
Parameters:
row - the row
col - the column
Returns:
the field or null if not found

fieldCount

public int fieldCount()
Get the number of fields.
Returns:
the number of fields

getDepth

public int getDepth()
Get the screen depth.
Returns:
the number of rows on the screen

getWidth

public int getWidth()
Get the screen width.
Returns:
the number of columns on the screen

setAID

public void setAID(AID aidkey)
Set the AID that will be sent back to the server
Parameters:
aidkey - the AID to set

getAID

public AID getAID()
Get the AID that will be sent back to the server
Returns:
the currently set AID

setCursor

public void setCursor(int row,
                      int column)
               throws EPIException
Set the cursor getPosition
Parameters:
row - the cursor row
column - the cursor column
Throws:
EPIException - if the row or column are out of range

getCursorRow

public int getCursorRow()
Get the row position of the cursor
Returns:
the row

getCursorColumn

public int getCursorColumn()
Get the column position of the cursor
Returns:
the column

© Copyright IBM Corp. 1994, 1999