ibm.techexplorer.dom
Class TEDocument

java.lang.Object
  |
  +--ibm.techexplorer.dom.TENode
        |
        +--ibm.techexplorer.dom.TEDocument
All Implemented Interfaces:
Document, Node, techexplorerDocument

public class TEDocument
extends TENode
implements techexplorerDocument

Description

See Also:
techexplorer, org.w3c.dom

Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
TEDocument(techexplorer teobject, int node)
           
 
Method Summary
 java.lang.String convertMMLtoTeX(Node targetNode)
           
 java.lang.String convertTeXtoMML(Node targetNode)
           
 Attr createAttribute(java.lang.String name)
          Creates an Attr of the given name.
 CDATASection createCDATASection(java.lang.String data)
          Creates a CDATASection node whose value is the specified string.
 Comment createComment(java.lang.String data)
          Creates a Comment node given the specified string.
 DocumentFragment createDocumentFragment()
          Creates an empty DocumentFragment object.
 Element createElement(java.lang.String tagName)
          Creates an element of the type specified.
 EntityReference createEntityReference(java.lang.String name)
          Creates an EntityReference object.
 Node createFromMmlString(java.lang.String data)
          Creates a techexplorer Node from a MathML input String.
 Node createFromTexString(java.lang.String data)
          Creates a techexplorer Node from a TeX input String.
 Node createFromXmlString(java.lang.String data)
          Creates a techexplorer Node from an XML input String.
 ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)
          Creates a ProcessingInstruction node given the specified name and data strings.
 Text createTextNode(java.lang.String data)
          Creates a Text node given the specified string.
 DocumentType getDoctype()
          The Document Type Declaration (see DocumentType) associated with this document.
 Element getDocumentElement()
          This is a convenience attribute that allows direct access to the child node that is the root element of the document.
 NodeList getElementsByTagName(java.lang.String tagname)
          Returns a NodeList of all the Elements with a given tag name in the order in which they would be encountered in a preorder traversal of the Document tree.
 DOMImplementation getImplementation()
          The DOMImplementation object that handles this document.
 java.lang.String getMmlString(Node targetNode)
          Converts a Node in a techexplorer Document to a MathML String.
 java.lang.String getTexString(Node targetNode)
          Converts a Node in a techexplorer Document to a TeX String.
 java.lang.String getXmlString(Node targetNode)
          Converts a Node in a techexplorer Document to an XML String.
 void invalidate()
          Invalidates the techexplorer view so the current contents will be redrawn.
 java.lang.String printMMLInput(Node targetNode)
           
 java.lang.String printTeXInput(Node targetNode)
           
 void recomposeAndRedraw()
          Recalculates the layout of the techexplorer document and redraws the contents of the current view.
 void recomposeAndRedrawNode(Node targetNode)
          Recalculates the layout of the techexplorer document and redraws the contents of the current view.
 void scrollToNode(Node targetNode)
          Scrolls the techexplorer view so that the given Node is visible.
 void setMMLVersion(java.lang.String version, boolean bDeprecated)
          Sets the version of MathML being used, and whether or not to allow deprecated features.
 
Methods inherited from class ibm.techexplorer.dom.TENode
appendChild, cloneNode, convertFrBool, convertFrNode, convertToAttribute, convertToBool, convertToCDATASection, convertToComment, convertToDocument, convertToDocumentFragment, convertToDocumentType, convertToDOMImplementation, convertToElement, convertToEntity, convertToEntityReference, convertToNamedNodeMap, convertToNode, convertToNodeList, convertToNotation, convertToProcessingInstruction, convertToText, createNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, removeChild, replaceChild, setNodeValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, removeChild, replaceChild, setNodeValue
 

Constructor Detail

TEDocument

public TEDocument(techexplorer teobject,
                  int node)
Method Detail

getDoctype

public DocumentType getDoctype()
Description copied from interface: Document
The Document Type Declaration (see DocumentType) associated with this document. For HTML documents as well as XML documents without a document type declaration this returns null. The DOM Level 1 does not support editing the Document Type Declaration, therefore docType cannot be altered in any way.
Specified by:
getDoctype in interface Document

getImplementation

public DOMImplementation getImplementation()
Description copied from interface: Document
The DOMImplementation object that handles this document. A DOM application may use objects from multiple implementations.
Specified by:
getImplementation in interface Document

getDocumentElement

public Element getDocumentElement()
Description copied from interface: Document
This is a convenience attribute that allows direct access to the child node that is the root element of the document. For HTML documents, this is the element with the tagName "HTML".
Specified by:
getDocumentElement in interface Document

createElement

public Element createElement(java.lang.String tagName)
                      throws DOMException
Description copied from interface: Document
Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object.
Specified by:
createElement in interface Document
Following copied from interface: org.w3c.dom.Document
Parameters:
tagName - The name of the element type to instantiate. For XML, this is case-sensitive. For HTML, the tagName parameter may be provided in any case, but it must be mapped to the canonical uppercase form by the DOM implementation.
Returns:
A new Element object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

createDocumentFragment

public DocumentFragment createDocumentFragment()
Description copied from interface: Document
Creates an empty DocumentFragment object.
Specified by:
createDocumentFragment in interface Document
Following copied from interface: org.w3c.dom.Document
Returns:
A new DocumentFragment.

createTextNode

public Text createTextNode(java.lang.String data)
Description copied from interface: Document
Creates a Text node given the specified string.
Specified by:
createTextNode in interface Document
Following copied from interface: org.w3c.dom.Document
Parameters:
data - The data for the node.
Returns:
The new Text object.

createComment

public Comment createComment(java.lang.String data)
Description copied from interface: Document
Creates a Comment node given the specified string.
Specified by:
createComment in interface Document
Following copied from interface: org.w3c.dom.Document
Parameters:
data - The data for the node.
Returns:
The new Comment object.

createCDATASection

public CDATASection createCDATASection(java.lang.String data)
                                throws DOMException
Description copied from interface: Document
Creates a CDATASection node whose value is the specified string.
Specified by:
createCDATASection in interface Document
Following copied from interface: org.w3c.dom.Document
Parameters:
data - The data for the CDATASection contents.
Returns:
The new CDATASection object.
Throws:
DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(java.lang.String target,
                                                         java.lang.String data)
                                                  throws DOMException
Description copied from interface: Document
Creates a ProcessingInstruction node given the specified name and data strings.
Specified by:
createProcessingInstruction in interface Document
Following copied from interface: org.w3c.dom.Document
Parameters:
target - The target part of the processing instruction.
data - The data for the node.
Returns:
The new ProcessingInstruction object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if an invalid character is specified.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

createAttribute

public Attr createAttribute(java.lang.String name)
                     throws DOMException
Description copied from interface: Document
Creates an Attr of the given name. Note that the Attr instance can then be set on an Element using the setAttribute method.
Specified by:
createAttribute in interface Document
Following copied from interface: org.w3c.dom.Document
Parameters:
name - The name of the attribute.
Returns:
A new Attr object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

createEntityReference

public EntityReference createEntityReference(java.lang.String name)
                                      throws DOMException
Description copied from interface: Document
Creates an EntityReference object.
Specified by:
createEntityReference in interface Document
Following copied from interface: org.w3c.dom.Document
Parameters:
name - The name of the entity to reference.
Returns:
The new EntityReference object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

getElementsByTagName

public NodeList getElementsByTagName(java.lang.String tagname)
Description copied from interface: Document
Returns a NodeList of all the Elements with a given tag name in the order in which they would be encountered in a preorder traversal of the Document tree.
Specified by:
getElementsByTagName in interface Document
Following copied from interface: org.w3c.dom.Document
Parameters:
tagname - The name of the tag to match on. The special value "*" matches all tags.
Returns:
A new NodeList object containing all the matched Elements.

getTexString

public java.lang.String getTexString(Node targetNode)
Description copied from interface: techexplorerDocument
Converts a Node in a techexplorer Document to a TeX String.
Specified by:
getTexString in interface techexplorerDocument
Following copied from interface: ibm.techexplorer.dom.ext.techexplorerDocument
Parameters:
targetNode - The Node to be converted.
Returns:
The TeX String representing the given node.

getMmlString

public java.lang.String getMmlString(Node targetNode)
Description copied from interface: techexplorerDocument
Converts a Node in a techexplorer Document to a MathML String.
Specified by:
getMmlString in interface techexplorerDocument
Following copied from interface: ibm.techexplorer.dom.ext.techexplorerDocument
Parameters:
targetNode - The Node to be converted.
Returns:
The MathML String representing the given node.

getXmlString

public java.lang.String getXmlString(Node targetNode)
Description copied from interface: techexplorerDocument
Converts a Node in a techexplorer Document to an XML String.
Specified by:
getXmlString in interface techexplorerDocument
Following copied from interface: ibm.techexplorer.dom.ext.techexplorerDocument
Parameters:
targetNode - The Node to be converted.
Returns:
The XML String representing the given node.

printTeXInput

public java.lang.String printTeXInput(Node targetNode)

printMMLInput

public java.lang.String printMMLInput(Node targetNode)

convertTeXtoMML

public java.lang.String convertTeXtoMML(Node targetNode)

convertMMLtoTeX

public java.lang.String convertMMLtoTeX(Node targetNode)

createFromTexString

public Node createFromTexString(java.lang.String data)
Description copied from interface: techexplorerDocument
Creates a techexplorer Node from a TeX input String.
Specified by:
createFromTexString in interface techexplorerDocument
Following copied from interface: ibm.techexplorer.dom.ext.techexplorerDocument
Parameters:
data - The TeX input String.
Returns:
The Node created from the input.

createFromMmlString

public Node createFromMmlString(java.lang.String data)
Description copied from interface: techexplorerDocument
Creates a techexplorer Node from a MathML input String.
Specified by:
createFromMmlString in interface techexplorerDocument
Following copied from interface: ibm.techexplorer.dom.ext.techexplorerDocument
Parameters:
data - The MathML input String.
Returns:
The Node created from the input.

createFromXmlString

public Node createFromXmlString(java.lang.String data)
Description copied from interface: techexplorerDocument
Creates a techexplorer Node from an XML input String.
Specified by:
createFromXmlString in interface techexplorerDocument
Following copied from interface: ibm.techexplorer.dom.ext.techexplorerDocument
Parameters:
data - The XML input String.
Returns:
The Node created from the input.

scrollToNode

public void scrollToNode(Node targetNode)
Description copied from interface: techexplorerDocument
Scrolls the techexplorer view so that the given Node is visible.
Specified by:
scrollToNode in interface techexplorerDocument
Following copied from interface: ibm.techexplorer.dom.ext.techexplorerDocument
Parameters:
targetNode - The Node to make visible.

invalidate

public void invalidate()
Description copied from interface: techexplorerDocument
Invalidates the techexplorer view so the current contents will be redrawn.
Specified by:
invalidate in interface techexplorerDocument

recomposeAndRedraw

public void recomposeAndRedraw()
Description copied from interface: techexplorerDocument
Recalculates the layout of the techexplorer document and redraws the contents of the current view.
Specified by:
recomposeAndRedraw in interface techexplorerDocument

recomposeAndRedrawNode

public void recomposeAndRedrawNode(Node targetNode)
Description copied from interface: techexplorerDocument
Recalculates the layout of the techexplorer document and redraws the contents of the current view.
Specified by:
recomposeAndRedrawNode in interface techexplorerDocument

setMMLVersion

public void setMMLVersion(java.lang.String version,
                          boolean bDeprecated)
Description copied from interface: techexplorerDocument
Sets the version of MathML being used, and whether or not to allow deprecated features.
Specified by:
setMMLVersion in interface techexplorerDocument