cox.jmatt.java.MathTools.markup.html
Class MathGenHTML

java.lang.Object
  extended by cox.jmatt.java.MathTools.markup.html.MathGenHTML

public class MathGenHTML
extends java.lang.Object

This class is to the HTML package what MathDrawSVG is to the SVG package. It serves to generate instances of the various tag classes and to set default values. Critical Note: Setting the default value for a multi-purpose tag (eg ListTag) affects all instances of that class, regardless of the type of tag generated. Use with caution!

Concerning default values, they are set differently here than in the SVG classes. By the nature of HTML it might be desirable to set default values for a range of tags, or even all tags. This is made easy via the TagKeys.GLOBAL constant. If passed into a setDefault__() method it sets the default for all tags. To exclude one or two tag types re-set individuals manually.


Constructor Summary
MathGenHTML()
          Scripting constructor; used to supply markup.html.* classes to scripts.
 
Method Summary
 ListTag createList(boolean bIsOrdered, java.lang.Object[] itemList, java.lang.String pItemIDPrefix)
          Create a list (ordered or unordered) from an Object[] array.
 TableTag createTable(java.lang.Object[][] pTable, java.lang.String rowID, java.lang.String cellID, boolean bUseRowID, boolean bFirstRowTH)
          Create a complete <table> around a two-dimensional Object[][] array.
 TRTag createTHRow(java.lang.Object[] pRow)
          Create a table heading row with no cell ID prefix.
 TRTag createTRTag(java.lang.Object[] pRow)
          Create a standard table row with no cell ID prefix.
 TRTag createTRTag(java.lang.Object[] pRow, java.lang.String pCellID, boolean bIsTH)
          Create a table row (tag) around an Object[] array.
 AnchorTag getAnchorTag(java.lang.String pHREF, java.lang.String pText)
          Create and return an <a> tag.
 BQTag getBQTag()
          Create an empty BQTag for a <blockquote> tag.
 BQTag getBQTag(java.lang.String pContent)
          Create a BQTag with content.
 BTag getBTag()
          Create an empty BTag.
 BTag getBTag(java.lang.String pContent)
          Create a BTag with content.
 DDTag getDDTag()
          Create an empty DDTag.
 DDTag getDDTag(java.lang.String pContent)
          Create a DDTag with content.
 DivTag getDivTag()
          Create a basic <div> tag.
 DLTag getDLTag()
          Create a fresh <dl> tag.
 DTTag getDTTag()
          Create an empty DTTag.
 DTTag getDTTag(java.lang.String pContent)
          Create a DTTag with content.
 EMTag getEMTag()
          Create an empty EMTag.
 EMTag getEMTag(java.lang.String pContent)
          Create a EMTag with content.
 HnTag getHeadingTag()
          Create an empty <h1> tag.
 HnTag getHeadingTag(byte pLevel, java.lang.String pContent)
          Create a heading tag with content.
 HRTag getHRTag()
          Create a standard <hr> tag, no width specified.
 HRTag getHRTag(double pWidth)
          Create a standard <hr> tag with the width specified.
 HTMLTag getHTML()
          Create an <html> document tag.
 IMGTag getImageTag(java.lang.String pSrc)
          Create an image tag.
 IMGTag getImageTag(java.lang.String pSrc, double pWidth, double pHeight)
          Create an image tag with source and size specified.
 ITag getITag()
          Create an empty ITag.
 ITag getITag(java.lang.String pContent)
          Create a ITag with content.
 LITag getLITag()
          Create an empty LITag.
 LITag getLITag(java.lang.String pContent)
          Create a LITag with content.
 NoteworthyParser getNoteParser()
          Create a NoteworthyParser.
 ListTag getOLTag()
          Create a new ordered list.
 PTag getPTag()
          Create a basic <p> tag.
 SpanTag getSpanTag()
          Create an empty SpanTag.
 SpanTag getSpanTag(java.lang.String pContent)
          Create a SpanTag with content.
 TableTag getTableTag()
          Create an empty TableTag instance.
 TDTag getTDTag()
          Create an empty TDTag.
 TDTag getTDTag(java.lang.String pContent)
          Create a TDTag with content.
 TRTag getTRTag()
          Create an empty <tr> tag.
 ListTag getULTag()
          Create a new unordered list.
 UTag getUTag()
          Create an empty UTag.
 UTag getUTag(java.lang.String pContent)
          Create a UTag with content.
 void setDefaultClicked(java.lang.String pTag, java.lang.String pValue)
          Set or clear the default 'onclick=' for a certain tag.
 void setDefaultCSS(java.lang.String pTag, java.lang.String pValue)
          Set or clear the default CSS class name for a certain tag.
 void setDefaultName(java.lang.String pTag, java.lang.String pValue)
          Set or clear the default value of a certain tag's 'name=' attribute.
 void setDefaultStyle(java.lang.String pTag, java.lang.String pValue)
          Set or clear the default inline CSS style for a certain tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MathGenHTML

public MathGenHTML()
Scripting constructor; used to supply markup.html.* classes to scripts.

Method Detail

setDefaultName

public void setDefaultName(java.lang.String pTag,
                           java.lang.String pValue)
Set or clear the default value of a certain tag's 'name=' attribute. The pTag parameter must be one of the TagKeys enum constants. If the tag key sent in is lower case it is converted but if null or blank it is ignored. If the constant sent in doesn't match one of the constants it is ignored.

Parameters:
pTag - The name of one of the TagKeyss constants.
pValue - The default 'name=' attribute value to be assigned.

setDefaultCSS

public void setDefaultCSS(java.lang.String pTag,
                          java.lang.String pValue)
Set or clear the default CSS class name for a certain tag. All parameters and concerns are per setDefaultName().


setDefaultStyle

public void setDefaultStyle(java.lang.String pTag,
                            java.lang.String pValue)
Set or clear the default inline CSS style for a certain tag. All parameters and concerns are per setDefaultName().


setDefaultClicked

public void setDefaultClicked(java.lang.String pTag,
                              java.lang.String pValue)
Set or clear the default 'onclick=' for a certain tag. All parameters and concerns are per setDefaultName().


getNoteParser

public NoteworthyParser getNoteParser()
Create a NoteworthyParser.


getBTag

public BTag getBTag()
Create an empty BTag.


getBTag

public BTag getBTag(java.lang.String pContent)
Create a BTag with content.


getITag

public ITag getITag()
Create an empty ITag.


getITag

public ITag getITag(java.lang.String pContent)
Create a ITag with content.


getUTag

public UTag getUTag()
Create an empty UTag.


getUTag

public UTag getUTag(java.lang.String pContent)
Create a UTag with content.


getEMTag

public EMTag getEMTag()
Create an empty EMTag.


getEMTag

public EMTag getEMTag(java.lang.String pContent)
Create a EMTag with content.


getHeadingTag

public HnTag getHeadingTag()
Create an empty <h1> tag.


getHeadingTag

public HnTag getHeadingTag(byte pLevel,
                           java.lang.String pContent)
Create a heading tag with content. If the level is not between 1 and 6 a <h1> tag is created.


getHRTag

public HRTag getHRTag()
Create a standard <hr> tag, no width specified.


getHRTag

public HRTag getHRTag(double pWidth)
Create a standard <hr> tag with the width specified.


getBQTag

public BQTag getBQTag()
Create an empty BQTag for a <blockquote> tag.


getBQTag

public BQTag getBQTag(java.lang.String pContent)
Create a BQTag with content.


getSpanTag

public SpanTag getSpanTag()
Create an empty SpanTag.


getSpanTag

public SpanTag getSpanTag(java.lang.String pContent)
Create a SpanTag with content.


getImageTag

public IMGTag getImageTag(java.lang.String pSrc)
Create an image tag. If the source is null or blank the return value is null.


getImageTag

public IMGTag getImageTag(java.lang.String pSrc,
                          double pWidth,
                          double pHeight)
Create an image tag with source and size specified. If the source is null or blank the return value is null.


getOLTag

public ListTag getOLTag()
Create a new ordered list.


getULTag

public ListTag getULTag()
Create a new unordered list.


createList

public ListTag createList(boolean bIsOrdered,
                          java.lang.Object[] itemList,
                          java.lang.String pItemIDPrefix)
Create a list (ordered or unordered) from an Object[] array. See here for details and parameter info.


getLITag

public LITag getLITag()
Create an empty LITag.


getLITag

public LITag getLITag(java.lang.String pContent)
Create a LITag with content.


getDLTag

public DLTag getDLTag()
Create a fresh <dl> tag.


getDTTag

public DTTag getDTTag()
Create an empty DTTag.


getDTTag

public DTTag getDTTag(java.lang.String pContent)
Create a DTTag with content.


getDDTag

public DDTag getDDTag()
Create an empty DDTag.


getDDTag

public DDTag getDDTag(java.lang.String pContent)
Create a DDTag with content.


getTDTag

public TDTag getTDTag()
Create an empty TDTag.


getTDTag

public TDTag getTDTag(java.lang.String pContent)
Create a TDTag with content.


getTRTag

public TRTag getTRTag()
Create an empty <tr> tag.


createTRTag

public TRTag createTRTag(java.lang.Object[] pRow,
                         java.lang.String pCellID,
                         boolean bIsTH)
Create a table row (tag) around an Object[] array. Details are here.

Parameters:
pRow - The Object[] array to turn into a row.
pCellID - The cell ID prefix. May be null.
bIsTH - 'true' for a heading row, false for a standard row.

createTRTag

public TRTag createTRTag(java.lang.Object[] pRow)
Create a standard table row with no cell ID prefix.


createTHRow

public TRTag createTHRow(java.lang.Object[] pRow)
Create a table heading row with no cell ID prefix.


getTableTag

public TableTag getTableTag()
Create an empty TableTag instance.


createTable

public TableTag createTable(java.lang.Object[][] pTable,
                            java.lang.String rowID,
                            java.lang.String cellID,
                            boolean bUseRowID,
                            boolean bFirstRowTH)
Create a complete <table> around a two-dimensional Object[][] array. Parameters are here.


getPTag

public PTag getPTag()
Create a basic <p> tag.


getDivTag

public DivTag getDivTag()
Create a basic <div> tag.


getHTML

public HTMLTag getHTML()
Create an <html> document tag.


getAnchorTag

public AnchorTag getAnchorTag(java.lang.String pHREF,
                              java.lang.String pText)
Create and return an <a> tag. Both arguments are mandatory.

Parameters:
pHREF - The 'href=' attribute value for the anchor.
pText - The text to appear within the tags.