org.pz.platypus.plugin.html
Class HtmlOutfile

java.lang.Object
  extended by org.pz.platypus.plugin.html.HtmlOutfile

public class HtmlOutfile
extends java.lang.Object

Manage output to the HTML file

Author:
ask

Field Summary
(package private)  org.apache.ecs.xhtml.body htmlBody
           
(package private)  HtmlData htmlData
          the HTML data structure
(package private)  org.apache.ecs.XhtmlDocument htmlDoc
           
private  java.io.PrintStream htmlFile
           
private  java.lang.String htmlFileName
           
private  boolean inFont
           
private  boolean inParagraph
           
private  boolean openStatus
           
private  int tab
           
 
Constructor Summary
HtmlOutfile()
           
 
Method Summary
private  boolean alreadyProcessingFont()
           
 void close()
          Outputs any material that has not yet been output.
private  void configureHead()
          The "once only" settings - We set
1.
private  void configureHtmlPrettyPrint()
          A hack to pretty-print the generated XHTML.
 void emitFontSizeTag()
           
 void emitText(java.lang.String s)
          Writes text to the HTML file.
 void endCurrentParagraphIfAny()
           
private  void endFontTagIfAny()
           
 boolean getInParagraph()
           
 void handleEof()
          If we have started a paragraph, or a font or any other tag - we need to close it.
 void handleNewFontFace()
          When we get a command to start off a new font tag, we need to close the previous font tag, ***if any***.
 boolean isOpen()
           
 void open(GDD gdd, java.lang.String filename, HtmlData htmlData)
          Open the output file.
private  void openHtmlFile(java.lang.String filename)
           
private  void restartFontTagIfAny()
           
 void setHtmlData(HtmlData htmlData)
           
private  void setInParagraph(boolean b)
           
 void setMarginTop()
           
private  void startNewFontFace()
          We need to close previous font (if any) - and output a new font tag
private  void startNewFontSize()
           
 void startNewParagraph()
          Starts a new html Paragraph.
private  java.lang.String wrapInQuotes(java.lang.String s)
          Useful when we wish to output a double quoted string Eases out the all the "escape a double quote" business.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

openStatus

private boolean openStatus

htmlData

HtmlData htmlData
the HTML data structure


htmlFileName

private java.lang.String htmlFileName

htmlFile

private java.io.PrintStream htmlFile

htmlDoc

org.apache.ecs.XhtmlDocument htmlDoc

htmlBody

org.apache.ecs.xhtml.body htmlBody

inParagraph

private boolean inParagraph

tab

private int tab

inFont

private boolean inFont
Constructor Detail

HtmlOutfile

public HtmlOutfile()
Method Detail

configureHead

private void configureHead()
The "once only" settings - We set
1. The title
2. The content-type
3. A comment to note that this doc was generated with platypus


configureHtmlPrettyPrint

private void configureHtmlPrettyPrint()
A hack to pretty-print the generated XHTML.


open

public void open(GDD gdd,
                 java.lang.String filename,
                 HtmlData htmlData)
          throws java.io.IOException
Open the output file. Does basic checks, calls openPdfFile(), and handles any exceptions

Parameters:
gdd - Global document data
filename - name of file to open
htmlData -
Throws:
java.io.IOException - in event of a problem opening the file

openHtmlFile

private void openHtmlFile(java.lang.String filename)
                   throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

close

public void close()
           throws FileCloseException
Outputs any material that has not yet been output. Then closes the xhtml Document.

Throws:
FileCloseException - if an error occurs closing the file

startNewParagraph

public void startNewParagraph()
Starts a new html Paragraph. This does two things... Outputs the paragraph tag

. Records the fact that we have started a paragraph.


endCurrentParagraphIfAny

public void endCurrentParagraphIfAny()

getInParagraph

public boolean getInParagraph()

setInParagraph

private void setInParagraph(boolean b)

emitText

public void emitText(java.lang.String s)
Writes text to the HTML file. \ TODO: handle quoting of special characters here... TODO: maybe extract this out in a special class of its own?

Parameters:
s - the text to be written

isOpen

public boolean isOpen()

setHtmlData

public void setHtmlData(HtmlData htmlData)

wrapInQuotes

private java.lang.String wrapInQuotes(java.lang.String s)
Useful when we wish to output a double quoted string Eases out the all the "escape a double quote" business.

Parameters:
s -
Returns:

emitFontSizeTag

public void emitFontSizeTag()

startNewFontSize

private void startNewFontSize()

handleEof

public void handleEof()
If we have started a paragraph, or a font or any other tag - we need to close it. This handles the closing up of any open tags...


alreadyProcessingFont

private boolean alreadyProcessingFont()

setMarginTop

public void setMarginTop()

handleNewFontFace

public void handleNewFontFace()
When we get a command to start off a new font tag, we need to close the previous font tag, ***if any***. The inFont variable tells it.


restartFontTagIfAny

private void restartFontTagIfAny()

endFontTagIfAny

private void endFontTagIfAny()

startNewFontFace

private void startNewFontFace()
We need to close previous font (if any) - and output a new font tag



Copyright © 2008-10 Pacific Data Works LLC