|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectConvert
public class Convert
Class Convert to convert one Table to HTML. This class also contains various mapping functions used in the conversion as well as extracting a subtable for inclusion.
List of Methods Convert() - Constructor cvtTable2HTML() - Process a FileTable into an output HTML file. cvtPrefaceTable2HTML() - Process a preface FileTable to HTML file. cvtText2HTML() - convert text to an output HTML file. mapCellToStr() - map a cell string at [r, c] to an HTML string buildMapUrl() - map a cell string at [r, c] to an HTML link string makeOptionsListFromSemicolonList() - map ";;" delim. str to OPTION list testIfRowIsBlank() - test if remove trailing blank lines after first line concatInputFilesWithSameFields() - create concat. tab-delim. .txt file shrinkStrToSmallerFont() - shrink string if text is > threshold size. exportBigStrToHTMLfile() - if the |str| > bigExportCellThr. mapHeaderNames() - try to map header names within the header table mapQuestionmarks() - Map cell data of the form '??{cell text}'??' mapDollarsigns() - map data form '$$keyword$$' to '{toString}. extractRowFromResourceTableAsHTML() - extract row data from resource file checkAndMakeIndexHtmlDirList() - make index.html files in list of dirs checkAndMakeIndexHtmlDir() - make index.html files in a directory. makeIndexHtml() - make "index.html" file in the directory. checkIfDir() - test if fileName is a directory
This code is available at the HTMLtools project on SourceForge at http://htmltools.sourceforge.org/ 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.org/), and Open2Dprot (http://Open2Dprot.sourceforge.net/) Table modules.
$Date: 2009/11/21 11:45:56 $ $Revision: 1.37 $
Copyright 2008, 2009 by Peter Lemkin
E-Mail: lemkin@users.sourceforge.net
http://lemkingroup.com/
Field Summary | |
---|---|
HTMLtools |
cvt
|
FileTable |
fio
Global fileTable instance |
private static int |
STYLE_DL
|
private static int |
STYLE_OL
|
private static int |
STYLE_TABLE
|
private static int |
STYLE_UL
|
Constructor Summary | |
---|---|
Convert(HTMLtools cvt)
Convert() - Constructor |
Method Summary | |
---|---|
java.lang.String |
buildMapUrl(java.lang.String cell,
int c,
int hrefIdx)
buildMapUrl() - map a cell string at [r, c] to an HTML link string by adding the HREF if hrefIdx==c using the cvt.urlBaseLink For the 1:1 mapping, it adds the cell value {} to the base urlBaseLink value {}. |
boolean |
checkAndMakeIndexHtml(int nLevel,
int subLevelNbr,
java.lang.String parentDir,
java.lang.String dirToCheck,
boolean overrideFlag)
checkAndMakeIndexHtmlDir() - make index.html files in a directory. |
boolean |
checkAndMakeIndexHtmlDirList(int nDirIndexHtml,
java.lang.String parentDir,
java.lang.String[] dirIndexHtml,
boolean[] dirIndexHtmlOverrideFlag)
checkAndMakeIndexHtmlDirList() - make index.html files in list of dirs. |
boolean |
checkIfDir(java.lang.String dirName,
java.lang.String fileName)
checkIfDir() - test if fileName is a directory |
boolean |
concatInputFilesWithSameFields(int fileNbr,
FileTable ft)
concatInputFilesWithSameFields() - to create a new concatenated tab-delimited .txt output file from the set of input text files IFF they have exactly the same column header names. |
java.lang.String |
cvtPrefaceTable2HTML(FileTable ft,
java.lang.String fileName,
java.lang.String sName,
java.lang.String sProlog,
java.lang.String sEpilogue)
cvtPrefaceTable2HTML() - Process a preface FileTable into an output HTML file. |
java.lang.String |
cvtTable2HTML(FileTable ft,
java.lang.String iFileName,
int fileNbr,
java.lang.String sName,
java.lang.String sProlog,
java.lang.String sEpilogue,
java.lang.String oPrefaceFile,
java.lang.String limitedRows)
cvtTable2HTML() - Process a FileTable into an output HTML file. |
java.lang.String |
cvtText2HTML(java.lang.String sText,
java.lang.String sName,
java.lang.String sProlog,
java.lang.String sEpilogue)
cvtText2HTML() - convert text to an output HTML file. |
java.lang.String |
exportBigStrToHTMLfile(java.lang.String str,
java.lang.String oDir,
java.lang.String oFileName,
int r,
int c,
int maxChars)
exportBigStrToHTMLfile() - if the |str| > bigExportCellThr. |
java.lang.String |
extractRowFromResourceTableAsHTML(FileTable ft,
java.lang.String extractColName,
int extractRowNbr,
java.lang.String extractResTblFile,
java.lang.String extractHtmlStyle)
extractRowFromResourceTableAsHTML() - to get and lookup a keyword in the table being processed at (colName,rowNbr) and then to search a resourceTblFile for that keyword. |
java.lang.String |
makeColorMapScaleHTML()
makeColorMapScaleHTML() - make colormap data scale TABLE HTML mapping the cvt.heatMapColors[] to positive numeric value in range of [cvt.glbMinRowVal, cvt.glbMaxRowVal] |
boolean |
makeIndexHtml(java.io.File fd,
java.lang.String dirName,
java.lang.String[] dirList)
makeIndexHtml() - make "index.html" file in the directory. |
java.lang.String |
makeOptionsListFromSemicolonList(java.lang.String cell)
makeOptionsListFromSemicolonList() - map a ";;" delimited cell string to an < OPTION > list. |
java.lang.String |
mapCellToStr(java.lang.String cell,
int r,
int c,
java.lang.String tHD,
int hrefIdx,
java.lang.String oFileBaseName)
mapCellToStr() - map a cell string at [r, c] to an HTML string adding the HREF if hrefIdx==c using the cvt.urlBaseLink. |
java.lang.String |
mapDataToCellBGcolor(java.lang.String sVal,
java.lang.String defaultBGcolor)
mapDataToCellBGcolor() - map data cell number to cell background color the colors are in cvt.heatMapColors[]. |
java.lang.String |
mapDollarsigns(java.lang.String str)
mapDollarsigns() - map data form '$$keyword$$' to '{toString}. |
int |
mapHeaderNames(FileTable ft)
mapHeaderNames() - try to map header names within the header table in the tFields[] and tHeader[last][] arrays. |
java.lang.String |
mapQuestionmarks(java.lang.String str)
mapQuestionmarks() - map cell data of the form '??{cell text}'??' to bold and red, keeping 1 questionmark so can process the string recursively. |
java.lang.String |
shrinkStrToSmallerFont(java.lang.String str)
shrinkStrToSmallerFont() - if the useHTMLfontSize or the |str| > bigShrinkCellThr. |
boolean |
testIfRowIsBlank(java.lang.String[] tRowData,
int tCols)
testIfRowIsBlank() - test if remove trailing blank lines after first line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public HTMLtools cvt
public FileTable fio
private static final int STYLE_DL
private static final int STYLE_OL
private static final int STYLE_UL
private static final int STYLE_TABLE
Constructor Detail |
---|
public Convert(HTMLtools cvt)
cvt
- is instance of HTMLtoolsMethod Detail |
---|
public java.lang.String cvtTable2HTML(FileTable ft, java.lang.String iFileName, int fileNbr, java.lang.String sName, java.lang.String sProlog, java.lang.String sEpilogue, java.lang.String oPrefaceFile, java.lang.String limitedRows)
ft
- is FileTable containing the data to convertiFileName
- full path of input file namefileNbr
- number of the input file (special processing for 1st)sName
- name for the prolog HTML header if not nullsProlog
- prolog string if not nullsEpilogue
- epilogue string it not nulloPrefaceFile
- name of preface file to generate if not null.limitedRows
- if limited length of rows in table.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |