Release notes for v1_1 of swiftappj

added java_dev/wicolor/db/basic_pdf_report.java added java_dev/wicolor/db/combo_date_editor.java added java_dev/wicolor/db/combo_string_editor.java added java_dev/wicolor/db/compact_applet_editor.fil added java_dev/wicolor/db/compact_applet_editor.java added java_dev/wicolor/db/editable_date_combo.fil added java_dev/wicolor/db/editable_date_combo.java added java_dev/wicolor/db/editable_string_combo.fil added java_dev/wicolor/db/editable_string_combo.java added java_dev/wicolor/db/label_page.java added java_dev/wicolor/db/lock_manager.java added java_dev/wicolor/db/table_column_delegate.java added java_dev/wicolor/db/text_delegate_panel.fil added java_dev/wicolor/db/text_delegate_panel.java added java_dev/wicolor/form/text_delegate.java Index: java_dev/wicolor/app_desktop/connection_manager.java =================================================================== RCS file: /cvsroot/swiftappj/java_dev/wicolor/app_desktop/connection_manager.java,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 connection_manager.java *** java_dev/wicolor/app_desktop/connection_manager.java 2001/10/11 20:04:06 1.1.1.1 --- java_dev/wicolor/app_desktop/connection_manager.java 2001/11/22 18:39:24 *************** *** 1,6 **** package com.wicolor.app_desktop; import com.wicolor.db.*; ! import java.sql.*; import java.util.*; import javax.swing.*; --- 1,6 ---- package com.wicolor.app_desktop; import com.wicolor.db.*; ! import java.awt.*; import java.sql.*; import java.util.*; import javax.swing.*; *************** *** 1283,1288 **** --- 1283,1319 ---- new ActionListener() { public void actionPerformed(java.awt.event.ActionEvent A) { + + + ///////////////////////////// + + /** + + Window comps1[] =JOptionPane.getRootFrame().getOwnedWindows(); + + System.out.println(" DIALOG TIMER \n"); + + for (int i=0;i 60) { Index: java_dev/wicolor/conversion_reader/csv_reader.java =================================================================== RCS file: /cvsroot/swiftappj/java_dev/wicolor/conversion_reader/csv_reader.java,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 csv_reader.java *** java_dev/wicolor/conversion_reader/csv_reader.java 2001/10/11 20:04:50 1.1.1.1 --- java_dev/wicolor/conversion_reader/csv_reader.java 2001/11/22 18:40:07 *************** *** 61,66 **** --- 61,72 ----
1.2 updated correct_csv() to properly handle nulls either embedded or at ends of row
10/3/2001
further corrections to correct_csv() constructor taking InputStream,TableModel 10/8/2001 +
corrected end string index in correct_csv() 10/15/2001 +
corrected csv_reader(InputStream extern_in_file,AbstractTableModel model) +
was discarding first line on read 11/01/01 +
/** replace \n with ^ +
in public static String get_vector_as_csv(Vector v) 11/8/2001 +
===========================================================================

Functional Description : *************** *** 223,234 **** in_buf = new BufferedReader(in_trans); try{ - - String msg = in_buf.readLine(); ! if (msg != null) error_string = new String(msg); else --- 229,241 ---- in_buf = new BufferedReader(in_trans); + /** try{ ! // not needed when setting into table model String msg = in_buf.readLine(); ! // 11/01/01 ! if (msg != null) error_string = new String(msg); else *************** *** 238,244 **** { error_string = new String("ERROR READING DATA SOURCE"); } ! try{ --- 245,251 ---- { error_string = new String("ERROR READING DATA SOURCE"); } ! */ try{ *************** *** 668,674 **** int idx1,idx2; int start = 0; ! int end = in_str.length() -1; char chars[] = in_str.trim().toCharArray(); --- 675,682 ---- int idx1,idx2; int start = 0; ! // mod 10/15/2001 was without trim ! int end = in_str.trim().length() -1; char chars[] = in_str.trim().toCharArray(); *************** *** 927,932 **** --- 935,942 ---- /** returns CSV String representing Vector row */ + + /** replace \n with ^ */ public static String get_vector_as_csv(Vector v) { StringBuffer buf = new StringBuffer(); String temp_str; *************** *** 938,944 **** else if ((v.elementAt(i) != null) && (i 25) // break; ! // System.out.println(st1.substring(0,55)); } } --- 486,492 ---- counter ++; //if (counter >25) // break; ! System.out.println(st1.substring(0,45)); } } Index: java_dev/wicolor/db/binary_search_array.java =================================================================== RCS file: /cvsroot/swiftappj/java_dev/wicolor/db/binary_search_array.java,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 binary_search_array.java *** java_dev/wicolor/db/binary_search_array.java 2001/10/11 20:06:13 1.1.1.1 --- java_dev/wicolor/db/binary_search_array.java 2001/11/22 18:41:30 *************** *** 152,159 **** ref = new String(ref_); contents = qry_results.toArray(); size = contents.length; ! for(int i=0;i
1.1 made initialization safe in cases where coloum name may contain commas 6/25/2001
allowed inititlization from nonsql_table_model , data_table_model 9/17/2001 +
1.2 int cols = model.getColumnCount(); 10/22/2001 +
changed to int cols = model.get_actual_column_count(); +
if nonsql table model in table model constructor 10/22/01
===========================================================================

Functional Description : allows an item to be passed to generic updater *************** *** 113,119 **** /** figure out metadata from a table model */ public csv_metadata(AbstractTableModel model) ! { int cols = model.getColumnCount(); col_sql_types = new int[cols]; names = new String[cols]; --- 116,133 ---- /** figure out metadata from a table model */ public csv_metadata(AbstractTableModel model) ! { // int cols = model.getColumnCount(); 10/22/2001 ! int cols = 0; ! ! ! if (model instanceof nonsql_table_model) ! cols = ((nonsql_table_model) model).get_actual_column_count(); ! else ! if (model instanceof data_table_model) ! cols = ((data_table_model) model).get_actual_column_count(); ! else ! cols = model.getColumnCount(); ! col_sql_types = new int[cols]; names = new String[cols]; Index: java_dev/wicolor/db/data_table_model.java =================================================================== RCS file: /cvsroot/swiftappj/java_dev/wicolor/db/data_table_model.java,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 data_table_model.java *** java_dev/wicolor/db/data_table_model.java 2001/10/11 20:08:16 1.1.1.1 --- java_dev/wicolor/db/data_table_model.java 2001/11/22 18:43:17 *************** *** 14,19 **** --- 14,25 ---- import java.io.*; import java.util.*; import javax.swing.table.*; + import java.net.*; + + + + + /**
===========================================================================
*************** *** 96,101 **** --- 102,109 ----
1.71 use get_actual_column_count() instead of getColumncount() in move_row_in() to allow
use with num_disp_cols 9/24/2001
added inserts_from_csv() method 10/08/2001 +
changed cast from Integer to Number in get_int_count(Vector v) //10/26/2001 +
some types of count queries return Long or whatever instead of int
===========================================================================
Functional Description: *************** *** 325,331 **** --- 333,345 ---- public static final int TIME =5; // added 08/09/01 + + + + + + /** sets reference to arbitrary callback procedure */ public void set_callback(general_callback callback_) *************** *** 5120,5127 **** Vector tmp_vec = (Vector) v.elementAt(0); ! ! tmp_int = ((Integer)tmp_vec.elementAt(0)).intValue(); } --- 5134,5141 ---- Vector tmp_vec = (Vector) v.elementAt(0); ! //10/26/2001 ! tmp_int = ((Number)tmp_vec.elementAt(0)).intValue(); } *************** *** 7561,7572 **** ! ////////////////////////////////////////////////////////////////////// ! /* public void set_app_name( String app_name_) { ! application_name=new String( app_name_); } ! */ ! ! } --- 7575,7605 ---- ! ! /** convenience method to package an update string from a satement_preparer by ! attaching to a Vector ! */ ! public static Vector package_update(statement_preparer update) { ! Vector ret_vec = new Vector(); ! ! ret_vec.addElement(update.get_string_no_reset()); ! return ret_vec; ! } ! ! ! public static Vector package_object(Object update) ! { ! Vector ret_vec = new Vector(); ! ! ret_vec.addElement(update); ! return ret_vec; ! ! } ! ! ! ! ! } Index: java_dev/wicolor/db/database_checker.java =================================================================== RCS file: /cvsroot/swiftappj/java_dev/wicolor/db/database_checker.java,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 database_checker.java *** java_dev/wicolor/db/database_checker.java 2001/10/11 20:07:28 1.1.1.1 --- java_dev/wicolor/db/database_checker.java 2001/11/22 18:43:23 *************** *** 38,51 ****
file name:s:/java_dev/db/database_checker.java
generated file:NONE
by: d r gregoire !
date: 03/28/2001 !
version: 1.0



version control log :
--------*-----------------------------------------------*----------------
1.0 * initial version * 3/28/2001 &&
===========================================================================
Functional Description: simple, script-based automated database
maintenance program, made to be used from a cron --- 38,55 ----
file name:s:/java_dev/db/database_checker.java
generated file:NONE
by: d r gregoire !
date: 11/5/2001 !
version: 1.1



version control log :
--------*-----------------------------------------------*----------------
1.0 * initial version * 3/28/2001 && +
1.1 corrected handling of: +
blank lines +
handling of pass on false tests +
added disp_trace on exception 11/5/2001
===========================================================================
Functional Description: simple, script-based automated database
maintenance program, made to be used from a cron *************** *** 142,169 **** System.out.println( ln); continue; } - System.out.println("\n****\n****\n****"); cmd_tok = new StringTokenizer(ln,";"); primary_cmd = cmd_tok.nextToken().replace(';',' ').trim(); conditional_cmd = cmd_tok.nextToken().replace(';',' ').trim(); //System.out.println(" pri " + primary_cmd + " sec " + conditional_cmd); ! if (model.checks_ok(primary_cmd,"OK",true,3)) { System.out.println(" CHECK OK \n*** EXECUTING CONDITIONAL CMD " ); model.checks_ok(conditional_cmd,"OK",true,3); }else { ! System.out.println(" ========== CHECK FAILED!!!!!! \n COMMAND : " ! + conditional_cmd + " NOT EXECUTED !!!!!!!!"); } --- 146,201 ---- System.out.println( ln); continue; } + if (ln.trim().length() ==0) // don't bomb on empty lines + continue; System.out.println("\n****\n****\n****"); cmd_tok = new StringTokenizer(ln,";"); + if (cmd_tok.countTokens() >=2)// make sure it at least has two tokens + { + + primary_cmd = cmd_tok.nextToken().replace(';',' ').trim(); conditional_cmd = cmd_tok.nextToken().replace(';',' ').trim(); + boolean check_on = true; + + if (cmd_tok.hasMoreTokens())// if another token check for "true" "false" + { + String bool_tok = cmd_tok.nextToken().trim(); + + if ("false".equalsIgnoreCase(bool_tok)) + check_on = false; + else + + if ("true".equalsIgnoreCase(bool_tok)) + check_on = true; + + + + + } + + + + //System.out.println(" pri " + primary_cmd + " sec " + conditional_cmd); ! if (model.checks_ok(primary_cmd,"OK",check_on,3)) { System.out.println(" CHECK OK \n*** EXECUTING CONDITIONAL CMD " ); model.checks_ok(conditional_cmd,"OK",true,3); }else { ! System.out.println("PASS ON :" + check_on + " === CHECK FAILED!!!!!! \n COMMAND : " ! + conditional_cmd + "\nEXECUTE ON : " + check_on + " CMD NOT EXECUTED !!!!!!!!"); } + } else + System.out.println(" IMPROPER COMMAND LINE: " + ln + "\n"); *************** *** 175,181 **** }catch (Exception e) { ! System.out.println(" TABLE CHECKS FAILED " + new java.util.Date() + "\n"); e.printStackTrace(); } --- 207,215 ---- }catch (Exception e) { ! System.out.println(" TABLE CHECKS FAILED " + new java.util.Date() + "\n" ! + com.wicolor.form.field_defaults.disp_trace(e,false) ! ); e.printStackTrace(); } Index: java_dev/wicolor/db/mult_select_panel.fil =================================================================== RCS file: /cvsroot/swiftappj/java_dev/wicolor/db/mult_select_panel.fil,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 mult_select_panel.fil *** java_dev/wicolor/db/mult_select_panel.fil 2001/10/11 20:14:30 1.1.1.1 --- java_dev/wicolor/db/mult_select_panel.fil 2001/11/22 18:49:22 *************** *** 7,13 **** parent none el_type 99 JFrame constraint 5 ! size 652 125 label Frame layout 0 --- 7,13 ---- parent none el_type 99 JFrame constraint 5 ! size 652 106 label Frame layout 0 *************** *** 482,487 **** --- 482,495 ---- } // end of method + + public void dec_height(int amt){ + setPreferredSize( + new Dimension(getPreferredSize().width,getPreferredSize().height - amt) ); + } + + + #end_add_code# Index: java_dev/wicolor/db/mult_select_panel.java =================================================================== RCS file: /cvsroot/swiftappj/java_dev/wicolor/db/mult_select_panel.java,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 mult_select_panel.java *** java_dev/wicolor/db/mult_select_panel.java 2001/10/11 20:14:41 1.1.1.1 --- java_dev/wicolor/db/mult_select_panel.java 2001/11/22 18:49:22 *************** *** 232,238 **** // beginning of object adds setLayout(new BorderLayout()); ! setPreferredSize( new Dimension(644,96)); setMinimumSize( new Dimension(10,10)); add(sel_panel,"Center"); --- 232,238 ---- // beginning of object adds setLayout(new BorderLayout()); ! setPreferredSize( new Dimension(644,77)); setMinimumSize( new Dimension(10,10)); add(sel_panel,"Center"); *************** *** 604,610 **** --- 604,618 ---- } // end of method + + public void dec_height(int amt){ + setPreferredSize( + new Dimension(getPreferredSize().width,getPreferredSize().height - amt) ); + } + + + Index: java_dev/wicolor/db/nonsql_table_model.java =================================================================== RCS file: /cvsroot/swiftappj/java_dev/wicolor/db/nonsql_table_model.java,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 nonsql_table_model.java *** java_dev/wicolor/db/nonsql_table_model.java 2001/10/11 20:15:05 1.1.1.1 --- java_dev/wicolor/db/nonsql_table_model.java 2001/11/22 18:50:03 *************** *** 75,80 **** --- 75,86 ----
1.3.1 use get_actual_column_count() instead of getColumncount() in move_row_in() to allow
use with num_disp_cols 9/24/2001 +
modified dump_string(Vector titles,Vector data) to gracefully handle +
missing / empty titles or data null or empty added get_blank() 10/16/2001 +
1.3.2 added public boolean insert_row(Vector in_row,int idx), +
get_actual_column_count() in get_names_copy() 10/22/2001 +
added FileInputStream get_file_load(String load_file) 10/29/2001 +
corrected csv read/save methods 11/1/01
===========================================================================
Functional Description: *************** *** 372,377 **** --- 378,390 ---- */ public boolean move_row_in(Vector in_row) { + /** + JOptionPane.showMessageDialog(null, " " + in_row + + "\n actual " + get_actual_column_count(), + " super!!", + JOptionPane.ERROR_MESSAGE); + */ + Vector local_temp; if (in_row == null) return false; *************** *** 383,389 **** { ! for (i = 0;i getRowCount())) + return false; + local_temp = new Vector(); + //if (in_row.size() >= getColumnCount()) // was columncount + // changed to allow num_disp_cols to work + if (in_row.size() >= get_actual_column_count()) + { + + + for (i = 0;i pad_wids.length) { --- 2913,2951 ---- */ public String dump_string(Vector titles,Vector data) ! { int pad_wids[] = null; ! StringBuffer buf = new StringBuffer(); ! if ((titles != null) && (titles.size() >0)) ! { ! ! ! Vector temp_row = (Vector) titles.elementAt(0); ! pad_wids = new int[temp_row.size()]; for (int i = 0;i0)) // protect against exception if no data present + + { + + temp_row = (Vector) data.elementAt(0); if (temp_row.size() > pad_wids.length) { *************** *** 2771,2781 **** pad_wids[i]+=1; System.out.println("i" + pad_wids[i]); } ! ! StringBuffer buf = new StringBuffer(); buf.append("\n" + dump_string(titles,pad_wids)); buf.append("\n"+ dump_string(data,pad_wids)); return buf.toString(); --- 2989,3004 ---- pad_wids[i]+=1; System.out.println("i" + pad_wids[i]); } ! } ! ! if ((titles != null) && (titles.size() >0)) buf.append("\n" + dump_string(titles,pad_wids)); + + if ((data != null ) && (data.size() >0)) // protect against exception if no data present buf.append("\n"+ dump_string(data,pad_wids)); + else buf.append(new String(" NO RECORDS \n ")); + return buf.toString(); *************** *** 3056,3062 **** { Vector name_copy = new Vector(); Vector tmp_nam = new Vector(); ! for (int i=0;i version control log :
--------*-----------------------------------------------*----------------
1.0 * initial version * 2/07/00 && +
1.1 assure full 4 -digit year is set before returning a value 11/12/2001
===========================================================================

Functional Description : formated date entry for use in form design *************** *** 103,108 **** --- 104,110 ---- static java.text.SimpleDateFormat aux_format = new java.text.SimpleDateFormat("MMM dd,yyyy"); + String format_str ="MMM dd,yyyy"; protected Object old_val = null; protected String place_holder_chars = "MMM dd,YYYY"; *************** *** 275,281 **** { try { ! if ( getText() == null) return null; else { --- 277,283 ---- { try { ! if( ( getText() == null) || getText().trim().length() =========================================================================== *************** *** 69,74 **** --- 70,78 ----
added disp_trace(e,boolean) second param controls whether dialog is shown or not 9/18/2001
added delete_from_string_pos(JtextArea txt, String from)
added get_current_date 9/19/2001 +
added get_text_editor() with mask specified 10/16/2001 +
added get_formatted_full_date 11/13/2001 +
date,time renderers now show debugg values on improper class use 11/16/2001
===========================================================================
Functional Description : *************** *** 97,102 **** --- 101,108 ---- public static String DEFAULT_PRINT_TMP_DIR = null; public static String DEFAULT_APP_ROOT_DIR = null; public static java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("MMM dd,yyyy"); + public static java.text.SimpleDateFormat full_date = new java.text.SimpleDateFormat("MMM dd,yyyy h:m aa"); + static{ // static inititlization block, read init props from file // warn if file not found *************** *** 439,444 **** --- 445,461 ---- { return new text_cell_editor(new text_field(width),width); } + + public static text_cell_editor get_text_editor(String mask) + { + text_field field = new text_field(mask.length()); + + + return new text_cell_editor(field,mask); + } + + + public static double_cell_editor get_double_editor(int width,int dec) { *************** *** 2062,2070 **** formatter = new java.text.SimpleDateFormat("MMM dd,yyyy"); } ! setText((value == null) ? "" : formatter.format(value)); } ! } static class time_renderer extends DefaultTableCellRenderer { --- 2079,2102 ---- formatter = new java.text.SimpleDateFormat("MMM dd,yyyy"); } ! if ((value == null)|| (value instanceof java.sql.Date)) ! setText((value == null) ? "" : formatter.format(value)); ! ! ! ! else ! { ! ! ! ! setText((value == null) ? "**" : value.toString()+"***"); ! if (value != null) ! System.out.println(" class" + value.getClass()); ! } ! ! } } ! static class time_renderer extends DefaultTableCellRenderer { *************** *** 2077,2083 **** --- 2109,2125 ---- formatter = new java.text.SimpleDateFormat("hh:mm aa" ); } + if((value == null)|| (value instanceof java.sql.Time )) setText((value == null) ? "" : formatter.format(value)); + { + + + + setText((value == null) ? "**" : value.toString()+"***"); + if (value != null) + System.out.println(" class" + value.getClass()); + } + } } *************** *** 2118,2124 **** } ! public static java.sql.Date get_current_date() { --- 2160,2169 ---- } ! public static java.sql.Time get_current_time() ! { ! return new java.sql.Time( new java.util.Date().getTime() ); ! } public static java.sql.Date get_current_date() { *************** *** 2129,2133 **** --- 2174,2278 ---- { return formatter.format(get_current_date()); } + + // 11/01/01 + public static String get_formatted_date(java.sql.Date date) + { + return formatter.format(date); + } + + // 11/01/01 + public static String get_formatted_date(java.util.Date date) + { + return formatter.format(date); + } + + public static String get_formatted_full_date(java.sql.Date date) + { + return full_date.format(date); + } + + // 11/01/01 + public static String get_formatted_full_date(java.util.Date date) + { + return full_date.format(date); + } + + + public static javax.swing.Timer install_dlg_timer() + { + javax.swing.Timer timer = new javax.swing.Timer(10000, + + + new ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent A) { + + + ///////////////////////////// + + + + Window comps1[] =JOptionPane.getRootFrame().getOwnedWindows(); + + System.out.println(" DIALOG TIMER \n"); + + for (int i=0;i version control log :
--------*-----------------------------------------------*----------------
1.0 * initial version * 2/07/00 && +
1.1 added constructor that sets mask 10/16/2001
===========================================================================
Functional Description
Rudimentary extension of DefaultCellEditor *************** *** 66,71 **** --- 67,82 ---- txt_fld = editor; } + + public text_cell_editor(text_field editor,String mask ) + { + super (editor); + editor.set_mask(mask); + txt_fld = editor; + + } + + public Component getTableCellEditorComponent(JTable table, Object value, Index: java_dev/wicolor/form/text_field.java =================================================================== RCS file: /cvsroot/swiftappj/java_dev/wicolor/form/text_field.java,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 text_field.java *** java_dev/wicolor/form/text_field.java 2001/10/11 20:24:59 1.1.1.1 --- java_dev/wicolor/form/text_field.java 2001/11/22 18:59:35 *************** *** 57,62 **** --- 57,63 ----
focus_lost
1.2 '^' mask char now obeys case policy
1.3 changed to extend JPasswordField to allow use for 'hidden' text 8/14/2001 +
1.3.1 now properly handles null if adjuster is set 11/9/2001
===========================================================================
Functional Description: *************** *** 1119,1125 **** { if (value == null ) { ! setText(null); return; } try { --- 1120,1132 ---- { if (value == null ) { ! /** now properly handles null if adjuster is set */ ! if (adjuster!= null) ! setText((String)adjuster.adjust_incoming_value(null)); ! else ! setText(null); ! ! return; } try {