net.sf.latexdraw.parsers.svg
Class SVGText

java.lang.Object
  extended by net.sf.latexdraw.parsers.svg.SVGElement
      extended by net.sf.latexdraw.parsers.svg.SVGText
All Implemented Interfaces:
java.lang.Cloneable, org.w3c.dom.CharacterData, org.w3c.dom.Element, org.w3c.dom.Node, org.w3c.dom.Text
Direct Known Subclasses:
SVGCDATASection, SVGComment

public class SVGText
extends SVGElement
implements org.w3c.dom.Text

Defines a text node.

This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

10/31/07

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  java.lang.String data
          The content of the text node.
static java.lang.String TEXT_NODE_NAME
           
 
Fields inherited from class net.sf.latexdraw.parsers.svg.SVGElement
attributes, children, name, ownerDocument, parent, stylesCSS, transform
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
SVGText(java.lang.String text, SVGDocument owner)
          Creates a text node.
 
Method Summary
 void appendData(java.lang.String da)
           
 boolean checkAttributes()
          Check if the SVG element is valid according to the SVG specification.
 void deleteData(int offset, int count)
           
 boolean enableRendering()
          According to the SVG specification, some attributes may lead to disables rendering of the element (e.g. width=0, height=0,...).
 java.lang.String getData()
           
 int getLength()
           
 short getNodeType()
           
 java.lang.String getNodeValue()
           
 java.lang.String getWholeText()
           
 void insertData(int offset, java.lang.String arg)
           
 boolean isElementContentWhitespace()
           
 void replaceData(int offset, int count, java.lang.String arg)
           
 org.w3c.dom.Text replaceWholeText(java.lang.String content)
           
 void setData(java.lang.String data)
           
 org.w3c.dom.Text splitText(int offset)
           
 java.lang.String substringData(int offset, int count)
           
 
Methods inherited from class net.sf.latexdraw.parsers.svg.SVGElement
appendChild, cloneNode, compareDocumentPosition, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBaseURI, getChildNodes, getChildren, getDef, getElementsByTagName, getElementsByTagNameNS, getFeature, getFill, getFirstChild, getFontFamily, getFontSize, getFontStyle, getFontWeight, getId, getLastChild, getLocalName, getNamespaceURI, getNbChildren, getNextSibling, getNodeName, getOwnerDocument, getParent, getParentNode, getPrefix, getPreviousSibling, getRootElement, getSchemaTypeInfo, getStroke, getStrokeDasharray, getStrokeLinecap, getStrokeLinejoin, getStrokeMiterlimit, getStrokeWidth, getStylesCSS, getSVGAttribute, getSVGRoot, getTagName, getTextContent, getTransform, getUsablePrefix, getUsablePrefix, getUserData, getWholeTransform, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, lookupPrefixUsable, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setAttributes, setFill, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeName, setNodeValue, setOwnerDocument, setParent, setPrefix, setStroke, setStrokeDashArray, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLevel, setStrokeWidth, setTextContent, setUserData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Field Detail

data

protected java.lang.String data
The content of the text node. @since 0.1


TEXT_NODE_NAME

public static final java.lang.String TEXT_NODE_NAME
See Also:
Constant Field Values
Constructor Detail

SVGText

public SVGText(java.lang.String text,
               SVGDocument owner)
Creates a text node.

Parameters:
text - The content of the node.
owner - The owner document.
Method Detail

getNodeValue

public java.lang.String getNodeValue()
Specified by:
getNodeValue in interface org.w3c.dom.Node
Overrides:
getNodeValue in class SVGElement

appendData

public void appendData(java.lang.String da)
Specified by:
appendData in interface org.w3c.dom.CharacterData

getData

public java.lang.String getData()
Specified by:
getData in interface org.w3c.dom.CharacterData

getLength

public int getLength()
Specified by:
getLength in interface org.w3c.dom.CharacterData

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface org.w3c.dom.Node
Overrides:
getNodeType in class SVGElement

checkAttributes

public boolean checkAttributes()
Description copied from class: SVGElement
Check if the SVG element is valid according to the SVG specification.

Specified by:
checkAttributes in class SVGElement
Returns:
True if valid.

enableRendering

public boolean enableRendering()
Description copied from class: SVGElement
According to the SVG specification, some attributes may lead to disables rendering of the element (e.g. width=0, height=0,...). This method checks these conditions depending of the SVG element.

Specified by:
enableRendering in class SVGElement
Returns:
True if the element can be rendered.

setData

public void setData(java.lang.String data)
Specified by:
setData in interface org.w3c.dom.CharacterData

getWholeText

public java.lang.String getWholeText()
Specified by:
getWholeText in interface org.w3c.dom.Text

isElementContentWhitespace

public boolean isElementContentWhitespace()
Specified by:
isElementContentWhitespace in interface org.w3c.dom.Text

replaceWholeText

public org.w3c.dom.Text replaceWholeText(java.lang.String content)
Specified by:
replaceWholeText in interface org.w3c.dom.Text

splitText

public org.w3c.dom.Text splitText(int offset)
Specified by:
splitText in interface org.w3c.dom.Text

deleteData

public void deleteData(int offset,
                       int count)
Specified by:
deleteData in interface org.w3c.dom.CharacterData

insertData

public void insertData(int offset,
                       java.lang.String arg)
Specified by:
insertData in interface org.w3c.dom.CharacterData

replaceData

public void replaceData(int offset,
                        int count,
                        java.lang.String arg)
Specified by:
replaceData in interface org.w3c.dom.CharacterData

substringData

public java.lang.String substringData(int offset,
                                      int count)
Specified by:
substringData in interface org.w3c.dom.CharacterData