Screen entity
Screen entities are Plain Java Objects used as models for terminal screens.
Each screen entity is defined by four properties:
- Identifiers — unique properties that differentiate this screen from others
- Actions — terminal actions that can be performed on the screen
- Navigation — how to navigate to this screen
- Fields — relationship between a Java field and the exact position on the terminal screen
Identifiers
Specified with @ScreenIdentifiers containing an array of @Identifier. When the telnet session returns a screen, the connector matches it to an entity. Too few identifiers can match the wrong entity; too many slow recognition. Prefer a minimal unique set.
Each @Identifier has row and column, optional attribute (Color, BackColor, Editable, or default Value for text), and Value to compare. Multiple identifiers are AND.
@ScreenEntity
@ScreenIdentifiers(identifiers = {
@Identifier(row = 1, column = 37, value = "Main Menu"),
@Identifier(row = 21, column = 8, value = "true", attribute = FieldAttributeType.Editable)
})
public class MainMenu {
// ...
}
Identifiers can also be added, removed, or edited in the graphical Screen Entity Editor (use the screen preview; prefer static elements such as titles and labels).
Actions
Specified with @ScreenActions containing @Action entries:
- action (mandatory) — keyboard keys such as F1–F12, Enter, Esc
- alias — another name for the action
- displayName — demonstration only
- additionalKey — combined keystroke (for example Shift+F1 for F13)
Navigation
getEntity on the telnet session navigates to a screen and returns it as an entity. Attach @ScreenNavigation:
accessedFrom— entity from which this screen is reachableterminalAction— action to navigate fromaccessedFromexitAction— action to navigate backassignedFields— values to set onaccessedFrombefore navigating (@AssignedField)
At runtime OpenLegacy builds a navigation map. From the current screen it walks exitAction sequences to a common parent, then terminalAction sequences to the requested screen.
Fields
Specified with @ScreenField, mapping a Java field to the exact position of the terminal field on the screen.
See Screens projects and Screens SDK.
Source: Screen Entity (Confluence)
Java model for a 3270/5250 screen: identifiers, actions, navigation, and field positions.