es.unex.sextante.docEngines.html
Class HTMLDoc

java.lang.Object
  extended by es.unex.sextante.docEngines.html.HTMLDoc

public class HTMLDoc
extends java.lang.Object

A class to create simple HTML-formatted texts. Use this to create HTML results from SEXTANTE algorithms

Author:
volaya

Constructor Summary
HTMLDoc()
           
 
Method Summary
 void addBoldText(java.lang.String sText)
          Adds the given text in bold font
 void addCourierText(java.lang.String sText)
          Adds text in courier font
 void addHeader(java.lang.String sText, int iOrder)
          Adds a header
 void addHorizontalSeparator()
          Adds a horizontal separator
 void addHyperlink(java.lang.String sText, java.lang.String sURL)
          Adds a hyperlink
 void addImage(java.lang.String sFilename)
          Adds an image
 void addImageAndDescription(java.lang.String sImageFile, java.lang.String sDescription)
          Adds an image an a caption describing it
 void addLineBreak()
          Adds a line break
 void addListElement(java.lang.String sText)
          Adds an element to the last opened list (ordered or unordered)
 void addOrderedList(java.lang.String[] sText)
          Creates an ordered list from a set of elements
 void addParagraph(java.lang.String sText)
          Adds a new paragraph
 void addTable(java.lang.String[][] Table, java.lang.String sDescription, boolean bColorFirstRow, boolean bColorFirstCol)
          Adds a table
 void addText(java.lang.String sText)
          adds the given text.
 void addThumbnail(java.lang.String sFilename, int iWidth, boolean bIsPercent)
           
 void addUnorderedList(java.lang.String[] sText)
          Creates an unordered list from a set of elements
 void close()
          Closes the HTML page
 void closeOrderedList()
          Closes an ordered list
 void closeUnorderedList()
          Closes an unordered list
 java.lang.String getHTMLCode()
          Returns the page as a HTML-formatted string
 void open(java.lang.String sTitle)
          Opens the HTML page with the given title
 void startOrderedList()
          Starts an ordered list
 void startUnorderedList()
          Starts an unordered list
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLDoc

public HTMLDoc()
Method Detail

open

public void open(java.lang.String sTitle)
Opens the HTML page with the given title

Parameters:
sTitle - the title of the page

close

public void close()
Closes the HTML page


getHTMLCode

public java.lang.String getHTMLCode()
Returns the page as a HTML-formatted string

Returns:
the page as a HTML-formatted string

addText

public void addText(java.lang.String sText)
adds the given text. HTML tags can be included

Parameters:
sText - the text to add

addBoldText

public void addBoldText(java.lang.String sText)
Adds the given text in bold font

Parameters:
sText - the text to add

addParagraph

public void addParagraph(java.lang.String sText)
Adds a new paragraph

Parameters:
sText - the text of the paragraph

addLineBreak

public void addLineBreak()
Adds a line break


addHeader

public void addHeader(java.lang.String sText,
                      int iOrder)
Adds a header

Parameters:
sText - the text of the header
iOrder - the order (importance) of the header (1,2,3...)

addHyperlink

public void addHyperlink(java.lang.String sText,
                         java.lang.String sURL)
Adds a hyperlink

Parameters:
sText - the text of the link
sURL - the URL to link to

addHorizontalSeparator

public void addHorizontalSeparator()
Adds a horizontal separator


addImage

public void addImage(java.lang.String sFilename)
Adds an image

Parameters:
sFilename - the filename of the image

addThumbnail

public void addThumbnail(java.lang.String sFilename,
                         int iWidth,
                         boolean bIsPercent)

startUnorderedList

public void startUnorderedList()
Starts an unordered list


startOrderedList

public void startOrderedList()
Starts an ordered list


closeUnorderedList

public void closeUnorderedList()
Closes an unordered list


closeOrderedList

public void closeOrderedList()
Closes an ordered list


addListElement

public void addListElement(java.lang.String sText)
Adds an element to the last opened list (ordered or unordered)

Parameters:
sText - the text of the element

addOrderedList

public void addOrderedList(java.lang.String[] sText)
Creates an ordered list from a set of elements

Parameters:
sText - an array of string, each of them representing one element of the list

addUnorderedList

public void addUnorderedList(java.lang.String[] sText)
Creates an unordered list from a set of elements

Parameters:
sText - an array of string, each of them representing one element of the list

addTable

public void addTable(java.lang.String[][] Table,
                     java.lang.String sDescription,
                     boolean bColorFirstRow,
                     boolean bColorFirstCol)
Adds a table

Parameters:
Table - The table as a 2D array of strings
sDescription - The description of the table
bColorFirstRow - true if should give a different color to the first row
bColorFirstCol - true if should give a different color to the first columns

addImageAndDescription

public void addImageAndDescription(java.lang.String sImageFile,
                                   java.lang.String sDescription)
Adds an image an a caption describing it

Parameters:
sImageFile - the image file
sDescription - the caption

addCourierText

public void addCourierText(java.lang.String sText)
Adds text in courier font

Parameters:
sText - the text to add