net.sf.latexdraw.parsers.svg
Class SVGElement

java.lang.Object
  extended by net.sf.latexdraw.parsers.svg.SVGElement
All Implemented Interfaces:
java.lang.Cloneable, org.w3c.dom.Element, org.w3c.dom.Node
Direct Known Subclasses:
AbstractPointsElement, OtherNSElement, SVGCircleElement, SVGDefsElement, SVGEllipseElement, SVGGElement, SVGImageElement, SVGLinearGradientElement, SVGLineElement, SVGMarkerElement, SVGMetadataElement, SVGPathElement, SVGPatternElement, SVGRectElement, SVGStopElement, SVGSVGElement, SVGText, SVGTextElement

public abstract class SVGElement
extends java.lang.Object
implements org.w3c.dom.Element, java.lang.Cloneable

Defines an SVG element.

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.

09/11/07

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  SVGNamedNodeMap attributes
          The attributes of the element.
protected  SVGNodeList children
          The children of this element.
protected  java.lang.String name
          The name of the tag.
protected  SVGDocument ownerDocument
          The document containing the element.
protected  SVGElement parent
          The parent SVGElement of this element.
protected  CSSStyleList stylesCSS
          The list of the CSS styles of the SVG attribute style.
protected  SVGTransformList transform
          The list of transformations which concern the element.
 
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
SVGElement()
          The constructor by default.
SVGElement(org.w3c.dom.Node n)
          The constructor using a node in order to be initialised.
SVGElement(org.w3c.dom.Node n, SVGElement p)
          The constructor using a node to create the SVG element and an SVG element to be its parent.
SVGElement(SVGDocument owner)
          Creates an simple SVGElement with the owner document.
 
Method Summary
 org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
           
abstract  boolean checkAttributes()
          Check if the SVG element is valid according to the SVG specification.
 org.w3c.dom.Node cloneNode(boolean deep)
           
 short compareDocumentPosition(org.w3c.dom.Node other)
           
abstract  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 getAttribute(java.lang.String nameAttr)
           
 org.w3c.dom.Attr getAttributeNode(java.lang.String nameAttr)
           
 org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
           
 java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
           
 org.w3c.dom.NamedNodeMap getAttributes()
           
 java.lang.String getBaseURI()
           
 org.w3c.dom.NodeList getChildNodes()
           
 SVGNodeList getChildren(java.lang.String nodeName)
          Allow to get a set of children having the name 'nodeName'
 SVGElement getDef(java.lang.String id)
          Allows to get a definition (a tag in the 'def' part) with the identifier 'id'.
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String nameElt)
           
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
           
 java.lang.Object getFeature(java.lang.String feature, java.lang.String version)
           
 java.lang.String getFill()
           
 org.w3c.dom.Node getFirstChild()
           
 java.lang.String getFontFamily()
           
 float getFontSize()
           
 java.lang.String getFontStyle()
           
 java.lang.String getFontWeight()
           
 java.lang.String getId()
           
 org.w3c.dom.Node getLastChild()
           
 java.lang.String getLocalName()
           
 java.lang.String getNamespaceURI()
           
 int getNbChildren(int deep)
           
 org.w3c.dom.Node getNextSibling()
           
 java.lang.String getNodeName()
           
 short getNodeType()
           
 java.lang.String getNodeValue()
           
 SVGDocument getOwnerDocument()
           
 SVGElement getParent()
           
 org.w3c.dom.Node getParentNode()
           
 java.lang.String getPrefix()
           
 org.w3c.dom.Node getPreviousSibling()
           
 SVGElement getRootElement()
          Allows to get the root of the SVG document.
 org.w3c.dom.TypeInfo getSchemaTypeInfo()
           
 java.awt.Color getStroke()
           
 java.lang.String getStrokeDasharray()
           
 java.lang.String getStrokeLinecap()
           
 java.lang.String getStrokeLinejoin()
           
 double getStrokeMiterlimit()
           
 double getStrokeWidth()
           
 CSSStyleList getStylesCSS()
           
 java.lang.String getSVGAttribute(java.lang.String attrName, java.lang.String prefix)
          An SVG attribute can be defined in: its corresponding attribute (e.g. fill="..."); the attribute style (e.g. style="fill:...;..."); a CSS stylesheet.
 SVGSVGElement getSVGRoot()
           
 java.lang.String getTagName()
           
 java.lang.String getTextContent()
           
 SVGTransformList getTransform()
           
 java.lang.String getUsablePrefix()
           
 java.lang.String getUsablePrefix(java.lang.String uri)
           
 java.lang.Object getUserData(java.lang.String key)
           
 SVGTransformList getWholeTransform()
           
 boolean hasAttribute(java.lang.String nameAttr)
           
 boolean hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
           
 boolean hasAttributes()
           
 boolean hasChildNodes()
           
 org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
           
 boolean isDefaultNamespace(java.lang.String namespaceURI)
           
 boolean isEqualNode(org.w3c.dom.Node node)
           
 boolean isSameNode(org.w3c.dom.Node other)
           
 boolean isSupported(java.lang.String feature, java.lang.String version)
           
 java.lang.String lookupNamespaceURI(java.lang.String pref)
           
 java.lang.String lookupPrefix(java.lang.String namespaceURI)
           
 java.lang.String lookupPrefixUsable(java.lang.String namespaceURI)
          Returns the prefix of the given namespace URI with the ':' character after or an empty string if no prefix is found.
 void normalize()
           
 void removeAttribute(java.lang.String nameAttr)
           
 org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
           
 void removeAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
           
 org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
           
 org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
           
 void setAttribute(java.lang.String name, java.lang.String value)
           
 org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr)
           
 org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr)
           
 void setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value)
           
protected  void setAttributes(org.w3c.dom.Node n)
          Copies the attributes of the given node.
 void setFill(java.awt.Color c)
          Sets the colour of the filling.
 void setIdAttribute(java.lang.String name, boolean isId)
           
 void setIdAttributeNode(org.w3c.dom.Attr idAttr, boolean isId)
           
 void setIdAttributeNS(java.lang.String namespaceURI, java.lang.String localName, boolean isId)
           
 void setNodeName(java.lang.String name)
          Sets the name of the SVG element.
 void setNodeValue(java.lang.String nodeValue)
           
 void setOwnerDocument(SVGDocument doc)
          Sets the owner document of the node.
 void setParent(SVGElement parent)
           
 void setPrefix(java.lang.String prefix)
           
 void setStroke(java.awt.Color c)
          Sets The colour of the stroke.
 void setStrokeDashArray(java.lang.String dashArray)
          Sets the dash array of the stroke.
 void setStrokeDashOffset(double dashOffset)
          Sets the dash offset of the stroke.
 void setStrokeLineCap(java.lang.String svgLineCap)
          Sets the line cap of the stroke of the SVG shape.
 void setStrokeLineJoin(java.lang.String svgLineJoin)
          Sets the line join of the stroke of the SVG shape.
 void setStrokeMiterLevel(double miterLevel)
          Sets the miter level of the stroke.
 void setStrokeWidth(double strokeW)
          Sets the stroke width of the SVG shape.
 void setTextContent(java.lang.String textContent)
           
private  void setTransformation(java.lang.String transformation)
          Sets the transformation of the elements.
 java.lang.Object setUserData(java.lang.String key, java.lang.Object data, org.w3c.dom.UserDataHandler handler)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attributes

protected SVGNamedNodeMap attributes
The attributes of the element. @since 0.1


children

protected SVGNodeList children
The children of this element. @since 0.1


parent

protected SVGElement parent
The parent SVGElement of this element. @since 0.1


name

protected java.lang.String name
The name of the tag. @since 0.1


transform

protected SVGTransformList transform
The list of transformations which concern the element. @since 0.1


stylesCSS

protected CSSStyleList stylesCSS
The list of the CSS styles of the SVG attribute style. @since 0.1


ownerDocument

protected SVGDocument ownerDocument
The document containing the element. @since 0.1

Constructor Detail

SVGElement

public SVGElement()
The constructor by default.

Since:
0.1

SVGElement

public SVGElement(SVGDocument owner)
Creates an simple SVGElement with the owner document.

Parameters:
owner - The owner document.
Since:
0.1

SVGElement

public SVGElement(org.w3c.dom.Node n)
           throws MalformedSVGDocument
The constructor using a node in order to be initialised.

Parameters:
n - The node.
Throws:
MalformedSVGDocument - If the element is not well formed.
Since:
0.1

SVGElement

public SVGElement(org.w3c.dom.Node n,
                  SVGElement p)
           throws MalformedSVGDocument
The constructor using a node to create the SVG element and an SVG element to be its parent.

Parameters:
n - The node.
p - The parent SVG element.
Throws:
MalformedSVGDocument - If the element is not well formed.
Since:
0.1
Method Detail

setAttributes

protected void setAttributes(org.w3c.dom.Node n)
Copies the attributes of the given node.

Parameters:
n - The node to copy.

getRootElement

public SVGElement getRootElement()
Allows to get the root of the SVG document.

Returns:
The root.
Since:
0.1

getParent

public SVGElement getParent()
Returns:
the parent.
Since:
0.1

setParent

public void setParent(SVGElement parent)
Parameters:
parent - the parent to set.
Since:
0.1

getAttributes

public org.w3c.dom.NamedNodeMap getAttributes()
Specified by:
getAttributes in interface org.w3c.dom.Node

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNodeName

public java.lang.String getNodeName()
Specified by:
getNodeName in interface org.w3c.dom.Node

setNodeName

public void setNodeName(java.lang.String name)
Sets the name of the SVG element.

Parameters:
name - Its new name.

getAttribute

public java.lang.String getAttribute(java.lang.String nameAttr)
Specified by:
getAttribute in interface org.w3c.dom.Element

getAttributeNode

public org.w3c.dom.Attr getAttributeNode(java.lang.String nameAttr)
Specified by:
getAttributeNode in interface org.w3c.dom.Element

getTagName

public java.lang.String getTagName()
Specified by:
getTagName in interface org.w3c.dom.Element

appendChild

public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
Specified by:
appendChild in interface org.w3c.dom.Node

getChildNodes

public org.w3c.dom.NodeList getChildNodes()
Specified by:
getChildNodes in interface org.w3c.dom.Node

getFirstChild

public org.w3c.dom.Node getFirstChild()
Specified by:
getFirstChild in interface org.w3c.dom.Node

getLastChild

public org.w3c.dom.Node getLastChild()
Specified by:
getLastChild in interface org.w3c.dom.Node

getNodeType

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

getOwnerDocument

public SVGDocument getOwnerDocument()
Specified by:
getOwnerDocument in interface org.w3c.dom.Node

getParentNode

public org.w3c.dom.Node getParentNode()
Specified by:
getParentNode in interface org.w3c.dom.Node

hasAttributes

public boolean hasAttributes()
Specified by:
hasAttributes in interface org.w3c.dom.Node

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface org.w3c.dom.Node

insertBefore

public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
                                     org.w3c.dom.Node refChild)
Specified by:
insertBefore in interface org.w3c.dom.Node

isEqualNode

public boolean isEqualNode(org.w3c.dom.Node node)
Specified by:
isEqualNode in interface org.w3c.dom.Node

isSameNode

public boolean isSameNode(org.w3c.dom.Node other)
Specified by:
isSameNode in interface org.w3c.dom.Node

removeChild

public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
Specified by:
removeChild in interface org.w3c.dom.Node

setTextContent

public void setTextContent(java.lang.String textContent)
Specified by:
setTextContent in interface org.w3c.dom.Node

lookupPrefix

public java.lang.String lookupPrefix(java.lang.String namespaceURI)
Specified by:
lookupPrefix in interface org.w3c.dom.Node

hasAttribute

public boolean hasAttribute(java.lang.String nameAttr)
Specified by:
hasAttribute in interface org.w3c.dom.Element

getNamespaceURI

public java.lang.String getNamespaceURI()
Specified by:
getNamespaceURI in interface org.w3c.dom.Node

lookupNamespaceURI

public java.lang.String lookupNamespaceURI(java.lang.String pref)
Specified by:
lookupNamespaceURI in interface org.w3c.dom.Node

getPrefix

public java.lang.String getPrefix()
Specified by:
getPrefix in interface org.w3c.dom.Node

getUsablePrefix

public java.lang.String getUsablePrefix()
Returns:
The prefix followed by Character ':'. This method aims at simplifying the use of the prefix.

setTransformation

private void setTransformation(java.lang.String transformation)
Sets the transformation of the elements. Removes previous transformations. Should not be called directly; call setAttribute instead.

Parameters:
transformation - The transformation to set.
Since:
3.0

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Specified by:
setAttribute in interface org.w3c.dom.Element

getNextSibling

public org.w3c.dom.Node getNextSibling()
Specified by:
getNextSibling in interface org.w3c.dom.Node

getPreviousSibling

public org.w3c.dom.Node getPreviousSibling()
Specified by:
getPreviousSibling in interface org.w3c.dom.Node

getElementsByTagName

public org.w3c.dom.NodeList getElementsByTagName(java.lang.String nameElt)
Specified by:
getElementsByTagName in interface org.w3c.dom.Element

getElementsByTagNameNS

public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
                                                   java.lang.String localName)
Specified by:
getElementsByTagNameNS in interface org.w3c.dom.Element

getTextContent

public java.lang.String getTextContent()
Specified by:
getTextContent in interface org.w3c.dom.Node

getLocalName

public java.lang.String getLocalName()
Specified by:
getLocalName in interface org.w3c.dom.Node

removeAttribute

public void removeAttribute(java.lang.String nameAttr)
Specified by:
removeAttribute in interface org.w3c.dom.Element

removeAttributeNS

public void removeAttributeNS(java.lang.String namespaceURI,
                              java.lang.String localName)
Specified by:
removeAttributeNS in interface org.w3c.dom.Element

removeAttributeNode

public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
Specified by:
removeAttributeNode in interface org.w3c.dom.Element

setAttributeNS

public void setAttributeNS(java.lang.String namespaceURI,
                           java.lang.String qualifiedName,
                           java.lang.String value)
Specified by:
setAttributeNS in interface org.w3c.dom.Element

setAttributeNode

public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr)
Specified by:
setAttributeNode in interface org.w3c.dom.Element

setAttributeNodeNS

public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr)
Specified by:
setAttributeNodeNS in interface org.w3c.dom.Element

setIdAttribute

public void setIdAttribute(java.lang.String name,
                           boolean isId)
Specified by:
setIdAttribute in interface org.w3c.dom.Element

setIdAttributeNS

public void setIdAttributeNS(java.lang.String namespaceURI,
                             java.lang.String localName,
                             boolean isId)
Specified by:
setIdAttributeNS in interface org.w3c.dom.Element

setIdAttributeNode

public void setIdAttributeNode(org.w3c.dom.Attr idAttr,
                               boolean isId)
Specified by:
setIdAttributeNode in interface org.w3c.dom.Element

cloneNode

public org.w3c.dom.Node cloneNode(boolean deep)
Specified by:
cloneNode in interface org.w3c.dom.Node

compareDocumentPosition

public short compareDocumentPosition(org.w3c.dom.Node other)
Specified by:
compareDocumentPosition in interface org.w3c.dom.Node

getBaseURI

public java.lang.String getBaseURI()
Specified by:
getBaseURI in interface org.w3c.dom.Node

getSchemaTypeInfo

public org.w3c.dom.TypeInfo getSchemaTypeInfo()
Specified by:
getSchemaTypeInfo in interface org.w3c.dom.Element

getFeature

public java.lang.Object getFeature(java.lang.String feature,
                                   java.lang.String version)
Specified by:
getFeature in interface org.w3c.dom.Node

getUserData

public java.lang.Object getUserData(java.lang.String key)
Specified by:
getUserData in interface org.w3c.dom.Node

isDefaultNamespace

public boolean isDefaultNamespace(java.lang.String namespaceURI)
Specified by:
isDefaultNamespace in interface org.w3c.dom.Node

isSupported

public boolean isSupported(java.lang.String feature,
                           java.lang.String version)
Specified by:
isSupported in interface org.w3c.dom.Node

normalize

public void normalize()
Specified by:
normalize in interface org.w3c.dom.Node

replaceChild

public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
                                     org.w3c.dom.Node oldChild)
Specified by:
replaceChild in interface org.w3c.dom.Node

setUserData

public java.lang.Object setUserData(java.lang.String key,
                                    java.lang.Object data,
                                    org.w3c.dom.UserDataHandler handler)
Specified by:
setUserData in interface org.w3c.dom.Node

setPrefix

public void setPrefix(java.lang.String prefix)
Specified by:
setPrefix in interface org.w3c.dom.Node

getNodeValue

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

setNodeValue

public void setNodeValue(java.lang.String nodeValue)
Specified by:
setNodeValue in interface org.w3c.dom.Node

lookupPrefixUsable

public java.lang.String lookupPrefixUsable(java.lang.String namespaceURI)
Returns the prefix of the given namespace URI with the ':' character after or an empty string if no prefix is found.

Parameters:
namespaceURI - The URI to look for.
Returns:
the prefix followed by ':' or an empty string.
Since:
0.1

checkAttributes

public abstract boolean checkAttributes()
Check if the SVG element is valid according to the SVG specification.

Returns:
True if valid.
Since:
0.1

enableRendering

public abstract boolean enableRendering()
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.

Returns:
True if the element can be rendered.
Since:
0.1

getAttributeNodeNS

public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI,
                                           java.lang.String localName)
Specified by:
getAttributeNodeNS in interface org.w3c.dom.Element

getAttributeNS

public java.lang.String getAttributeNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
Specified by:
getAttributeNS in interface org.w3c.dom.Element

hasAttributeNS

public boolean hasAttributeNS(java.lang.String namespaceURI,
                              java.lang.String localName)
Specified by:
hasAttributeNS in interface org.w3c.dom.Element

getSVGRoot

public SVGSVGElement getSVGRoot()
Returns:
The root element of the SVG document: an SVGSVGElement.
Since:
0.1

getDef

public SVGElement getDef(java.lang.String id)
Allows to get a definition (a tag in the 'def' part) with the identifier 'id'.

Parameters:
id - The identifier of the wanted definition.
Returns:
The definition or null.
Since:
0.1

getId

public java.lang.String getId()
Returns:
The identifier of the SVGElement.
Since:
0.1

getChildren

public SVGNodeList getChildren(java.lang.String nodeName)
Allow to get a set of children having the name 'nodeName'

Parameters:
nodeName - The name of the wanted nodes.
Returns:
The set of nodes (may be empty but not null).
Since:
0.1

setStrokeWidth

public void setStrokeWidth(double strokeW)
Sets the stroke width of the SVG shape.

Parameters:
strokeW - The new stroke width (must be greater than 0).
Since:
0.1

setStrokeLineCap

public void setStrokeLineCap(java.lang.String svgLineCap)
Sets the line cap of the stroke of the SVG shape.

Parameters:
svgLineCap - The line cap to set. Must be SVG_LINECAP_VALUE_BUTT or SVG_LINECAP_VALUE_ROUND or SVG_LINECAP_VALUE_SQUARE.
Since:
0.2

setStrokeMiterLevel

public void setStrokeMiterLevel(double miterLevel)
Sets the miter level of the stroke.

Parameters:
miterLevel - The miter level to set. Must be greater than or equal to 1.
Since:
0.2

setStrokeDashOffset

public void setStrokeDashOffset(double dashOffset)
Sets the dash offset of the stroke.

Parameters:
dashOffset - The dash offset to set.
Since:
0.2

setStrokeDashArray

public void setStrokeDashArray(java.lang.String dashArray)
Sets the dash array of the stroke.

Parameters:
dashArray - The dash array to set. Must not be null.
Since:
0.2

setStrokeLineJoin

public void setStrokeLineJoin(java.lang.String svgLineJoin)
Sets the line join of the stroke of the SVG shape.

Parameters:
svgLineJoin - The line join to set. Must be SVG_LINEJOIN_VALUE_BEVEL or SVG_LINEJOIN_VALUE_MITER or SVG_LINEJOIN_VALUE_ROUND.
Since:
0.2

getStrokeWidth

public double getStrokeWidth()
Returns:
The stroke width of the element (if it is possible) or 1.
Since:
0.1

getStrokeDasharray

public java.lang.String getStrokeDasharray()
Returns:
The dash array of the element (if it is possible) or null.
Since:
0.1

getStrokeLinejoin

public java.lang.String getStrokeLinejoin()
Returns:
The line join of the element or its default value.
Since:
3.0

getStrokeLinecap

public java.lang.String getStrokeLinecap()
Returns:
The line cap of the element or its default value.
Since:
0.1

getStrokeMiterlimit

public double getStrokeMiterlimit()
Returns:
The miter limit of the element or its default value.
Since:
0.1

getFontSize

public float getFontSize()
Returns:
The font-size value in point of the element, or from one of its parents.

getFontFamily

public java.lang.String getFontFamily()
Returns:
The defined or inherited font family. Otherwise, an empty string.

getFontStyle

public java.lang.String getFontStyle()
Returns:
The defined or inherited font style. Otherwise, the default value "normal" is returned.

getFontWeight

public java.lang.String getFontWeight()
Returns:
The defined or inherited font weight. Otherwise, the default value "normal" is returned.

setFill

public void setFill(java.awt.Color c)
Sets the colour of the filling.

Parameters:
c - The new filling colour.
Since:
0.1

getFill

public java.lang.String getFill()
Returns:
The fill content of the element or its default value.
Since:
0.1

setStroke

public void setStroke(java.awt.Color c)
Sets The colour of the stroke.

Parameters:
c - The new colour of the stroke (must not be null).
Since:
0.1

getStroke

public java.awt.Color getStroke()
Returns:
The fill content of the element (if it is possible) or null.
Since:
0.1

getUsablePrefix

public java.lang.String getUsablePrefix(java.lang.String uri)
Parameters:
uri - The URI that will be used parsed to extract a prefix.
Returns:
The prefix followed by ':' if there is a prefix. An empty string is returned in the other case.
Since:
0.1

getTransform

public SVGTransformList getTransform()
Returns:
The list of transformations of the current SVG element (may be null).
Since:
0.1

getWholeTransform

public SVGTransformList getWholeTransform()
Returns:
The list of all the transformations of the node's parents followed by the node's transformations. The first transformations will be the transformations of the oldest parent and the last ones, the transformations of the current node. If no transformation are defined, an empty list is returned.
Since:
0.1

setOwnerDocument

public void setOwnerDocument(SVGDocument doc)
Sets the owner document of the node.

Parameters:
doc - The document to set.
Since:
2.0.0

getNbChildren

public int getNbChildren(int deep)
Parameters:
deep - If deep equals to 1, only direct children will be considered, and so on.
Returns:
The number of children of the node.

getStylesCSS

public CSSStyleList getStylesCSS()
Returns:
the stylesCSS
Since:
0.1

getSVGAttribute

public java.lang.String getSVGAttribute(java.lang.String attrName,
                                        java.lang.String prefix)
An SVG attribute can be defined in: its corresponding attribute (e.g. fill="..."); the attribute style (e.g. style="fill:...;..."); a CSS stylesheet. This function returns the value of an SVG attribute by testing: 1. Its corresponding attribute; 2. The attribute style is 1. fails. TODO CSS stylesheet are not managed yet.

Parameters:
attrName - The name of the researched attribute.
prefix - The usable prefix.
Returns:
The found value or null.
Since:
2.0.6