no.gar.glink.api
Class GlinkField

java.lang.Object
  extended by no.gar.glink.api.GlinkField

public class GlinkField
extends java.lang.Object

A field is the fundamental element of a virtual screen. A field includes both data and attributes describing the field. The GlinkField class encapsulates a virtual screen field and provides methods for accessing and manipulating field attributes and data.

GlinkField objects can be accessed only through the GlinkFields object.

See Also:
GlinkFields

Field Summary
static int ATR_BLINK
           
static int ATR_FIELD_ALPHABETIC
           
static int ATR_FIELD_ATTRIBUTE
           
static int ATR_FIELD_DIGITAL
           
static int ATR_FIELD_IBM_PEN
           
static int ATR_FIELD_MUST_ENTER
           
static int ATR_FIELD_MUST_FILL
           
static int ATR_FIELD_NUMERIC
           
static int ATR_FIELD_RIGHT_JUSTIFY
           
static int ATR_HIDDEN
           
static int ATR_INVERSE
           
static int ATR_UNDERLINE
           
static int ATR_UNPROTECTED
           
 
Constructor Summary
GlinkField(java.lang.Object object, int fldAtrVa, java.awt.Point start, java.awt.Point end)
           
 
Method Summary
 int getAttribute()
          Returns the the attribute for the field.
 int[] getAttributes()
          Returns an attribute array for the characters in the field.
 byte[] getDataBytes()
          Returns the screen characters (bytes) for the field in the character set used internally by Glink.
 char[] getDataChars()
          Returns the screen characters for the field.
 java.awt.Point getEnd()
          Returns the ending position of the field.
 int getLength()
          Returns the length of the field.
 java.awt.Point getStart()
          Returns the starting position of the field.
 java.lang.String getString()
          Returns the field text.
 boolean isHidden()
          Indicates whether or not the field is hidden.
 boolean isHighIntensity()
          Indicates whether or not the field is high-intensity.
 boolean isModified()
          Indicates whether or not the field has been modified.
 boolean isNumeric()
          Indicates whether or not the field is numeric-only.
 boolean isProtected()
          Indicates whether or not the field is protected.
 boolean isUpperCase()
          Indicates whether or not the input field is uppercase only.
 void setDataBytes(byte[] bytes)
          Sets the field text to the specified bytes in the character set used internally by Glink.
 void setString(java.lang.String text)
          Sets the field text to the specified Unicode string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATR_BLINK

public static final int ATR_BLINK
See Also:
Constant Field Values

ATR_FIELD_ALPHABETIC

public static final int ATR_FIELD_ALPHABETIC
See Also:
Constant Field Values

ATR_FIELD_ATTRIBUTE

public static final int ATR_FIELD_ATTRIBUTE
See Also:
Constant Field Values

ATR_FIELD_DIGITAL

public static final int ATR_FIELD_DIGITAL
See Also:
Constant Field Values

ATR_FIELD_IBM_PEN

public static final int ATR_FIELD_IBM_PEN
See Also:
Constant Field Values

ATR_FIELD_MUST_ENTER

public static final int ATR_FIELD_MUST_ENTER
See Also:
Constant Field Values

ATR_FIELD_MUST_FILL

public static final int ATR_FIELD_MUST_FILL
See Also:
Constant Field Values

ATR_FIELD_NUMERIC

public static final int ATR_FIELD_NUMERIC
See Also:
Constant Field Values

ATR_FIELD_RIGHT_JUSTIFY

public static final int ATR_FIELD_RIGHT_JUSTIFY
See Also:
Constant Field Values

ATR_HIDDEN

public static final int ATR_HIDDEN
See Also:
Constant Field Values

ATR_INVERSE

public static final int ATR_INVERSE
See Also:
Constant Field Values

ATR_UNDERLINE

public static final int ATR_UNDERLINE
See Also:
Constant Field Values

ATR_UNPROTECTED

public static final int ATR_UNPROTECTED
See Also:
Constant Field Values
Constructor Detail

GlinkField

public GlinkField(java.lang.Object object,
                  int fldAtrVa,
                  java.awt.Point start,
                  java.awt.Point end)
Method Detail

getAttribute

public int getAttribute()
Returns the the attribute for the field.

Returns:
The raw field attribute.

Bit Position Description
0-3 Foreground colors
4-6 Background colors
7 Underline
8 Reserved
9 Reserved
10 Blink
11 Reserved
12 Reserved
13 Reserved
14 Reserved
15 Inverse
16 Field, must enter
17 Field, must fill
18 Field, right justify
19 Field, Alpha character
20 Field, Numeric
21 Field, digital
22 Field, IBM Pen selectable
23 Hidden
24 Reserved
25 Reserved
26 Reserved
27 Reserved
28 Field, modified
29 Reserved
30 Unprotected
31 Field flag

getAttributes

public int[] getAttributes()
Returns an attribute array for the characters in the field. For 3270 and 5250 the attribute byte itself preceding the field is not included. Use the getAttribute method to get that attribute.

Returns:
A integer array containing the attributes for the characters in the field
See Also:
Attribute format.

getDataBytes

public byte[] getDataBytes()
Returns the screen characters (bytes) for the field in the character set used internally by Glink.

See Also:
getString()

getDataChars

public char[] getDataChars()
Returns the screen characters for the field.

See Also:
getString()

getEnd

public java.awt.Point getEnd()
Returns the ending position of the field. The position can range from 1 to the size of the presentation space. The ending position of a field is the position of the last character in the field.

Returns:
The ending position of the field.

getLength

public int getLength()
Returns the length of the field. A field's length can range from 1 to the size of the presentation space.

Returns:
The length of the field.

getStart

public java.awt.Point getStart()
Returns the starting position of the field. The position can range from 1 to the size of the virtual screen. The starting position of a field is the position of the first character in the field.

Returns:
The starting position of the field.

getString

public java.lang.String getString()
Returns the field text. The text is converted from the character set used internally by Glink to Unicode.

Returns:
The text content of the field returned as a string
See Also:
getDataBytes(), GlinkApi.getScreenCharacterSet()

isHidden

public boolean isHidden()
Indicates whether or not the field is hidden.

Returns:
True if the field is hidden, otherwise false.

isHighIntensity

public boolean isHighIntensity()
Indicates whether or not the field is high-intensity.

Returns:
True if the field is high intensity, otherwise false.

isModified

public boolean isModified()
Indicates whether or not the field has been modified.

Returns:
True if the field has been modified, otherwise false.

isNumeric

public boolean isNumeric()
Indicates whether or not the field is numeric-only.

Returns:
True if the field is numeric only, otherwise false.

isProtected

public boolean isProtected()
Indicates whether or not the field is protected.

Returns:
True if the field is protected, otherwise false.

isUpperCase

public boolean isUpperCase()
Indicates whether or not the input field is uppercase only.

Returns:
True if the input field allows uppercase only.

setDataBytes

public void setDataBytes(byte[] bytes)
Sets the field text to the specified bytes in the character set used internally by Glink. If the length of the array is shorter than the length of the field, the rest of the field is cleared. If the array is longer than the field, the text is truncated. A subsequent call to getDataBytes or getString on this field will not show the changed text. To see the changed text, do a refresh on the GlinkFields collection and retrieve the refreshed field object.

Parameters:
bytes - The text to be placed in the field's text plane.

setString

public void setString(java.lang.String text)
Sets the field text to the specified Unicode string. If the string is shorter than the length of the field, the rest of the field is cleared. If the string is longer than the field, the text is truncated. A subsequent call to getText on this field will not show the changed text. To see the changed text, do a refresh on the GlinkFields collection and retrieve the refreshed field object.

Parameters:
text - The text to be placed in the field's text plane.
See Also:
GlinkApi.getScreenCharacterSet()