Class gz390
java.lang.Object
gz390
- All Implemented Interfaces:
ActionListener,ComponentListener,FocusListener,KeyListener,MouseListener,EventListener
public class gz390
extends Object
implements MouseListener, KeyListener, ActionListener, ComponentListener, FocusListener
gz390 is the GUAM/GUI component of z390
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) char[]variable(package private) intvariable(package private) intvariable(package private) Colorvariable(package private) Fontvariable(package private) booleanvariable(package private) booleanvariable(package private) String[]variable(package private) JLabelvariable(package private) Stringvariable(package private) intvariable(package private) intvariable(package private) booleanvariable(package private) intvariable(package private) Datevariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) int[]variable(package private) intvariable(package private) booleanvariable(package private) JMenuvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) charvariable(package private) JMenuvariable(package private) JMenuItemvariable(package private) intvariable(package private) int[]variable(package private) intvariable(package private) intvariable(package private) int[]variable(package private) intvariable(package private) intvariable(package private) Componentvariable(package private) intvariable(package private) intvariable(package private) JTextAreavariable(package private) gz390_screenvariable(package private) intvariable(package private) intvariable(package private) int[]variable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) JTextFieldvariable(package private) intvariable(package private) JMenuvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) intvariable(package private) SimpleDateFormatvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) booleanvariable(package private) intvariable(package private) Datevariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) JTextAreavariable(package private) intvariable(package private) intvariable(package private) booleanvariable(package private) JFramevariable(package private) booleanvariable(package private) intvariable(package private) intvariable(package private) JPanelvariable(package private) booleanvariable(package private) Stringvariable(package private) JScrollPanevariable(package private) booleanvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) JMenuBarvariable(package private) SimpleDateFormatvariable(package private) Stringvariable(package private) Stringvariable(package private) longvariable(package private) longvariable(package private) longvariable(package private) longvariable(package private) longvariable(package private) booleanvariable(package private) intvariable(package private) intvariable(package private) longvariable(package private) intvariable(package private) intvariable(package private) longvariable(package private) intvariable(package private) Timervariable(package private) intvariable(package private) booleanvariable(package private) booleanvariable(package private) booleanvariable(package private) booleanvariable(package private) booleanvariable(package private) booleanvariable(package private) booleanvariable(package private) booleanvariable(package private) booleanvariable(package private) booleanvariable(package private) JPopupMenuvariable(package private) booleanvariable(package private) booleanvariable(package private) int[]variable(package private) intvariable(package private) int[]variable(package private) char[]variable(package private) int[]variable(package private) boolean[]variable(package private) int[]variable(package private) charvariable(package private) intvariableprivate static final longvariable(package private) booleanvariable(package private) intvariable(package private) intvariable(package private) longvariable(package private) Stringvariable(package private) longvariable(package private) longvariable(package private) longvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) longvariable(package private) JTextFieldvariable(package private) JLabelvariable(package private) Stringvariable(package private) intvariable(package private) intvariable(package private) longvariable(package private) booleanvariable(package private) Colorvariable(package private) ByteBuffervariable(package private) byte[]variable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) booleanvariable(package private) bytevariable(package private) bytevariable(package private) bytevariable(package private) Color[]variable(package private) booleanvariable(package private) booleanvariable(package private) intvariable(package private) intvariable(package private) charvariable(package private) charvariable(package private) intvariable(package private) booleanvariable(package private) bytevariable(package private) intvariable(package private) intvariable(package private) bytevariable(package private) bytevariable(package private) booleanvariable(package private) bytevariable(package private) booleanvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) bytevariable(package private) intvariable(package private) bytevariable(package private) bytevariable(package private) bytevariable(package private) intvariable(package private) bytevariable(package private) bytevariable(package private) bytevariable(package private) bytevariable(package private) gz390_screenvariable(package private) booleanvariable(package private) bytevariable(package private) bytevariable(package private) bytevariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) ByteBuffervariable(package private) intvariable(package private) byte[]variable(package private) intvariable(package private) intvariable(package private) tz390variable(package private) intvariable(package private) JMenuvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) intvariable(package private) Stringvariable(package private) booleanvariable(package private) Threadvariable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidabort_error(int error, String msg) Abort with errorprivate voidDisplay copyright noticevoidactionPerformed(ActionEvent event) Perform menu and command line requestsprivate voidadd command cmd_line to rolling historyprivate voidBuild the command entry fieldprivate voidbuild scrolling log view based on current screen and font sizeprivate voidBuild the main panel with: Scrolling log display command entry fieldprivate voidBuild the menu barprivate voidBuild the statuts lineprivate voidIf screen not ready, exit If delete key pending, do it now If cursor active, update it now If main window size has changed due to user streching without window event handler triggering update, do it now.voidComponent Hidden event handlervoidComponent Moved event handlervoidComponent Resized event handlervoidComponent Shown event handlerprotected static ImageIconcreateImageIcon(String path, String description) Create Image Iconprotected voiddisplayInfo(KeyEvent e, String s) Display key event infoprivate booleanexec command as separate taskprivate voidexec commandprivate voidabort command if runnung and turn off cmd_mode If no command running and not cmd_mode, then exit gz390.private voidexit_main(int rc) terminatevoidvoidlast component to lose focus (ignored for now)private voidfont_command(int new_font_size) reset font sizeprivate Stringget_ascii_string(byte[] text_byte, int lbuff) return string of ascii characters from tget_buff up to lbuff longprivate voidrestore next cmd to gz390_cmd_lineprivate Stringget_next_parm(StringTokenizer st, boolean ignore_spaces) get string with or without single/double quotes.private voidrestore prev cmd to gz390_cmd_lineget_wtor_reply_string(int ecb_addr) return wtor reply string if ready else nullstatic StringGet string text from system clipboardvoidguam_graph_fill(int x1, int y1, int x2, int y2, int color) fill area at x1,y1 to x2,y2voidguam_graph_line(int x1, int y1, int x2, int y2, int color) draw line from at x1,y1 to x2,y2voidguam_graph_point(int x, int y, int color) draw point at x,yvoidguam_graph_text(int x1, int y1, String text, int color) draw characters at x,yintguam_keyboard_read(boolean wait) read next keyboard keycode and keychar and return as int (code high 16, char low 16).int[]return int[4] with x,y,left,rightvoidguam_put_log(String msg) Write message to log file and to console if console mode or console option on.voidguam_screen_color(int bg_color, int text_color) set screen background and text colorsvoidguam_screen_cursor(int row, int col, int type) set cursor type at row, colvoidguam_screen_field(int row, int col, int lfield) define field for input from screenguam_screen_read(int lbuff, boolean wait) return ByteBuffer of lenght lbuff from TN3270 screen.voidguam_screen_write(int row, int col, ByteBuffer buff, int lbuff, int color) write text at row,col from buff for lbuff using colorvoidguam_sound_play(String wav_file) play wav_filevoidReturn last tn3270 data stream input if available following keyboard enter or PF key.voidDisplay TN3290 data stream buffer on GUAM GUI 3270 screen and return true of ok.voidguam_window_font(int font) set font sizeintreturn current window viewvoidguam_window_loc(int x, int y) set location of main window x, yvoidguam_window_size(int x, int y) resize main windowvoidguam_window_title(String title) set gz390 GUAM GUI window title
Notes: Called from ez390 with ez390_pgm at initization time if option GUAM.voidguam_window_view(int view, int x, int y, int color) set window viewprivate voidlog summary list of commands and help referenceprivate voidinit_gz390(String[] args) Init graphical user interfaceprivate voidinit first time or if rows spec.private voidRead keyboard text into tget_buff until return or field full and translate to EBCDIC Echo characters to screen at row,col.voidHandle key pressed eventsvoidHandle key released eventsvoidHandle key typed events collect any characters for accept which are placed in gz390_cmd_line by accept wait loop if not there already.private voidLog error messagestatic voidCreate instance of gz390 classprivate voidstart monitor to terminate cmd command if timeout limit reachedprivate voidAt monitor_wait intervals, update the GUAM GUI title date and time and the status line information. Update TN3270 screen from key typed buffer reset focus to gz390_cmd_line after wtovoidMouse Click handlervoidMouse Entry handlervoidMouse Exit handlervoidPopup edit menu on right mouse ckvoidMouse Release handlerprivate voidprocess_action_key_pressed(int key_code, int key_mods, KeyEvent e) process action key after processing any pending typed keysprivate voidcancel cmd, or GUAM GUI cmd in response to F3 or Ctrl-Breakprivate voidprocess_command(String cmd_line) parse parms and execute gz390 command if found.private voidshift input field left 1 char to end if not at null char.private voidprocess_non_action_key_pressed(int key_code, int key_mods, KeyEvent e) process enter, cancel, backspace, and delete (the rest are handled by keytypedvoidprocess pending typed keys on monitor thread in ez390 and for all action keys.private voidrebuild main_panel with current main_view, gz390_cmd and status lines with or without labels to fix current main_panel size.private voidreset gz390_cmd text and set focusprivate voidposition to next screen line with status line prompt before wrapping screen to position back to line 1private voidscn_write_char(char key) write 1 character at current screen locationprivate voidinitialize tn3270 screen fonts using current font sizeprivate voidcalculate GUAM GUI object sizes based on sreen size and font sizeprivate intset_main_mode(String[] args) Set main program execution mode and Set security permissions
Notes: called from main or init before gz390 instance started so only set class variables.private voidset_main_view(int view_type) redefine main_view scrolling paneprivate voidset guam dialog window to show TN3270 screen using current main window size (max require scrolling to see entrie screen)private voidset guam dialog window to show mcs logprivate voidadjust font to show full TN3270 screen in current window space.private voidreset font size for menu, log, cmd and status lineprivate voidset tooltips after font changesprivate voidset_view_graph(int x, int y, int color) display graph for QUAM GKS commandsprivate voiddisplay mcs scrolling wto/wtor panelprivate voidset_view_screen(int rows, int cols, int color) build screen view based on current screen and font size Notes: Purge and redefine main_panel with new main_view Turn off focus subsystem to see tab key Display "Screen View on status line.static voidsetClipboard(String str) put string to system clipboardprivate voidshut_down(int return_code) cancel threads and exit with rc (turn off runtime shutdown exitprivate voidsound alarm by sending ascii bell x'07' to System.out
Notes: Tried Toolkit.getToolkitDefault().beep(); and it didn't work 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) Note alarm only sounds if running ez390 from command line, and not when running from z390.voidstart_guam(String title, tz390 shared_tz390) startup gz390 GUAM GUI window with title in default mcs mode for wto/wtorprivate Stringreturn date and time if opt_timingprivate voidupdate main frame title with current date and time.private voidadd scn_addr to fld_addr if new sort after new add. set scn_fld_addr up to nextprivate voidadd scn_addr to fld_mdt_addr array if new and sort after new add.private voidclear screen and reset fieldsprivate voidtn_drop_field(int sba) remove field definition at sbaprivate voidtn_drop_input_field(int sba) remove input fieldprivate voidset single field attribute from next 2 bytes see sa and sfe commandsprivate voidentended data stream start field.private voidexecute tn_write_eau as follows: erase all unprotected fields Reset modified data flags position cursor to first field unlock keyboardprivate voiderase to end of current input fieldprivate voidtn_eua()store nulls in unprotected fields to ending addessprivate voidreturn modified input fields preceeded with sba code x'11' and sba addrprivate intreturn buffer address from next 2 bytes Notes: Wrap screen if sba > max_addrprivate voidfill tget_byte buffer with the following: action key = enter, PF, PA, or clear key) sba of cursor (if enter or PF only) RPI 856 sba code x'11', sba addr, modified data bytes for each mdt field else Modified data bytes for unformated screen with no mdt fieldsprivate voidget next tput buffer byte in tput_buff_byte else abortprivate booleanreturn true if scn_addr is in unprotected input field and set cur_fld_addr
Note: True also returned if no fields and fld_addr set to -1 indicating noneprivate voidupdate modified field attribute bit at fld_addr if any input fields
Note: fld_addr must be set by tn_inputprivate voidincr scn_addr and wrap if at end of screenprivate voidincr scn_addr to next input field addrprivate voidfind next input field starting at scn_addr with wrap and set scn_addr and cursor if on.private voidtn_ra()repeat character to sba addressprivate voidrepaint scn_char for new font size screenprivate voidreset all mdt bits so only changes will be input.private voidprev screen position with wrapprivate voidnext screen position with wrapprivate voidstart field in tn3270 buffer at current sba.private voidtn_tab()tab to next input field from current fieldprivate voidupdate screen from tn3270 data stream bufferprivate voidreturn all modified bytes on screen when no field formatting.private voidupdate cursor for IC command or change in focus due to screen input or tab.private voidtn_update_scn(int sba) update screen character with field attributes and extended attributesprivate voidexecute wcc from next byte in bufferprivate voidtput_edit_buffer(byte[] buff, int lbuff) update screen from tput ebcdic buffer using line at a time edit modeprivate voidupdate main_view and command line size following change in window sizebooleanwtor_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
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDvariable- See Also:
-
max_cmd
int max_cmdvariable -
max_keys
int max_keysvariable -
max_rows
int max_rowsvariable -
max_cols
int max_colsvariable -
max_addr
int max_addrvariable -
bg_color
Color bg_colorvariable -
text_color
Color text_colorvariable -
tn_color
Color[] tn_colorvariable -
max_fud
int max_fudvariable -
max_buff
int max_buffvariable -
tz390
tz390 tz390variable -
tn_scn
gz390_screen tn_scnvariable -
graph_scn
gz390_screen graph_scnvariable -
startup_cmd_file
String startup_cmd_filevariable -
first_user_parm
int first_user_parmvariable -
hex_base
int hex_basevariable -
echo_cmd
boolean echo_cmdvariable -
console_log
boolean console_logvariable -
gz390_errors
int gz390_errorsvariable -
cmd_error
boolean cmd_errorvariable -
main_title
String main_titlevariable -
check_perms
boolean check_permsvariable -
perm_file_user_dir
boolean perm_file_user_dirvariable -
perm_file_read
boolean perm_file_readvariable -
perm_file_write
boolean perm_file_writevariable -
perm_file_execute
boolean perm_file_executevariable -
perm_runtime_thread
boolean perm_runtime_threadvariable -
perm_file_log
boolean perm_file_logvariable -
perm_select
boolean perm_selectvariable -
main_demo
boolean main_demovariable -
main_lic
boolean main_licvariable -
mode_msg1
String mode_msg1variable -
mode_msg2
String mode_msg2variable -
lic_end_date
Date lic_end_datevariable -
cur_date
Date cur_datevariable -
mmddyy
SimpleDateFormat mmddyyvariable -
hhmmss
SimpleDateFormat hhmmssvariable -
ins_count
int ins_countvariable -
io_count
int io_countvariable -
start_cmd_io_count
int start_cmd_io_countvariable -
start_cmd_time
long start_cmd_timevariable -
monitor_timer
Timer monitor_timervariable -
monitor_wait
int monitor_waitvariable -
monitor_timeout_limit
int monitor_timeout_limitvariable -
monitor_cmd_time_total
long monitor_cmd_time_totalvariable -
monitor_last_time
long monitor_last_timevariable -
monitor_next_time
long monitor_next_timevariable -
monitor_cur_interval
long monitor_cur_intervalvariable -
monitor_last_ins_count
int monitor_last_ins_countvariable -
monitor_next_ins_count
int monitor_next_ins_countvariable -
monitor_last_io_count
int monitor_last_io_countvariable -
monitor_next_io_count
int monitor_next_io_countvariable -
monitor_cur_ins
long monitor_cur_insvariable -
monitor_cur_int
long monitor_cur_intvariable -
monitor_cur_rate
long monitor_cur_ratevariable -
monitor_last_cmd_mode
boolean monitor_last_cmd_modevariable -
guam_view_mcs
int guam_view_mcsvariable -
guam_view_screen
int guam_view_screenvariable -
guam_view_graph
int guam_view_graphvariable -
guam_view
int guam_viewvariable -
guam_tot_key
int guam_tot_keyvariable -
guam_next_key
int guam_next_keyvariable -
guam_key_code_char
int[] guam_key_code_charvariable -
guam_cur_row
int guam_cur_rowvariable -
guam_cur_col
int guam_cur_colvariable -
status_visible
boolean status_visiblevariable -
status_interval
int status_intervalvariable -
status_last_time
long status_last_timevariable -
status_next_time
long status_next_timevariable -
status_last_ins_count
int status_last_ins_countvariable -
status_next_ins_count
int status_next_ins_countvariable -
status_next_io_count
int status_next_io_countvariable -
status_last_io_count
int status_last_io_countvariable -
status_cur_ins
long status_cur_insvariable -
status_cur_int
long status_cur_intvariable -
status_cur_rate
long status_cur_ratevariable -
wtor_running
boolean wtor_runningvariable -
wtor_thread
Thread wtor_threadvariable -
wtor_reply_string
String wtor_reply_stringvariable -
wtor_ecb_addr
int wtor_ecb_addrvariable -
cmd_line
String cmd_linevariable -
shutdown_exit
boolean shutdown_exitvariable -
tpg_rc
int tpg_rcvariable -
tpg_flags
int tpg_flagsvariable -
tpg_op_mask
int tpg_op_maskvariable -
tpg_op_tget
int tpg_op_tgetvariable -
tpg_op_tput
int tpg_op_tputvariable -
tpg_wait_mask
int tpg_wait_maskvariable -
tpg_wait
int tpg_waitvariable -
tpg_nowait
int tpg_nowaitvariable -
tpg_type
int tpg_typevariable -
tpg_type_mask
int tpg_type_maskvariable -
tpg_type_edit
int tpg_type_editvariable -
tpg_type_asis
int tpg_type_asisvariable -
tpg_type_control
int tpg_type_controlvariable -
tpg_type_fullscr
int tpg_type_fullscrvariable -
tget_byte
byte[] tget_bytevariable -
tget_buff
ByteBuffer tget_buffvariable -
tget_index
int tget_indexvariable -
tget_len
int tget_lenvariable -
tput_byte
byte[] tput_bytevariable -
tput_buff
ByteBuffer tput_buffvariable -
tput_index
int tput_indexvariable -
tput_len
int tput_lenvariable -
tput_buff_byte
int tput_buff_bytevariable -
tn_tab_code
byte tn_tab_codevariable -
tn_pa1_code
byte tn_pa1_codevariable -
tn_pa2_code
byte tn_pa2_codevariable -
tn_pa3_code
byte tn_pa3_codevariable -
tn_clear_code
byte tn_clear_codevariable -
tn_enter_code
byte tn_enter_codevariable -
tn_sba_cmd
byte tn_sba_cmdvariable -
tn_sf_cmd
byte tn_sf_cmdvariable -
tn_ic_cmd
byte tn_ic_cmdvariable -
tn_pt_cmd
byte tn_pt_cmdvariable -
tn_ra_cmd
byte tn_ra_cmdvariable -
tn_eua_cmd
byte tn_eua_cmdvariable -
tn_sa_cmd
byte tn_sa_cmdvariable -
tn_sfe_cmd
byte tn_sfe_cmdvariable -
tn_delete_request
boolean tn_delete_requestvariable -
tn_cursor
boolean tn_cursorvariable -
tn_cursor_alt
boolean tn_cursor_altvariable -
tn_cursor_sym
char tn_cursor_symvariable -
tn_cursor_sym_alt
char tn_cursor_sym_altvariable -
ff_char
char ff_charvariable -
tn_cursor_scn_addr
int tn_cursor_scn_addrvariable -
tn_cursor_count
int tn_cursor_countvariable -
tn_cursor_wait_int
int tn_cursor_wait_intvariable -
scn_null
char scn_nullvariable -
tn_full_screen
boolean tn_full_screenvariable -
tn_null
byte tn_nullvariable -
tn_field
byte tn_fieldvariable -
tn_char
byte tn_charvariable -
tn_protect_mask
int tn_protect_maskvariable -
tn_numeric_mask
int tn_numeric_maskvariable -
tn_mdt_mask
int tn_mdt_maskvariable -
tn_mdt_off
int tn_mdt_offvariable -
tn_noaid
int tn_noaidvariable -
tn_aid
int tn_aidvariable -
tn_esc
int tn_escvariable -
tn_write_cmd
int tn_write_cmdvariable -
tn_write
int tn_writevariable -
tn_erase_write
int tn_erase_writevariable -
tn_write_alt
int tn_write_altvariable -
tn_write_eau
int tn_write_eauvariable -
tn_attr_prot_text
byte tn_attr_prot_textvariable -
tn_kb_lock
boolean tn_kb_lockvariable -
tn_scn_lock
boolean tn_scn_lockvariable -
tn_attn
boolean tn_attnvariable -
cur_fld_addr
int cur_fld_addrvariable -
cur_fld_attr
int cur_fld_attrvariable -
fld_attr_hl
int fld_attr_hlvariable -
fld_attr_nd
int fld_attr_ndvariable -
cur_fld_hl
int cur_fld_hlvariable -
cur_fld_color
int cur_fld_colorvariable -
fld_tot
int fld_totvariable -
fld_addr
int[] fld_addrvariable -
fld_mdt_tot
int fld_mdt_totvariable -
fld_mdt_addr
int[] fld_mdt_addrvariable -
scn_fld
boolean[] scn_fldvariable -
scn_attr
int[] scn_attrvariable -
scn_hl
int[] scn_hlvariable -
scn_color
int[] scn_colorvariable -
scn_char
char[] scn_charvariable -
scn_addr
int scn_addrvariable -
sba_to_ebc
int[] sba_to_ebcvariable -
ebc_to_sba
int[] ebc_to_sbavariable -
ascii_lf
int ascii_lfvariable -
ascii_cr
int ascii_crvariable -
ebcdic_space
int ebcdic_spacevariable -
refresh_wait
boolean refresh_waitvariable -
refresh_request
boolean refresh_requestvariable -
main_status
boolean main_statusvariable -
main_view_changed
boolean main_view_changedvariable -
main_frame
JFrame main_framevariable -
main_border
int main_bordervariable -
start_bar_height
int start_bar_heightvariable -
main_loc_x
int main_loc_xvariable -
main_loc_y
int main_loc_yvariable -
scrollbar_width
int scrollbar_widthvariable -
font_space
int font_spacevariable -
font_size
int font_sizevariable -
char_font
Font char_fontvariable -
title_height
int title_heightvariable -
log_char_height
int log_char_heightvariable -
tool_height
int tool_heightvariable -
lines_per_page
int lines_per_pagevariable -
log_height
int log_heightvariable -
log_width
int log_widthvariable -
command_height
int command_heightvariable -
command_columns
int command_columnsvariable -
status_height
int status_heightvariable -
labels_visible
boolean labels_visiblevariable -
labels_min_width
int labels_min_widthvariable -
labels_max_font
int labels_max_fontvariable -
label_width
int label_widthvariable -
main_panel
JPanel main_panelvariable -
log_text
JTextArea log_textvariable -
main_view
JScrollPane main_viewvariable -
cmd_label
JLabel cmd_labelvariable -
gz390_cmd_line
JTextField gz390_cmd_linevariable -
status_line_label
JLabel status_line_labelvariable -
status_line
JTextField status_linevariable -
status_line_view
String status_line_viewvariable -
cur_cmd
int cur_cmdvariable -
last_cmd
int last_cmdvariable -
view_cmd
int view_cmdvariable -
cmd_history
String[] cmd_historyvariable -
graph_grid
JTextArea graph_gridvariable -
opt_tn3270
boolean opt_tn3270variable -
opt_graph
boolean opt_graphvariable -
opt_mcs
boolean opt_mcsvariable -
focus_comp
Component focus_compvariable -
apl_char
char[] apl_charvariable
-
-
Constructor Details
-
gz390
public gz390()Dummy constructor - no initialization needed
-
-
Method Details
-
main
Create instance of gz390 class- Parameters:
args- argument string - same as z390
-
set_main_mode
Set main program execution mode and Set security permissions
Notes:- called from main or init before gz390 instance started so only set class variables.
- Parameters:
args- argument string- Returns:
- number
-
log_error
Log error message- Parameters:
error- numbermsg- message text`
-
abort_error
Abort with error- Parameters:
error- error codemsg- 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
- parse parms and execute gz390 command if found.
- * in position 1 is a comment
- space or null logged as blank line
- If not a known gz390 command, issue CMD Windows command.
- gz390_cmd_line event handler routes input to CMD processor when in cmd_mode.
- 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.
- Status bar shows progress of command processes on separate threads.
- Use EXIT or BREAK event to abort CMD process. Ctrl-C works in command mode only.
- Parameters:
cmd_line- command to be processed
- parse parms and execute gz390 command if found.
-
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
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 instanceignore_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()- At monitor_wait intervals, update the GUAM GUI title date and time and the status line information.
- Update TN3270 screen from key typed buffer
- 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
Init graphical user interface- Parameters:
args- argument string
-
build_main_panel
private void build_main_panel()Build the main panel with:- Scrolling log display
- 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 -
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
Perform menu and command line requests- Specified by:
actionPerformedin interfaceActionListener
-
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
exec command as separate task- Parameters:
cmd- command string- Returns:
- boolean indicator of success
-
getClipboard
Get string text from system clipboard- Returns:
- string holding text from keyboard
-
setClipboard
put string to system clipboard- Parameters:
str- string to be copied to clipboard
-
keyPressed
Handle key pressed events- Specified by:
keyPressedin interfaceKeyListener- Parameters:
e- KeyEvent instance
-
process_action_key_pressed
process action key after processing any pending typed keys- Parameters:
key_code- numberkey_mods- numbere- keyEvent instance
-
process_non_action_key_pressed
process enter, cancel, backspace, and delete (the rest are handled by keytyped- Parameters:
key_code- numberkey_mods- numbere- KeyEvent Instance
-
process_cancel_key
private void process_cancel_key()cancel cmd, or GUAM GUI cmd in response to F3 or Ctrl-Break -
keyTyped
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:
keyTypedin interfaceKeyListener- 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
Handle key released events- Specified by:
keyReleasedin interfaceKeyListener
-
displayInfo
Display key event info- Parameters:
e- KeyEvent instances- identifier for the diagnostic output
-
mousePressed
Popup edit menu on right mouse ck- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e- MouseEvent instance
-
mouseReleased
Mouse Release handler- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
e- MouseEvent instance
-
mouseEntered
Mouse Entry handler- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
e- MouseEvent instance
-
mouseExited
Mouse Exit handler- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
e- MouseEvent instance
-
mouseClicked
Mouse Click handler- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
e- MouseEvent instance
-
focusLost
last component to lose focus (ignored for now)- Specified by:
focusLostin interfaceFocusListener- Parameters:
e- FocusEvent instance
-
focusGained
- Specified by:
focusGainedin interfaceFocusListener
-
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
Create Image Icon- Parameters:
path- path to usedescription- descriptive text- Returns:
- ImageIcon instance
-
check_main_view
private void check_main_view()- If screen not ready, exit
- If delete key pending, do it now
- If cursor active, update it now
- 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:- Purge and redefine main_panel with new main_view
- Turn off focus subsystem to see tab key
- Display "Screen View on status line.
- Parameters:
rows- nr of rowscols- nr of columnscolor- nr
-
set_view_graph
private void set_view_graph(int x, int y, int color) display graph for QUAM GKS commands- Parameters:
x- horizontal positiony- vertical positioncolor- 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
Component Hidden event handler- Specified by:
componentHiddenin interfaceComponentListener- Parameters:
e- ComponentEvent instance
-
componentMoved
Component Moved event handler- Specified by:
componentMovedin interfaceComponentListener- Parameters:
e- ComponentEvent instance
-
componentResized
Component Resized event handler- Specified by:
componentResizedin interfaceComponentListener- Parameters:
e- ComponentEvent instance
-
componentShown
Component Shown event handler- Specified by:
componentShownin interfaceComponentListener- 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 textlbuff- 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:- erase all unprotected fields
- Reset modified data flags
- position cursor to first field
- 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:- 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:- 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.- Update scn_addr to next input field position or turn off cursor if none found.
- 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:- action key = enter, PF, PA, or clear key)
- sba of cursor (if enter or PF only) RPI 856
- sba code x'11', sba addr, modified data bytes for each mdt field else
- 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 bufferWCC 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:- Tried Toolkit.getToolkitDefault().beep(); and it didn't work
- 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)
- 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:- 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.- Set current tn_field_attr.
- Set 1 protected blank at start of field.
- 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()- add scn_addr to fld_addr if new
- sort after new add.
- 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()- Read keyboard text into tget_buff until return or field full and translate to EBCDIC
- 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
return string of ascii characters from tget_buff up to lbuff long- Parameters:
text_byte- text bufferlbuff- 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
return wtor reply string if ready else null- Parameters:
ecb_addr- address of ecb- Returns:
- string value
-
start_guam
startup gz390 GUAM GUI window with title in default mcs mode for wto/wtor- Parameters:
title- screen titleshared_tz390- tz390 instance
-
guam_window_title
set gz390 GUAM GUI window title
Notes:- Called from ez390 with ez390_pgm at initization time if option GUAM.
- Parameters:
title- text
-
guam_put_log
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 positiony- vertical position
-
guam_window_size
public void guam_window_size(int x, int y) resize main window- Parameters:
x- horizontaly- 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 view1 = MCS console view 2 = TN3270 screen view 3 = graphics view
- Parameters:
view- numberx- horizontaly- verticalcolor- number
-
guam_window_getview
public int guam_window_getview()return current window view1 = MCS console view 2 = TN3270 screen view 3 = graphics view
- Returns:
- code as above
-
guam_screen_write
write text at row,col from buff for lbuff using color- Parameters:
row- numbercol- numberbuff- text bufferlbuff- length of buffercolor- number
-
guam_screen_read
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 bufferwait- 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- numbercol- numberlfield- number
-
guam_screen_cursor
public void guam_screen_cursor(int row, int col, int type) set cursor type at row, col- Parameters:
row- numbercol- numbertype- number
-
guam_screen_color
public void guam_screen_color(int bg_color, int text_color) set screen background and text colors- Parameters:
bg_color- numbertext_color- number
-
guam_graph_point
public void guam_graph_point(int x, int y, int color) draw point at x,y- Parameters:
x- horizontal positiony- vertical positioncolor- 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 positiony1- vertical positionx2- horizontal positiony2- vertical positioncolor- 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 positiony1- vertical positionx2- horizontal positiony2- vertical positioncolor- number
-
guam_graph_text
draw characters at x,y- Parameters:
x1- horizontal positiony1- vertical positiontext- to be displayedcolor- 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
play wav_file- Parameters:
wav_file- location of wav file
-
guam_tget
public void guam_tget()- 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.
- If none, and option wait then wait else return R15=4 indicating not avail.
- Set tget_len to actual bytes returns if less than requested length.
- 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
-