Class gz390

All Implemented Interfaces:
ActionListener, ComponentListener, FocusListener, KeyListener, MouseListener, EventListener

gz390 is the GUAM/GUI component of z390
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      variable
      See Also:
    • max_cmd

      int max_cmd
      variable
    • max_keys

      int max_keys
      variable
    • max_rows

      int max_rows
      variable
    • max_cols

      int max_cols
      variable
    • max_addr

      int max_addr
      variable
    • bg_color

      Color bg_color
      variable
    • text_color

      Color text_color
      variable
    • tn_color

      Color[] tn_color
      variable
    • max_fud

      int max_fud
      variable
    • max_buff

      int max_buff
      variable
    • tz390

      tz390 tz390
      variable
    • tn_scn

      gz390_screen tn_scn
      variable
    • graph_scn

      gz390_screen graph_scn
      variable
    • startup_cmd_file

      String startup_cmd_file
      variable
    • first_user_parm

      int first_user_parm
      variable
    • hex_base

      int hex_base
      variable
    • echo_cmd

      boolean echo_cmd
      variable
    • console_log

      boolean console_log
      variable
    • gz390_errors

      int gz390_errors
      variable
    • cmd_error

      boolean cmd_error
      variable
    • main_title

      String main_title
      variable
    • check_perms

      boolean check_perms
      variable
    • perm_file_user_dir

      boolean perm_file_user_dir
      variable
    • perm_file_read

      boolean perm_file_read
      variable
    • perm_file_write

      boolean perm_file_write
      variable
    • perm_file_execute

      boolean perm_file_execute
      variable
    • perm_runtime_thread

      boolean perm_runtime_thread
      variable
    • perm_file_log

      boolean perm_file_log
      variable
    • perm_select

      boolean perm_select
      variable
    • main_demo

      boolean main_demo
      variable
    • main_lic

      boolean main_lic
      variable
    • mode_msg1

      String mode_msg1
      variable
    • mode_msg2

      String mode_msg2
      variable
    • lic_end_date

      Date lic_end_date
      variable
    • cur_date

      Date cur_date
      variable
    • mmddyy

      variable
    • hhmmss

      variable
    • ins_count

      int ins_count
      variable
    • io_count

      int io_count
      variable
    • start_cmd_io_count

      int start_cmd_io_count
      variable
    • start_cmd_time

      long start_cmd_time
      variable
    • monitor_timer

      Timer monitor_timer
      variable
    • monitor_wait

      int monitor_wait
      variable
    • monitor_timeout_limit

      int monitor_timeout_limit
      variable
    • monitor_cmd_time_total

      long monitor_cmd_time_total
      variable
    • monitor_last_time

      long monitor_last_time
      variable
    • monitor_next_time

      long monitor_next_time
      variable
    • monitor_cur_interval

      long monitor_cur_interval
      variable
    • monitor_last_ins_count

      int monitor_last_ins_count
      variable
    • monitor_next_ins_count

      int monitor_next_ins_count
      variable
    • monitor_last_io_count

      int monitor_last_io_count
      variable
    • monitor_next_io_count

      int monitor_next_io_count
      variable
    • monitor_cur_ins

      long monitor_cur_ins
      variable
    • monitor_cur_int

      long monitor_cur_int
      variable
    • monitor_cur_rate

      long monitor_cur_rate
      variable
    • monitor_last_cmd_mode

      boolean monitor_last_cmd_mode
      variable
    • guam_view_mcs

      int guam_view_mcs
      variable
    • guam_view_screen

      int guam_view_screen
      variable
    • guam_view_graph

      int guam_view_graph
      variable
    • guam_view

      int guam_view
      variable
    • guam_tot_key

      int guam_tot_key
      variable
    • guam_next_key

      int guam_next_key
      variable
    • guam_key_code_char

      int[] guam_key_code_char
      variable
    • guam_cur_row

      int guam_cur_row
      variable
    • guam_cur_col

      int guam_cur_col
      variable
    • status_visible

      boolean status_visible
      variable
    • status_interval

      int status_interval
      variable
    • status_last_time

      long status_last_time
      variable
    • status_next_time

      long status_next_time
      variable
    • status_last_ins_count

      int status_last_ins_count
      variable
    • status_next_ins_count

      int status_next_ins_count
      variable
    • status_next_io_count

      int status_next_io_count
      variable
    • status_last_io_count

      int status_last_io_count
      variable
    • status_cur_ins

      long status_cur_ins
      variable
    • status_cur_int

      long status_cur_int
      variable
    • status_cur_rate

      long status_cur_rate
      variable
    • wtor_running

      boolean wtor_running
      variable
    • wtor_thread

      Thread wtor_thread
      variable
    • wtor_reply_string

      String wtor_reply_string
      variable
    • wtor_ecb_addr

      int wtor_ecb_addr
      variable
    • cmd_line

      String cmd_line
      variable
    • shutdown_exit

      boolean shutdown_exit
      variable
    • tpg_rc

      int tpg_rc
      variable
    • tpg_flags

      int tpg_flags
      variable
    • tpg_op_mask

      int tpg_op_mask
      variable
    • tpg_op_tget

      int tpg_op_tget
      variable
    • tpg_op_tput

      int tpg_op_tput
      variable
    • tpg_wait_mask

      int tpg_wait_mask
      variable
    • tpg_wait

      int tpg_wait
      variable
    • tpg_nowait

      int tpg_nowait
      variable
    • tpg_type

      int tpg_type
      variable
    • tpg_type_mask

      int tpg_type_mask
      variable
    • tpg_type_edit

      int tpg_type_edit
      variable
    • tpg_type_asis

      int tpg_type_asis
      variable
    • tpg_type_control

      int tpg_type_control
      variable
    • tpg_type_fullscr

      int tpg_type_fullscr
      variable
    • tget_byte

      byte[] tget_byte
      variable
    • tget_buff

      ByteBuffer tget_buff
      variable
    • tget_index

      int tget_index
      variable
    • tget_len

      int tget_len
      variable
    • tput_byte

      byte[] tput_byte
      variable
    • tput_buff

      ByteBuffer tput_buff
      variable
    • tput_index

      int tput_index
      variable
    • tput_len

      int tput_len
      variable
    • tput_buff_byte

      int tput_buff_byte
      variable
    • tn_tab_code

      byte tn_tab_code
      variable
    • tn_pa1_code

      byte tn_pa1_code
      variable
    • tn_pa2_code

      byte tn_pa2_code
      variable
    • tn_pa3_code

      byte tn_pa3_code
      variable
    • tn_clear_code

      byte tn_clear_code
      variable
    • tn_enter_code

      byte tn_enter_code
      variable
    • tn_sba_cmd

      byte tn_sba_cmd
      variable
    • tn_sf_cmd

      byte tn_sf_cmd
      variable
    • tn_ic_cmd

      byte tn_ic_cmd
      variable
    • tn_pt_cmd

      byte tn_pt_cmd
      variable
    • tn_ra_cmd

      byte tn_ra_cmd
      variable
    • tn_eua_cmd

      byte tn_eua_cmd
      variable
    • tn_sa_cmd

      byte tn_sa_cmd
      variable
    • tn_sfe_cmd

      byte tn_sfe_cmd
      variable
    • tn_delete_request

      boolean tn_delete_request
      variable
    • tn_cursor

      boolean tn_cursor
      variable
    • tn_cursor_alt

      boolean tn_cursor_alt
      variable
    • tn_cursor_sym

      char tn_cursor_sym
      variable
    • tn_cursor_sym_alt

      char tn_cursor_sym_alt
      variable
    • ff_char

      char ff_char
      variable
    • tn_cursor_scn_addr

      int tn_cursor_scn_addr
      variable
    • tn_cursor_count

      int tn_cursor_count
      variable
    • tn_cursor_wait_int

      int tn_cursor_wait_int
      variable
    • scn_null

      char scn_null
      variable
    • tn_full_screen

      boolean tn_full_screen
      variable
    • tn_null

      byte tn_null
      variable
    • tn_field

      byte tn_field
      variable
    • tn_char

      byte tn_char
      variable
    • tn_protect_mask

      int tn_protect_mask
      variable
    • tn_numeric_mask

      int tn_numeric_mask
      variable
    • tn_mdt_mask

      int tn_mdt_mask
      variable
    • tn_mdt_off

      int tn_mdt_off
      variable
    • tn_noaid

      int tn_noaid
      variable
    • tn_aid

      int tn_aid
      variable
    • tn_esc

      int tn_esc
      variable
    • tn_write_cmd

      int tn_write_cmd
      variable
    • tn_write

      int tn_write
      variable
    • tn_erase_write

      int tn_erase_write
      variable
    • tn_write_alt

      int tn_write_alt
      variable
    • tn_write_eau

      int tn_write_eau
      variable
    • tn_attr_prot_text

      byte tn_attr_prot_text
      variable
    • tn_kb_lock

      boolean tn_kb_lock
      variable
    • tn_scn_lock

      boolean tn_scn_lock
      variable
    • tn_attn

      boolean tn_attn
      variable
    • cur_fld_addr

      int cur_fld_addr
      variable
    • cur_fld_attr

      int cur_fld_attr
      variable
    • fld_attr_hl

      int fld_attr_hl
      variable
    • fld_attr_nd

      int fld_attr_nd
      variable
    • cur_fld_hl

      int cur_fld_hl
      variable
    • cur_fld_color

      int cur_fld_color
      variable
    • fld_tot

      int fld_tot
      variable
    • fld_addr

      int[] fld_addr
      variable
    • fld_mdt_tot

      int fld_mdt_tot
      variable
    • fld_mdt_addr

      int[] fld_mdt_addr
      variable
    • scn_fld

      boolean[] scn_fld
      variable
    • scn_attr

      int[] scn_attr
      variable
    • scn_hl

      int[] scn_hl
      variable
    • scn_color

      int[] scn_color
      variable
    • scn_char

      char[] scn_char
      variable
    • scn_addr

      int scn_addr
      variable
    • sba_to_ebc

      int[] sba_to_ebc
      variable
    • ebc_to_sba

      int[] ebc_to_sba
      variable
    • ascii_lf

      int ascii_lf
      variable
    • ascii_cr

      int ascii_cr
      variable
    • ebcdic_space

      int ebcdic_space
      variable
    • refresh_wait

      boolean refresh_wait
      variable
    • refresh_request

      boolean refresh_request
      variable
    • main_status

      boolean main_status
      variable
    • main_view_changed

      boolean main_view_changed
      variable
    • main_frame

      JFrame main_frame
      variable
    • main_border

      int main_border
      variable
    • start_bar_height

      int start_bar_height
      variable
    • main_loc_x

      int main_loc_x
      variable
    • main_loc_y

      int main_loc_y
      variable
    • scrollbar_width

      int scrollbar_width
      variable
    • font_space

      int font_space
      variable
    • font_size

      int font_size
      variable
    • char_font

      Font char_font
      variable
    • title_height

      int title_height
      variable
    • log_char_height

      int log_char_height
      variable
    • tool_height

      int tool_height
      variable
    • lines_per_page

      int lines_per_page
      variable
    • log_height

      int log_height
      variable
    • log_width

      int log_width
      variable
    • command_height

      int command_height
      variable
    • command_columns

      int command_columns
      variable
    • status_height

      int status_height
      variable
    • labels_visible

      boolean labels_visible
      variable
    • labels_min_width

      int labels_min_width
      variable
    • labels_max_font

      int labels_max_font
      variable
    • label_width

      int label_width
      variable
    • main_panel

      JPanel main_panel
      variable
    • log_text

      JTextArea log_text
      variable
    • main_view

      JScrollPane main_view
      variable
    • cmd_label

      JLabel cmd_label
      variable
    • gz390_cmd_line

      JTextField gz390_cmd_line
      variable
    • status_line_label

      JLabel status_line_label
      variable
    • status_line

      JTextField status_line
      variable
    • status_line_view

      String status_line_view
      variable
    • cur_cmd

      int cur_cmd
      variable
    • last_cmd

      int last_cmd
      variable
    • view_cmd

      int view_cmd
      variable
    • cmd_history

      String[] cmd_history
      variable
    • graph_grid

      JTextArea graph_grid
      variable
    • opt_tn3270

      boolean opt_tn3270
      variable
    • opt_graph

      boolean opt_graph
      variable
    • opt_mcs

      boolean opt_mcs
      variable
    • file_menu

      JMenu file_menu
      variable
    • edit_menu

      JMenu edit_menu
      variable
    • view_menu

      JMenu view_menu
      variable
    • help_menu

      JMenu help_menu
      variable
    • file_menu_exit

      JMenuItem file_menu_exit
      variable
    • edit_menu_cut

      JMenuItem edit_menu_cut
      variable
    • edit_menu_copy

      JMenuItem edit_menu_copy
      variable
    • edit_menu_paste

      JMenuItem edit_menu_paste
      variable
    • edit_menu_select_all

      JMenuItem edit_menu_select_all
      variable
    • edit_menu_copy_log

      JMenuItem edit_menu_copy_log
      variable
    • edit_menu_notepad

      JMenuItem edit_menu_notepad
      variable
    • view_menu_mcs

      JCheckBoxMenuItem view_menu_mcs
      variable
    • view_menu_tn3270

      JCheckBoxMenuItem view_menu_tn3270
      variable
    • view_menu_graph

      JCheckBoxMenuItem view_menu_graph
      variable
    • help_menu_help

      JMenuItem help_menu_help
      variable
    • help_menu_support

      JMenuItem help_menu_support
      variable
    • help_menu_about

      JMenuItem help_menu_about
      variable
    • focus_comp

      Component focus_comp
      variable
    • apl_char

      char[] apl_char
      variable
  • Constructor Details

    • gz390

      public gz390()
      Dummy constructor - no initialization needed
  • Method Details

    • main

      public static void main(String[] args)
      Create instance of gz390 class
      Parameters:
      args - argument string - same as z390
    • set_main_mode

      private int set_main_mode(String[] args)
      Set main program execution mode and Set security permissions
      Notes:
      1. called from main or init before gz390 instance started so only set class variables.
      Parameters:
      args - argument string
      Returns:
      number
    • log_error

      private void log_error(int error, String msg)
      Log error message
      Parameters:
      error - number
      msg - message text`
    • abort_error

      private void abort_error(int error, String msg)
      Abort with error
      Parameters:
      error - error code
      msg - error message text
    • shut_down

      private void shut_down(int return_code)
      cancel threads and exit with rc (turn off runtime shutdown exit
      Parameters:
      return_code - return code
    • process_command

      private void process_command(String cmd_line)
      1. parse parms and execute gz390 command if found.
        • * in position 1 is a comment
        • space or null logged as blank line
      2. If not a known gz390 command, issue CMD Windows command.
      Notes:
      1. gz390_cmd_line event handler routes input to CMD processor when in cmd_mode.
      2. Some commands will issue retry or cancel error message if command running on separate thread to avoid file conflicts or deadlocks. Other non destructive commands will proceed in parallel which may cause log messages to be intermixed.
      3. Status bar shows progress of command processes on separate threads.
      4. Use EXIT or BREAK event to abort CMD process. Ctrl-C works in command mode only.
      Parameters:
      cmd_line - command to be processed
    • add_cmd_hist

      private void add_cmd_hist()
      add command cmd_line to rolling history
    • get_prev_cmd

      private void get_prev_cmd()
      restore prev cmd to gz390_cmd_line
    • get_next_cmd

      private void get_next_cmd()
      restore next cmd to gz390_cmd_line
    • get_next_parm

      private String get_next_parm(StringTokenizer st, boolean ignore_spaces)
      get string with or without single/double quotes. ignore leading spaces or commas if ignore_spaces = true, else return null if space or comma found next.
      Parameters:
      st - StringTokenizer instance
      ignore_spaces - yes/no indicator
      Returns:
      next token as a string value
    • about_command

      private void about_command()
      Display copyright notice
    • font_command

      private void font_command(int new_font_size)
      reset font size
      Parameters:
      new_font_size - integer between 8 and 72 inclusive
    • set_text_font

      private void set_text_font()
      reset font size for menu, log, cmd and status line
    • help_command

      private void help_command()
      log summary list of commands and help reference
    • monitor_startup

      private void monitor_startup()
      start monitor to terminate cmd command if timeout limit reached
    • monitor_update

      private void monitor_update()
      1. At monitor_wait intervals, update the GUAM GUI title date and time and the status line information.
      2. Update TN3270 screen from key typed buffer
      3. reset focus to gz390_cmd_line after wto
    • init_tn3270_screen

      private void init_tn3270_screen()
      init first time or if rows spec.
    • init_gz390

      private void init_gz390(String[] args)
      Init graphical user interface
      Parameters:
      args - argument string
    • build_main_panel

      private void build_main_panel()
      Build the main panel with:
      1. Scrolling log display
      2. command entry field
    • exit_main

      private void exit_main(int rc)
      terminate
      Parameters:
      rc - returncode
    • set_char_font

      private void set_char_font()
      initialize tn3270 screen fonts using current font size
    • set_guam_size

      private void set_guam_size()
      calculate GUAM GUI object sizes based on sreen size and font size
    • build_log_view

      private void build_log_view()
      build scrolling log view based on current screen and font size
    • build_gz390_cmd_line

      private void build_gz390_cmd_line()
      Build the command entry field
    • build_status_line

      private void build_status_line()
      Build the statuts line
    • build_menu_items

      private void build_menu_items()
      Build the menu bar
    • set_tooltips

      private void set_tooltips()
      set tooltips after font changes
    • title_update

      private void title_update()
      update main frame title with current date and time.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Perform menu and command line requests
      Specified by:
      actionPerformed in interface ActionListener
    • time_stamp

      private String time_stamp()
      return date and time if opt_timing
      Returns:
      formatted timestamp
    • exec_guam_command

      private void exec_guam_command()
      exec command
    • reset_gz390_cmd

      private void reset_gz390_cmd()
      reset gz390_cmd text and set focus
    • exec_cmd

      private boolean exec_cmd(String cmd)
      exec command as separate task
      Parameters:
      cmd - command string
      Returns:
      boolean indicator of success
    • getClipboard

      public static String getClipboard()
      Get string text from system clipboard
      Returns:
      string holding text from keyboard
    • setClipboard

      public static void setClipboard(String str)
      put string to system clipboard
      Parameters:
      str - string to be copied to clipboard
    • keyPressed

      public void keyPressed(KeyEvent e)
      Handle key pressed events
      Specified by:
      keyPressed in interface KeyListener
      Parameters:
      e - KeyEvent instance
    • process_action_key_pressed

      private void process_action_key_pressed(int key_code, int key_mods, KeyEvent e)
      process action key after processing any pending typed keys
      Parameters:
      key_code - number
      key_mods - number
      e - keyEvent instance
    • process_non_action_key_pressed

      private void process_non_action_key_pressed(int key_code, int key_mods, KeyEvent e)
      process enter, cancel, backspace, and delete (the rest are handled by keytyped
      Parameters:
      key_code - number
      key_mods - number
      e - KeyEvent Instance
    • process_cancel_key

      private void process_cancel_key()
      cancel cmd, or GUAM GUI cmd in response to F3 or Ctrl-Break
    • keyTyped

      public void keyTyped(KeyEvent e)
      Handle key typed events collect any characters for accept which are placed in gz390_cmd_line by accept wait loop if not there already.
      Specified by:
      keyTyped in interface KeyListener
      Parameters:
      e - KeyEvent
    • process_typed_keys

      public void process_typed_keys()
      process pending typed keys on monitor thread in ez390 and for all action keys.
    • keyReleased

      public void keyReleased(KeyEvent e)
      Handle key released events
      Specified by:
      keyReleased in interface KeyListener
    • displayInfo

      protected void displayInfo(KeyEvent e, String s)
      Display key event info
      Parameters:
      e - KeyEvent instance
      s - identifier for the diagnostic output
    • mousePressed

      public void mousePressed(MouseEvent e)
      Popup edit menu on right mouse ck
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      e - MouseEvent instance
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Mouse Release handler
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      e - MouseEvent instance
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Mouse Entry handler
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      e - MouseEvent instance
    • mouseExited

      public void mouseExited(MouseEvent e)
      Mouse Exit handler
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      e - MouseEvent instance
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Mouse Click handler
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      e - MouseEvent instance
    • focusLost

      public void focusLost(FocusEvent e)
      last component to lose focus (ignored for now)
      Specified by:
      focusLost in interface FocusListener
      Parameters:
      e - FocusEvent instance
    • focusGained

      public void focusGained(FocusEvent e)
      Specified by:
      focusGained in interface FocusListener
    • exit_command

      private void exit_command()
      abort command if runnung and turn off cmd_mode If no command running and not cmd_mode, then exit gz390.
    • createImageIcon

      protected static ImageIcon createImageIcon(String path, String description)
      Create Image Icon
      Parameters:
      path - path to use
      description - descriptive text
      Returns:
      ImageIcon instance
    • check_main_view

      private void check_main_view()
      1. If screen not ready, exit
      2. If delete key pending, do it now
      3. If cursor active, update it now
      4. If main window size has changed due to user streching without window event handler triggering update, do it now.
    • process_delete_key

      private void process_delete_key()
      shift input field left 1 char to end if not at null char.
    • update_main_view

      private void update_main_view()
      update main_view and command line size following change in window size
    • set_view_mcs

      private void set_view_mcs()
      display mcs scrolling wto/wtor panel
    • set_view_screen

      private void set_view_screen(int rows, int cols, int color)
      build screen view based on current screen and font size Notes:
      1. Purge and redefine main_panel with new main_view
      2. Turn off focus subsystem to see tab key
      3. Display "Screen View on status line.
      Parameters:
      rows - nr of rows
      cols - nr of columns
      color - nr
    • set_view_graph

      private void set_view_graph(int x, int y, int color)
      display graph for QUAM GKS commands
      Parameters:
      x - horizontal position
      y - vertical position
      color - nr
    • set_main_view

      private void set_main_view(int view_type)
      redefine main_view scrolling pane
      Parameters:
      view_type - number
    • set_main_view_mcs

      private void set_main_view_mcs()
      set guam dialog window to show mcs log
    • set_main_view_screen

      private void set_main_view_screen()
      adjust font to show full TN3270 screen in current window space.
    • set_main_view_graph

      private void set_main_view_graph()
      set guam dialog window to show TN3270 screen using current main window size (max require scrolling to see entrie screen)
    • rebuild_main_panel

      private void rebuild_main_panel()
      rebuild main_panel with current main_view, gz390_cmd and status lines with or without labels to fix current main_panel size.
    • componentHidden

      public void componentHidden(ComponentEvent e)
      Component Hidden event handler
      Specified by:
      componentHidden in interface ComponentListener
      Parameters:
      e - ComponentEvent instance
    • componentMoved

      public void componentMoved(ComponentEvent e)
      Component Moved event handler
      Specified by:
      componentMoved in interface ComponentListener
      Parameters:
      e - ComponentEvent instance
    • componentResized

      public void componentResized(ComponentEvent e)
      Component Resized event handler
      Specified by:
      componentResized in interface ComponentListener
      Parameters:
      e - ComponentEvent instance
    • componentShown

      public void componentShown(ComponentEvent e)
      Component Shown event handler
      Specified by:
      componentShown in interface ComponentListener
      Parameters:
      e - ComponentEvent instance
    • tput_edit_buffer

      private void tput_edit_buffer(byte[] buff, int lbuff)
      update screen from tput ebcdic buffer using line at a time edit mode
      Parameters:
      buff - buffer text
      lbuff - length of buffer
    • tn_tput_buffer

      private void tn_tput_buffer()
      update screen from tn3270 data stream buffer
    • tn_erase_all_unprotected

      private void tn_erase_all_unprotected()
      execute tn_write_eau as follows:
      1. erase all unprotected fields
      2. Reset modified data flags
      3. position cursor to first field
      4. unlock keyboard
    • tn_erase_to_end

      private void tn_erase_to_end()
      erase to end of current input field
    • tn_get_tput_byte

      private void tn_get_tput_byte()
      get next tput buffer byte in tput_buff_byte else abort
    • tn_next_field_addr

      private void tn_next_field_addr()
      incr scn_addr and wrap if at end of screen
    • tn_next_input_addr

      private void tn_next_input_addr()
      incr scn_addr to next input field addr
    • tn_scn_addr_inc

      private void tn_scn_addr_inc()
      next screen position with wrap
    • tn_scn_addr_dec

      private void tn_scn_addr_dec()
      prev screen position with wrap
    • tn_eua

      private void tn_eua()
      store nulls in unprotected fields to ending addess
    • tn_ra

      private void tn_ra()
      repeat character to sba address
    • tn_tab

      private void tn_tab()
      tab to next input field from current field
    • tn_next_input_field

      private void tn_next_input_field()
      find next input field starting at scn_addr with wrap and set scn_addr and cursor if on.
    • tn_input_field

      private boolean tn_input_field()
      return true if scn_addr is in unprotected input field and set cur_fld_addr
      Note:
      1. True also returned if no fields and fld_addr set to -1 indicating none
      Returns:
      boolean indicating field protection status
    • tn_modify_field

      private void tn_modify_field()
      update modified field attribute bit at fld_addr if any input fields
      Note:
      1. fld_addr must be set by tn_input
    • tn_update_cursor

      private void tn_update_cursor()
      update cursor for IC command or change in focus due to screen input or tab.
      1. Update scn_addr to next input field position or turn off cursor if none found.
      2. Turn on blinking cursor at position found
    • tn_update_scn

      private void tn_update_scn(int sba)
      update screen character with field attributes and extended attributes
      Parameters:
      sba - number
    • tn_get_screen_input

      private void tn_get_screen_input()
      fill tget_byte buffer with the following:
      1. action key = enter, PF, PA, or clear key)
      2. sba of cursor (if enter or PF only) RPI 856
      3. sba code x'11', sba addr, modified data bytes for each mdt field else
      4. Modified data bytes for unformated screen with no mdt fields
    • tn_unformatted_input

      private void tn_unformatted_input()
      return all modified bytes on screen when no field formatting.
    • tn_formatted_input

      private void tn_formatted_input()
      return modified input fields preceeded with sba code x'11' and sba addr
    • tn_write_control_char

      private void tn_write_control_char()
      execute wcc from next byte in buffer
       WCC 0xC3 = clear screen, reset KB and MDT's
       bit 0   - even bit count 
       bit 1   - reset screen
       bit 2-3 - printout format
       bit 4   - start print
       bit 5   - sound alarm
       bit 6   - keyboard restore
       bit 7   - reset modify data tags (MDT)
       
    • sound_alarm_beep

      private void sound_alarm_beep()
      sound alarm by sending ascii bell x'07' to System.out
      Notes:
      1. Tried Toolkit.getToolkitDefault().beep(); and it didn't work
      2. To get bell to work, I had to go to Windows XP Control Panel, select Sounds, and assign the Windows default for "Alert" sound to "Windows XP error" sound (it was none)
      3. Note alarm only sounds if running ez390 from command line, and not when running from z390.
    • tn_clear_screen

      private void tn_clear_screen()
      clear screen and reset fields
    • tn_reset_mdt

      private void tn_reset_mdt()
      reset all mdt bits so only changes will be input.
    • tn_get_buff_addr

      private int tn_get_buff_addr()
      return buffer address from next 2 bytes Notes:
      1. Wrap screen if sba > max_addr
      Returns:
      address value
    • tn_start_field

      private void tn_start_field()
      start field in tn3270 buffer at current sba.
      1. Set current tn_field_attr.
      2. Set 1 protected blank at start of field.
      3. Save unique unprotected fields in ascending order until next wcc clears them all.
       field attribute byte
       bit  0-1 - set to form EBCDIC/ASCII graphic symbol rpi 572
       bit  2   - protected output
       bit  3   - numeric (protected and numeric = skip)
       bit  4-5 - display format
                    00 - normal intensity, no light pen
                    01 - normal intensity, light pen
                    10 - high intensity, no light pen
                    11 - field not displayed
       bit  6   - reserved
       bit  7   - modified data tag
       
    • tn_add_field_addr

      private void tn_add_field_addr()
      1. add scn_addr to fld_addr if new
      2. sort after new add.
      3. set scn_fld_addr up to next
    • tn_add_input_field_addr

      private void tn_add_input_field_addr()
      add scn_addr to fld_mdt_addr array if new and sort after new add.
    • tn_drop_field

      private void tn_drop_field(int sba)
      remove field definition at sba
      Parameters:
      sba - number
    • tn_drop_input_field

      private void tn_drop_input_field(int sba)
      remove input field
      Parameters:
      sba - number
    • tn_eds_start_field

      private void tn_eds_start_field()
      entended data stream start field.
       first byte is count of attribute pairs
         type attribute
         C0   basic field attribute
         41   extended highlighting
         42   color
         
         1.  Set current tn_field_attr
                         tn_field_highlight
                         tn_color.
         2.  Set 1 protected blank at start of field.
         3.  Save unique unprotected fields
             in ascending order until next wcc
             clears them all.
       
       basic field attribute byte following x'C0'
       bit  0-1 - set based on remaining bits
       bit  2   - protected output
       bit  3   - numeric (protected and numeric = skip)
       bit  4-5 - display format
                    00 - normal intensity, no light pen
                    01 - normal intensity, light pen
                    10 - high intensity, no light pen
                    11 - field not displayed
       bit  6   - reserved
       bit  7   - modified data tag
       
       highlight attribute byte following x'41'
       00 - normal
       F1 - blink
       F2 - reverse video
       F4 - underscore
       
       color attribute byte following x'42' color attr byte
       00 Default 
       F1 Blue 
       F2 Red 
       F3 Pink 
       F4 Green 
       F5 Turquoise 
       F6 Yellow 
       F7 White 
       
    • tn_eds_set_field_attribute

      private void tn_eds_set_field_attribute()
      set single field attribute from next 2 bytes see sa and sfe commands
    • keyboard_readline

      private void keyboard_readline()
      1. Read keyboard text into tget_buff until return or field full and translate to EBCDIC
      2. Echo characters to screen at row,col.
    • scn_write_char

      private void scn_write_char(char key)
      write 1 character at current screen location
      Parameters:
      key - character to write
    • scn_next_line

      private void scn_next_line()
      position to next screen line with status line prompt before wrapping screen to position back to line 1
    • get_ascii_string

      private String get_ascii_string(byte[] text_byte, int lbuff)
      return string of ascii characters from tget_buff up to lbuff long
      Parameters:
      text_byte - text buffer
      lbuff - length of buffer
      Returns:
      text string
    • wtor_request_reply

      public boolean wtor_request_reply(int ecb_addr)
      Public GUAM GUI application interfaces for WTO/WTOR - MCS view TPUT/TGET - Screen view GUAM MACRO - graphic view and window commands
      Parameters:
      ecb_addr - - int - address of ECB
      Returns:
      boolean to indicate success (true) of failure (false)
    • get_wtor_reply_string

      public String get_wtor_reply_string(int ecb_addr)
      return wtor reply string if ready else null
      Parameters:
      ecb_addr - address of ecb
      Returns:
      string value
    • start_guam

      public void start_guam(String title, tz390 shared_tz390)
      startup gz390 GUAM GUI window with title in default mcs mode for wto/wtor
      Parameters:
      title - screen title
      shared_tz390 - tz390 instance
    • guam_window_title

      public void guam_window_title(String title)
      set gz390 GUAM GUI window title
      Notes:
      1. Called from ez390 with ez390_pgm at initization time if option GUAM.
      Parameters:
      title - text
    • guam_put_log

      public void guam_put_log(String msg)
      Write message to log file and to console if console mode or console option on. Append any output from CMD still in buffers to front of msg with newline
      Parameters:
      msg - message to be logged
    • guam_window_loc

      public void guam_window_loc(int x, int y)
      set location of main window x, y
      Parameters:
      x - horizontal position
      y - vertical position
    • guam_window_size

      public void guam_window_size(int x, int y)
      resize main window
      Parameters:
      x - horizontal
      y - vertical
    • guam_window_font

      public void guam_window_font(int font)
      set font size
      Parameters:
      font - number
    • guam_window_view

      public void guam_window_view(int view, int x, int y, int color)
      set window view
        1 = MCS console view
        2 = TN3270 screen view
        3 = graphics view
       
      Parameters:
      view - number
      x - horizontal
      y - vertical
      color - number
    • guam_window_getview

      public int guam_window_getview()
      return current window view
        1 = MCS console view
        2 = TN3270 screen view
        3 = graphics view
       
      Returns:
      code as above
    • guam_screen_write

      public void guam_screen_write(int row, int col, ByteBuffer buff, int lbuff, int color)
      write text at row,col from buff for lbuff using color
      Parameters:
      row - number
      col - number
      buff - text buffer
      lbuff - length of buffer
      color - number
    • guam_screen_read

      public ByteBuffer guam_screen_read(int lbuff, boolean wait)
      return ByteBuffer of lenght lbuff from TN3270 screen. If wait = 1 wait for input else return r15=4 if none ready.
      Parameters:
      lbuff - length of buffer
      wait - indicator
      Returns:
      ByteBuffer instance
    • guam_screen_field

      public void guam_screen_field(int row, int col, int lfield)
      define field for input from screen
      Parameters:
      row - number
      col - number
      lfield - number
    • guam_screen_cursor

      public void guam_screen_cursor(int row, int col, int type)
      set cursor type at row, col
      Parameters:
      row - number
      col - number
      type - number
    • guam_screen_color

      public void guam_screen_color(int bg_color, int text_color)
      set screen background and text colors
      Parameters:
      bg_color - number
      text_color - number
    • guam_graph_point

      public void guam_graph_point(int x, int y, int color)
      draw point at x,y
      Parameters:
      x - horizontal position
      y - vertical position
      color - number
    • guam_graph_line

      public void guam_graph_line(int x1, int y1, int x2, int y2, int color)
      draw line from at x1,y1 to x2,y2
      Parameters:
      x1 - horizontal position
      y1 - vertical position
      x2 - horizontal position
      y2 - vertical position
      color - number
    • guam_graph_fill

      public void guam_graph_fill(int x1, int y1, int x2, int y2, int color)
      fill area at x1,y1 to x2,y2
      Parameters:
      x1 - horizontal position
      y1 - vertical position
      x2 - horizontal position
      y2 - vertical position
      color - number
    • guam_graph_text

      public void guam_graph_text(int x1, int y1, String text, int color)
      draw characters at x,y
      Parameters:
      x1 - horizontal position
      y1 - vertical position
      text - to be displayed
      color - number
    • guam_keyboard_read

      public int guam_keyboard_read(boolean wait)
      read next keyboard keycode and keychar and return as int (code high 16, char low 16). If none ready and no wait return -1 else wait for next input key
      Parameters:
      wait - indicator
      Returns:
      number
    • guam_mouse_read

      public int[] guam_mouse_read()
      return int[4] with x,y,left,right
      Returns:
      array of integers
    • guam_sound_play

      public void guam_sound_play(String wav_file)
      play wav_file
      Parameters:
      wav_file - location of wav file
    • guam_tget

      public void guam_tget()
      1. Return last tn3270 data stream input if available following keyboard enter or PF key. If option edit, remove control characters and translate to EBCDIC unless ASCII mode.
      2. If none, and option wait then wait else return R15=4 indicating not avail.
      3. Set tget_len to actual bytes returns if less than requested length.
      4. Set R1=length of data buffer returned and R15=0 or 4 if none and NOWAIT
    • guam_tput

      public void guam_tput()
      Display TN3290 data stream buffer on GUAM GUI 3270 screen and return true of ok.
    • tn_repaint_screen

      private void tn_repaint_screen()
      repaint scn_char for new font size screen