/** File: Globals.java */ /** * Class Global variables used as the base class for HTMLtools. * Until we [REFACTOR] the JTV (Java TreeView), TestsIntersection , * and GenBatchScripts converters to * separate applications, the variables reside here. * *
 * List of Methods
 * reinitGlobalSwitches() - reinitialize Global variable switches. 
 * reinitGBSglobalSwitches() - reinitialize GBS Global variable switches.
 * reinitTIglobalSwitches() - reinitialize TestsIntersection Global switches.
 * reinitJTVglobalSwitches() - reinitialize JTV Global variable switches.
 * 
*

* This code is available at the HTMLtools project on SourceForge at * http://htmltools.sourceforge.net/ * under the "Common Public License Version 1.0" * * http://www.opensource.org/licenses/cpl1.0.php.

*

* It was derived and refactored from the open source * MAExplorer (http://maexplorer.sourceforge.net/), and * Open2Dprot (http://Open2Dprot.sourceforge.net/) Table modules. *

* $Date: 2009/12/5 11:45:56 $ $Revision: 1.40 $ *
* Copyright 2008, 2009 by Peter Lemkin * E-Mail: lemkin@users.sourceforge.net * http://lemkingroup.com/ *
*/ public class Globals { /* --- Version specific constants for help menu --- */ /** Program name */ final public static String programName= "HTMLtools"; /** Reference Manual is "MANUAL.html" for CvtTabDelim2HTML * and "ReferenceManual.html" for HTMLtools. */ final public static String referenceManual= "ReferenceManual.html"; /** Open Source help string */ final public static String openSourceNotice= "This code is available at the HTMLtools project on SourceForge at\n"+ "http://htmltools.sourceforge.net/ under the Common Public License Version 1.0\n"+ "http://www.opensource.org/licenses/cpl1.0.php\n"+ "\n"+ "It was derived and refactored from the open source\n"+ "MAExplorer (http://maexplorer.sourceforge.net/), and\n"+ "Open2Dprot (http://Open2Dprot.sourceforge.net/) \n"+ "Copyright 2008, 2009 by Peter Lemkin\n"+ "E-Mail: lemkin@users.sourceforge.net\n"; /** program summary */ final public static String programSummary= " - Summary\n\n"+ programName+" is a Java program to automate the batch conversion of\n"+ "tab-delimited spreadsheet type text files to HTML Web-page files. There are\n"+ "a variety of flexible options to make the Web page presentations more\n"+ "useful. It can also be used for editing large tables. This is described\n"+ "in more detail throughout this reference manual.\n"+ "\n"+ "Additional command subsets were developed for specialized conversions\n"+ "(JTVconvert, GenBatchScripts, and TestsIntersections) and may be ignored for\n"+ "routine Web page generation in other domains where they don't apply.\n"+ "\n"+ "The JTVconvert commands can re-map data array names in Java TreeView mAdb\n"+ "data set files to more user friendly experiment names as well as generat\n"+ "HTML Web pages to launch these converted JTV files for each JTV data set.\n"+ "\n"+ "The GenBatchScripts commands may be used to generate CvtTabDelim2HTML batch\n"+ "scripts for subsequent processing given a list of data test-results files to\n"+ "convert and a tab-delimited tests descriptions file. It is able to use a table\n"+ "(prepared with Excel or some other source) that describes this data and can\n"+ "then use that for extracting and inserting information from various mapping\n"+ "tables into the generated Web pages.\n"+ "\n"+ "The TestsIntersections commands will synthesize a tests intersection summary\n"+ "table and Web page as well as generating some summary statistics. It uses the\n"+ "same data used in the GenBatchScripts commands.\n"+ "\n"+ "The FlipTable commands will create a flipped table and HTML web page with filtered\n"+ "rows and columns flipped. It uses an edited data table (.txt) file that has been\n"+ "further processed to create an associated Index Map (.idx) and Statistics Index"+ "Map (.sidx) tables. It can be invoked from a graphical user interface using the"+ "SearchGui option.\n"+ "\n"; /* [1] ---------------- Class instances ------------------- */ /** Instance of the main module */ public static HTMLtools cvt= null; /** Global Convert instance */ public Convert convert; /** Global FileTable instance */ public FileTable fio; /** Global Switches instance */ public Switches sw; /** Global utilities UtilCM instance */ public UtilCM util; /** Total command list arg list originally set from main(args) */ public String argsV[]= null; /** Parameter command list file is used. */ public String paramMapFile= null; /** Directory with the Parameter command list file. Used as * a base directory for other .map files. */ public String paramMapDir= null; /** Parameter command list string if parameter file is used. */ public String sParamsStr= null; /* [2] ---------------- Static constants ------------------- */ /** flag: for debugging - always TRUE*/ public static boolean ALWAYS= true; /** flag: for debugging - always FALSE */ public static boolean NEVER= false; /** flag: set if want logging file */ final public static boolean MAKE_LOGGING_FILE= true; /** flag: primary debug flag - only while debugging */ public static boolean DBUG_FLAG= true; /* [2.1] --- Preset sizes of data structures --- */ /** Maximum number of input files */ final public int MAX_INPUT_FILES= 1000; /** Size beyond which an -exportBig cell is considered * to be BIG */ final public int EXPORT_BIG_CELL_SIZE= 200; /** Size beyond which a -shrinkBig cell is considered * to be BIG */ final public int SHRINK_BIG_CELL_SIZE= 100; /** Decrease font size by this amount if a cell is considered * to be BIG */ final public int SHRINK_CELL_SIZE= -5; /** max # of tokens/row of an input file */ public final int MAX_IN_TOKENS_PER_ROW= 512; /** The max # of Columns to URL maps * from "-hrefData:{colHdrName,UrlBaseLink,mapToken}" switches */ final public int MAX_COL2URL_MAPS= 100; /** The max mapDollarsigns instances using -mapDollarsigns switchs. */ final public int MAX_MAP_DOLLARSIGNS= 100; /** The max mapQuestionmarks instances using -mapQuestionark switchs. */ final public int MAX_MAP_QUESTIONMARKS= 100; /** The max sort columns instances using -sortRowsByColumn switch.*/ final public int MAX_SORT_COLUMNS= 100; /** The max number of columns instances that be be specified using * -dropColumn and -keepColumn switches. * */ final public int MAX_COL_EDITS= 200; /** The maximum number of param .map specifications in the * '-batchProcess:{file of param specifications}' switch. */ final public int MAX_BATCH_SPECS= 500; /** The maximum number of Summary Template specifications in the * '-genSummaryTemplate:{orderNbr,templateFileName}' switch. */ final public int MAX_TEMPLATES= 30; /** The maximum number of directory tree and file specifications to * copy switch. */ final public int MAX_COPY_FILES_AND_TREES= 75; /* [3] ---------------- OS related variables ------------------- */ /** top level GUI title */ public String title; /** JVM ("os.name") that we are running in */ public static String osName; /** JVM ("file.separator") */ public static String fileSep; /** user directory - JVM ("user.dir")+fileSep */ public static String userDir; /** date captured when this program is run */ public String date; /** flag: true if Windows PC */ public static boolean isWinPCflag; /** flag: true if SUNOS */ public static boolean isSunFlag; /** flag: use Max list of required fields */ public static boolean isMacFlag; /** Log file that is written out at the end before exiting. * The default is programName+".log" which is overridden by * the 'logName:{new log file name ending in ".log"}' switch. * It is overwritten using the '-logging:{newLogFileName}'. * */ public String logFileName; /** New line separator will be CRLF or LF etc. */ public String newline; /* [4] ------------- Simple switch flags ------------------- */ /** Add row numbers to the preface of each row with the * "-addRowNumbers" switch. */ public boolean addRowNumbersFlag= false; /** Add a postfix name to the output file before the .html. E.g., * for an output file 'abc.html', with a postfix name of '-xyz', * the new name is 'abc'xyz.html'. It is set with * '-addOutfilePostfix:{postfix name}' switch. */ public String addOutfilePostfixName= ""; /** Use an HTML font size!= null, i.e. +1, +2, -1, -2, etc. * with "-fontSizeHtml:{font Size modifier}" command line switch. * Default is to decrease the size by -1. */ public String useHTMLfontSize= "-1"; /** Flag set if the TABLE does not have a border. The default is to * use a 'BORDER=1'. Cleared with the "-noBorder" switch. */ public boolean noBorderFlag= false; /** Flag cleared if the input table does NOT have a header, * default is that it has a header. Cleared with the "-noHeader" switch. */ public boolean hasTableHeaderRowFlag= true; /** Set to true to look for empty line(s) BEFORE the table data. * Set with the "-hasEmptyLineBeforeTable" * */ public boolean hasEmptyLineBeforeTableFlag= false; /** Flag set if the input table MAY have duplicate fields in the header, * default is no duplicates in the header. Set with the "-allowHdrDups" * switch. */ public boolean ignoreDuplicateFieldsFlag= false; /** Flag set if remove trailing blank lines and trailing empty columns * at the end of the table, default is to allow blank lines. Set with the * "-rmvTrailingBlankRowsAndColumns" switch. */ public boolean rmvTrailingBlankRowsAndColumnsFlag= false; /** Flag to map a ;; delimited cell string to an