Class z390
java.lang.Object
z390
- All Implemented Interfaces:
ActionListener,ComponentListener,FocusListener,KeyListener,MouseListener,Runnable,EventListener
public class z390
extends Object
implements MouseListener, KeyListener, ActionListener, ComponentListener, Runnable, FocusListener
z390 is the interactive command screen component of z390
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classdefine accept and getdescription methods for file chooser to filter files to just select_file_type if any -
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) Stringvariable(package private) Stringvariable(package private) Stringvariable(package private) Stringvariable(package private) booleanreset with /NP(package private) booleanvariable(package private) Stringvariable(package private) BufferedReadervariable(package private) Threadvariable(package private) PrintStreamvariable(package private) Stringvariable(package private) BufferedReadervariable(package private) Threadvariable(package private) Processvariable(package private) Threadvariable(package private) intvariable(package private) String[]variable(package private) intvariable(package private) JLabelvariable(package private) Stringvariable(package private) booleanvariable(package private) booleanvariable(package private) intvariable(package private) intvariable(package private) booleanvariable(package private) intindex of most recent comment entered(package private) Datevariable(package private) Filecurrent directory file(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) JMenuItemvariable(package private) intindex of highest cmd entered(package private) Stringvariable(package private) JMenuvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) intvariable(package private) Componentvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) JMenuvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) JMenuItemvariable(package private) intvariable(package private) SimpleDateFormatvariable(package private) intvariable(package private) Stringvariable(package private) Stringvariable(package private) intvariable(package private) Stringvariable(package private) intvariable(package private) intvariable(package private) intvariable(package private) booleanvariable(package private) Stringvariable(package private) Datevariable(package private) intvariable(package private) Stringvariable(package private) intvariable(package private) BufferedWritervariable(package private) Stringvariable(package private) intvariable(package private) JTextAreavariable(package private) booleanvariable(package private) JScrollPanevariable(package private) intvariable(package private) Stringvariable(package private) booleanrunning as browser applet(package private) booleanparm = file name(package private) intvariable(package private) booleanparm = /c(package private) booleanset if no permissions(package private) JFramevariable(package private) booleanparm = /g(package private) intvariable(package private) booleanset if permissions ok(package private) intvariable(package private) intvariable(package private) JPanelvariable(package private) booleanvariable(package private) Stringvariable(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) JMenuvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) booleanset if exec ok(package private) booleanset if write log ok(package private) booleanset if read ok(package private) booleanset if user.dir ok(package private) booleanset if write ok(package private) booleanset if popup file chooser ok(package private) booleanset if select dir/file ok(package private) JPopupMenuvariable(package private) booleanvariable(package private) booleanvariable(package private) intvariable(package private) Stringvariable(package private) JFramevariable(package private) JFramevariable(package private) Stringvariable(package private) Stringvariable(package private) Stringvariable(package private) Filevariable(package private) Stringvariableprivate static final longvariable(package private) booleanvariable(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) intvariable(package private) intvariable(package private) longvariable(package private) booleanvariable(package private) Stringvariable(package private) Stringvariable(package private) Stringvariable(package private) intvariable(package private) intvariable(package private) tz390variable(package private) intindex of current cmd in view(package private) JMenuvariable(package private) JCheckBoxMenuItemvariable(package private) JCheckBoxMenuItemvariable(package private) booleanvariable(package private) Stringvariable(package private) JTextFieldvariable(package private) intvariable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidabort_error(int error, String msg) Abort with error messageprivate voidwrite basic info to logvoidactionPerformed(ActionEvent event) Perform menu and command line requestsprivate voidadd command cmd_line to rolling historyprivate voidinvoke batch command with specified file and options.private 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 voidBuild the command entry fieldprivate voidcd_command(String cmd_parm1) set current directory using file chooser dialog if parm1 null else use pathprivate voidif main window size has changed due to user streching without window event handler triggering update, do it now.private voiddisplay error total on log and close data and log filesprivate voidClose log fileprivate voidcmd_command(String cmd) exec Windows command as follows: If cmd_mode set via prior cmd with no command, then all commands are routed to command processor via cmd_exec_input.private voidcancel exec processprivate voidcmd_exec_input(String cmd_line) send input to exec command in processprivate intreturn ending rc else -1 return 0 if no process definedintcmd_exec_start(String[] exec_cmd) Terminate any prior exec process with error if non zero completion. Start new process running on separate thread. Note: cmd monitor will issue exec_term if timeout limit is reached before next start command does it. Error will be issued by exec_term if non zero return code or if process had to be cancelled.private intcmd_startup(String cmd_line) start Windows command processer with synchronized buffered output to log.private voidissue timeout errorprivate voidcommands_command(String cmd_parm1, String cmd_parm2) display alphabetical list of basic and extended commandsvoidEvent notification when a component is hiddenvoidEvent notification when a component is movedvoidEvent notification when a component is resizedvoidEvent notification when a component is shownprivate voidcopy cmd error to log a line at a timeprivate voidcopy cmd output to log a byte at a time to handle cmd output with cr/lf (ie TIME)private voidcreate_select_dir(JFileChooser select_dir_chooser) create dialog with file chooser to select current directoryprivate voidcreate_select_file(JFileChooser select_file_chooser) create select file frame with chooser on first call.protected static ImageIconcreateImageIcon(String path, String description) Returns an ImageIcon, or null if the path was invalid.protected voiddisplayInfo(KeyEvent e, String s) display key eventprivate voidexec commandprivate voidabort command if runnung and turn off cmd_mode.private voidexit_main(int rc) terminate the programvoidSave last component to get focusvoidlast component to lose focus (ignored for now)private voidfont_command(String cmd_parm1, String cmd_parm2) reset font size for log, and command line and menu pop-upsprivate intget_dec_int(String cmd_parm) return int from immediate decimal parmprivate intreturn int from immediate hex parm:or regprivate voiddisplay next cmdprivate Stringget_next_parm(StringTokenizer st, boolean ignore_spaces) get string with or without single/double quotes.private Stringget_pad(long num, int pad) format and pad status line number to specified length.private voidrestore prev cmd to z390_cmd_lineprivate Stringget_short_file_name(String file_name) return shortest file name possible with quotes if LSNprivate Stringformat fixed field status line for both z390 gui status line and status log requests Time of date INS total I/O total CMD modeprivate intget_text_char(int work_int) return int value of char or 0 if not printablestatic StringGet string text from system clipboardprivate voidlink to z390\webdoc\index.html or www.z390.org note start parms are /d"path" fileprivate voidlog summary list of commands and help referenceprivate voidload shared tables and file routinesvoidHandle key pressed eventsvoidHandle key released eventsvoidHandle key typed eventsprivate voidloc_command(String cmd_parm1, String cmd_parm2) set location of main window x, yprivate voidlog_command(String cmd_parm1, String cmd_parm2) if OFF specified, turn log off.private voidWrite error to logstatic voidCreate instance of z390 classprivate voidstart monitor to terminate cmd command if timeout limit reachedprivate voidAt monitor_wait intervals, update the z390 GUI title date and time and the status line information. If CMD mode and monitor_wait_total greater than timeout_interval then abort CMD. If monitor_wait_total greater than status_interval then update and log status line in batch or command mode. If current time beyond main_demo timeout then terminate. reset focus to z390_cmd_line after updatevoidHandle mouse click eventvoidHandle mouse eventvoidHandle mouse eventvoidPopup edit menu on right mouse clickvoidHandle mouse release eventprivate voidOpen log fileprivate booleanoptions_command(JCheckBoxMenuItem option_men, String cmd_parm1, String cmd_parm2) check or uncheck option menu item and update option parm lists for commandsprivate voiddisplay Java security access permissionsprivate voidcancel cmd, or gui cmd in response to F3 or CTRL-BREAKprivate voidprocess_command(String cmd_text) Process a command: parse parms and execute z390 command if found * in position 1 is a comment space or null logged as blank line If not a known z390 command, issue CMD Windows command. Notes: z390_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.private voiddisplay z390 version and copyrightprivate voidWrite message to log file and to console if console mode or console option on.private voidrebuild z390_cmd and status lines with or without labels to fix current main_panel size.private voiddisplay Windows, Java Runtime, and z390 software releases ledprivate voidreset z390_cmd text and set focusvoidrun()run somethingprivate voidInvoke file chooser dialog to set dir_cur Note: dialog is kept for non gui mode to avoid dispose causing gui shutdown on last windowprivate voidselect_file(String file_cmd, String file_type, String file_opt) Invoke file chooser dialog to set selected_file_name within select_file_type if any.private voidcalculate gui object sizes based on screen size and font sizeprivate intset_main_mode(String[] args) Set main program execution mode.private voidinstall hook for shutdown when -Xrs VM setprivate voidset_startup_parm_options(String[] args) process startup parms: /G - graphical interface (default) /NP - no permissions (supress checking permissions /NT - no unique log file timestamps /RT - regress test mode (supress time stamps /SC file - startup cmd mode file (.bat)private voidreset font size for menu, log, cmd and status lineprivate voidset tooltips after font changesstatic voidsetClipboard(String str) put string to system clipboardprivate voidshut_down(int return_code) cancel threads and exit with rc (turn off runtime shutdown exitprivate voidsize_command(String cmd_parm1, String cmd_parm2) resize main windowprivate voidsleep for monitor interval if not abortbooleandocument start from urlprivate voidstatus_command(String cmd_parm1, String cmd_parm2) set status line display on or off or set interval for logging status.private voidupdate status interval and write status line to logprivate voidlink to online support www.z390.orgprivate voidsync the cmd task directory with current directory.private Stringreturn date and time if tz390.opt_timingprivate voidtimeout_command(String cmd_parm1, String cmd_parm2) set timeout interval in seconds used to timeout commands when not in command mode.private voidtitle_command(String cmd_parm1, String cmd_parm2) set GUI window titleprivate voidupdate main frame title with current date and time.private voidupdate log and command line size following any of the following changes: Change in window size Change in font size
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDvariable- See Also:
-
tz390
tz390 tz390variable -
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 -
z390_errors
int z390_errorsvariable -
cmd_error
boolean cmd_errorvariable -
max_errors
int max_errorsvariable -
main_applet
boolean main_appletrunning as browser applet -
main_gui
boolean main_guiparm = /g -
main_console
boolean main_consoleparm = /c -
main_batch
boolean main_batchparm = file name -
main_title
String main_titlevariable -
check_perms
boolean check_permsreset with /NP -
perm_file_user_dir
boolean perm_file_user_dirset if user.dir ok -
perm_file_read
boolean perm_file_readset if read ok -
perm_file_write
boolean perm_file_writeset if write ok -
perm_file_execute
boolean perm_file_executeset if exec ok -
perm_runtime_thread
boolean perm_runtime_threadset if popup file chooser ok -
perm_file_log
boolean perm_file_logset if write log ok -
perm_select
boolean perm_selectset if select dir/file ok -
main_demo
boolean main_demoset if no permissions -
main_lic
boolean main_licset if permissions ok -
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 -
dir_cur_file
File dir_cur_filecurrent directory file -
log_file_name
String log_file_namevariable -
log_tod
boolean log_todvariable -
log_file
BufferedWriter log_filevariable -
max_line_length
int max_line_lengthvariable -
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 -
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 -
cmd_mode
boolean cmd_modevariable -
cmd_running
boolean cmd_runningvariable -
cmd_io_total
int cmd_io_totalvariable -
cmd_exec_process
Process cmd_exec_processvariable -
cmd_exec_error_reader
BufferedReader cmd_exec_error_readervariable -
cmd_exec_output_reader
BufferedReader cmd_exec_output_readervariable -
cmd_exec_input_writer
PrintStream cmd_exec_input_writervariable -
cmd_exec_error_msg
String cmd_exec_error_msgvariable -
cmd_exec_output_msg
String cmd_exec_output_msgvariable -
cmd_exec_process_thread
Thread cmd_exec_process_threadvariable -
cmd_exec_error_reader_thread
Thread cmd_exec_error_reader_threadvariable -
cmd_exec_output_reader_thread
Thread cmd_exec_output_reader_threadvariable -
cmd_exec_rc
int cmd_exec_rcvariable -
cmd_line
String cmd_linevariable -
last_cmd_line
String last_cmd_linevariable -
shutdown_exit
boolean shutdown_exitvariable -
ascii_lf
int ascii_lfvariable -
ascii_cr
int ascii_crvariable -
refresh_request
boolean refresh_requestvariable -
main_status
boolean main_statusvariable -
main_frame
JFrame main_framevariable -
main_width
int main_widthvariable -
main_height
int main_heightvariable -
main_border
int main_bordervariable -
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 -
title_height
int title_heightvariable -
font_width
int font_widthvariable -
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_columns
int command_columnsvariable -
command_height
int command_heightvariable -
status_height
int status_heightvariable -
applet_status_height
int applet_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 -
log_view
JScrollPane log_viewvariable -
cmd_label
JLabel cmd_labelvariable -
z390_cmd_line
JTextField z390_cmd_linevariable -
status_line_label
JLabel status_line_labelvariable -
status_line
JTextField status_linevariable -
cur_cmd
int cur_cmdindex of most recent comment entered -
end_cmd
int end_cmdindex of highest cmd entered -
max_cmd
int max_cmdvariable -
view_cmd
int view_cmdindex of current cmd in view -
view_restore
boolean view_restorevariable -
cmd_history
String[] cmd_historyvariable -
focus_comp
Component focus_compvariable -
select_dir_frame
JFrame select_dir_framevariable -
select_file_frame
JFrame select_file_framevariable -
selected_file
File selected_filevariable -
selected_file_name
String selected_file_namevariable -
selected_dir_name
String selected_dir_namevariable -
select_cmd
String select_cmdvariable -
select_file_type
String select_file_typevariable -
select_opt
String select_optvariable -
bat_file_name
String bat_file_namevariable -
mac_opt
String mac_optvariable -
asm_opt
String asm_optvariable -
asml_opt
String asml_optvariable -
asmlg_opt
String asmlg_optvariable -
job_opt
String job_optvariable -
link_opt
String link_optvariable -
exec_opt
String exec_optvariable -
web_site
String web_sitevariable -
install_loc
String install_locvariable -
install_webdoc
String install_webdocvariable -
sysin_file_name
String sysin_file_namevariable -
syslib_dir_name
String syslib_dir_namevariable -
sysout_dir_name
String sysout_dir_namevariable -
print_option
boolean print_optionvariable -
anim_option
boolean anim_optionvariable
-
-
Constructor Details
-
z390
public z390()Dummy constructor - no initialization needed
-
-
Method Details
-
main
Create instance of z390 class- Parameters:
args- argument string
-
set_main_mode
Set main program execution mode. Set security permissions Notes:- called from main or init before z390 instance started so only set class variables
- Parameters:
args- argument string- Returns:
- 16 on error, 0 if okay.
-
set_startup_parm_options
process startup parms:- /G - graphical interface (default)
- /NP - no permissions (supress checking permissions
- /NT - no unique log file timestamps
- /RT - regress test mode (supress time stamps
- /SC file - startup cmd mode file (.bat)
- Parameters:
args- argument string
-
log_command
if OFF specified, turn log off. If file specified, open new log. else error.- Parameters:
cmd_parm1- argument stringcmd_parm2- not used
-
open_log_file
private void open_log_file()Open log file -
close_log_file
private void close_log_file()Close log file -
close_all_files
private void close_all_files()display error total on log and close data and log files -
log_error
Write error to log- Parameters:
error- error numbermsg- error message text
-
abort_error
Abort with error message- Parameters:
error- error numbermsg- 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
-
set_runtime_hooks
private void set_runtime_hooks()install hook for shutdown when -Xrs VM set -
put_copyright
private void put_copyright()display z390 version and copyright -
put_log
Write message to log file and to console if console mode or console option on.- Parameters:
msg- message text
-
process_command
Process a command:- parse parms and execute z390 command if found
- * in position 1 is a comment
- space or null logged as blank line
- If not a known z390 command, issue CMD Windows command.
- z390_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_text- command string
- parse parms and execute z390 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 z390_cmd_line -
get_next_cmd
private void get_next_cmd()display next cmd -
time_stamp
return date and time if tz390.opt_timing- Returns:
- date and time as a string value
-
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- string tokenizerignore_spaces- flag to ignore/honor spaces- Returns:
- next token as text
-
about_command
private void about_command()write basic info to log -
font_command
reset font size for log, and command line and menu pop-ups- Parameters:
cmd_parm1- requested font size as textcmd_parm2- not used
-
set_text_font
private void set_text_font()reset font size for menu, log, cmd and status line -
get_dec_int
return int from immediate decimal parm- Parameters:
cmd_parm- input text parameter- Returns:
- decimal value of input parameter
-
get_int
return int from immediate hex parm:or reg- Parameters:
cmd_parm- input parameter in text format- Returns:
- decimal value from input parameter
-
get_text_char
private int get_text_char(int work_int) return int value of char or 0 if not printable- Parameters:
work_int- integer input value- Returns:
- input value, or adjusted integer value
-
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 -
cmd_startup
start Windows command processer with synchronized buffered output to log.- If cmd_line is null, set cmd_mode and start command processor without command.
- Future commands in cmd_mode will be passed to processor via cmd_exec_input_writer.
- Parameters:
cmd_line- command text- Returns:
- return code
-
sleep_now
private void sleep_now()sleep for monitor interval if not abort -
sync_cmd_dir
private void sync_cmd_dir()sync the cmd task directory with current directory. -
monitor_update
private void monitor_update()- At monitor_wait intervals, update the z390 GUI title date and time and the status line information.
- If CMD mode and monitor_wait_total greater than timeout_interval then abort CMD.
- If monitor_wait_total greater than status_interval then update and log status line in batch or command mode.
- If current time beyond main_demo timeout then terminate.
- reset focus to z390_cmd_line after update
-
cmd_timeout_error
private void cmd_timeout_error()issue timeout error -
cmd_command
exec Windows command as follows:- If cmd_mode set via prior cmd with no command, then all commands are routed to command processor via cmd_exec_input.
- Use BREAK key or EXIT command passed to command processor to end cmd_mode.
- If prior Windows command is still running, display current status and request user hit break or retry later.
- If cmd_mode not set then start command processor via call to cmd_exec_start.
- See STATUS command to set interval for display of status of long running commands.
- Parameters:
cmd- command text
- If cmd_mode set via prior cmd with no command, then all commands are routed to command processor via cmd_exec_input.
-
get_status_line
format fixed field status line for both z390 gui status line and status log requests- Time of date
- INS total
- I/O total
- CMD mode
- Returns:
- status text
-
get_pad
format and pad status line number to specified length. If number 0, return all spaces. If number > 1000, return K.- Parameters:
num- number of pad characters to generatepad- pad character to use- Returns:
- padding string
-
status_log_update
private void status_log_update()update status interval and write status line to log -
init_z390
load shared tables and file routines- 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 the program- Parameters:
rc- return code
-
set_gui_size
private void set_gui_size()calculate gui object sizes based on screen size and font size -
build_log_view
private void build_log_view()build scrolling log view based on current screen and font size -
build_z390_cmd_line
private void build_z390_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
-
exec_gui_command
private void exec_gui_command()exec command -
perm_command
private void perm_command()display Java security access permissions -
rel_command
private void rel_command()display Windows, Java Runtime, and z390 software releases led -
guide_command
private void guide_command()link to z390\webdoc\index.html or www.z390.org note start parms are /d"path" file -
reset_z390_cmd
private void reset_z390_cmd()reset z390_cmd text and set focus -
support_command
private void support_command()link to online support www.z390.org -
start_doc
document start from url- Parameters:
url- url of command to be executed- Returns:
- false on error, true otherwise
-
getClipboard
Get string text from system clipboard- Returns:
- text from clipboard
-
setClipboard
put string to system clipboard- Parameters:
str- string to write to clipboard
-
keyPressed
Handle key pressed events- Specified by:
keyPressedin interfaceKeyListener- Parameters:
e- keypress event
-
process_cancel_key
private void process_cancel_key()cancel cmd, or gui cmd in response to F3 or CTRL-BREAK -
keyTyped
Handle key typed events- Specified by:
keyTypedin interfaceKeyListener- Parameters:
e- keypress event
-
keyReleased
Handle key released events- Specified by:
keyReleasedin interfaceKeyListener- Parameters:
e- keypress event
-
displayInfo
display key event- Parameters:
e- keypress events- Key pressed as text
-
mousePressed
Popup edit menu on right mouse click- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e- mouse event
-
mouseReleased
Handle mouse release event- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
e- mouse event
-
mouseEntered
Handle mouse event- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
e- mouse event
-
mouseExited
Handle mouse event- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
e- mouse event
-
mouseClicked
Handle mouse click event- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
e- mouse event
-
focusLost
last component to lose focus (ignored for now)- Specified by:
focusLostin interfaceFocusListener
-
focusGained
Save last component to get focus- 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 z390. -
loc_command
set location of main window x, y- Parameters:
cmd_parm1- first command parametercmd_parm2- second command parameter
-
size_command
resize main window- Parameters:
cmd_parm1- first command parametercmd_parm2- second command parameter
-
status_command
set status line display on or off or set interval for logging status. If seconds specified as 0 or null, logging status is turned off- Parameters:
cmd_parm1- first command parametercmd_parm2- not used
-
title_command
set GUI window title- Parameters:
cmd_parm1- command parametercmd_parm2- not used
-
timeout_command
set timeout interval in seconds used to timeout commands when not in command mode. Default is 3 seconds. Issue command with no arugment to turn off timeout. Commands can be cancelled via BREAK.- Parameters:
cmd_parm1- timeout limit as textcmd_parm2- not used
-
options_command
check or uncheck option menu item and update option parm lists for commands- Parameters:
option_men- menu optioncmd_parm1- command parametercmd_parm2- not used- Returns:
- flag: true of false
-
cd_command
set current directory using file chooser dialog if parm1 null else use path- Parameters:
cmd_parm1- command parameter
-
select_dir
private void select_dir()Invoke file chooser dialog to set dir_cur Note:- dialog is kept for non gui mode to avoid dispose causing gui shutdown on last window
-
create_select_dir
create dialog with file chooser to select current directory- Parameters:
select_dir_chooser- file chooser object
-
select_file
Invoke file chooser dialog to set selected_file_name within select_file_type if any. Notes:- Note dialog is kept for non gui mode to avoid dispose causing gui shutdown on last window)
- Parameters:
file_cmd- select commandfile_type- file typefile_opt- file option (not used)
-
create_select_file
create select file frame with chooser on first call. It is updated after that.- Parameters:
select_file_chooser- file chooser object
-
get_short_file_name
return shortest file name possible with quotes if LSN- Parameters:
file_name- file name- Returns:
- file name
-
commands_command
display alphabetical list of basic and extended commands- Parameters:
cmd_parm1- not usedcmd_parm2- not used
-
createImageIcon
Returns an ImageIcon, or null if the path was invalid.- Parameters:
path- - full path and file namedescription- - description to add to ImageIcon- Returns:
- ImageIcon
-
check_main_view
private void check_main_view()if main window size has changed due to user streching without window event handler triggering update, do it now. -
update_main_view
private void update_main_view()update log and command line size following any of the following changes:- Change in window size
- Change in font size
-
rebuild_lines
private void rebuild_lines()rebuild z390_cmd and status lines with or without labels to fix current main_panel size. start by removing labels and lines -
componentHidden
Event notification when a component is hidden- Specified by:
componentHiddenin interfaceComponentListener- Parameters:
e- component event
-
componentMoved
Event notification when a component is moved- Specified by:
componentMovedin interfaceComponentListener- Parameters:
e- component event
-
componentResized
Event notification when a component is resized- Specified by:
componentResizedin interfaceComponentListener- Parameters:
e- component event
-
componentShown
Event notification when a component is shown- Specified by:
componentShownin interfaceComponentListener- Parameters:
e- component event
-
cmd_exec_start
- Terminate any prior exec process with error if non zero completion.
- Start new process running on separate thread.
- cmd monitor will issue exec_term if timeout limit is reached before next start command does it.
- Error will be issued by exec_term if non zero return code or if process had to be cancelled.
- Parameters:
exec_cmd- command to be executed- Returns:
- -1 if exception occurred; 0 otherwise
-
cmd_exec_input
send input to exec command in process- Parameters:
cmd_line- command text
-
cmd_exec_rc
private int cmd_exec_rc()- return ending rc else -1
- return 0 if no process defined
- Returns:
- return code
-
cmd_exec_cancel
private void cmd_exec_cancel()cancel exec process -
run
public void run()run something -
copy_cmd_output_to_log
private void copy_cmd_output_to_log()copy cmd output to log a byte at a time to handle cmd output with cr/lf (ie TIME) -
copy_cmd_error_to_log
private void copy_cmd_error_to_log()copy cmd error to log a line at a time -
batch_cmd
invoke batch command with specified file and options. If file is null, invoke file selection dialog with specified file type and then launch batch command when selection dialog closes. Notes:- select_file_type is set to filter files to type for command.
- select_opt is set to any override options for command. The override options are updated on any change to the options menu.
- CMD mode is started if not already running and mult batch commands just queue up for single process.
- EDIT command is launched separately in parallel to allow multiple edits to run.
- Editor is defined by EDIT environment variable else it uses hard coded default.
- JOB launches selected BAT file with options
- Parameters:
bat_cmd- batch commandbat_file_name- batch file namebat_file_type- batch file typebat_opt- batch file options
-