org.w3c.dom.svg
Interface SVGSVGElement

All Superinterfaces:
Element, EventTarget, Node, SVGElement, SVGLocatableElement

public interface SVGSVGElement
extends SVGLocatableElement

This interface represents <svg> element in (SVG) document tree.

User Agent Transforms

The DOM attributes currentScale, currentRotate and currentTranslate are combined to form user agent transformation which is applied at the outermost level on the SVG document (i.e., outside the outermost 'svg' element) if "magnification" is enabled (i.e., zoomAndPan attribute is set to "magnify"). Their values can potentialy be modified through user-agent specific UI. User agent transformation can be obtained by multiplying matrix

          [currentScale      0       currentTranslate.x]             [cos(currentRotate) -sin(currentRotate 0]
          [     0      currentScale  currentTranslate.y]      by     [sin(currentRotate) cos(currentRotate) 0]
          [     0            0               1         ]             [         0                  0         1]
      

i.e. (translate, then scale, then rotate the coordinate system). The reference point for scale and rotate operations is the origin (0, 0).

Note: If the application does not have the necessary privilege rights to access this (SVG) content, a SecurityException may be thrown by the underlying implementation. This is applicable to all the Tree navigation and Trait acessor methods. Features such as zooming, panning and playing of animations will not be affected.

Since:
JDE 4.6.0

Field Summary
 
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
 
Method Summary
 SVGMatrix createSVGMatrixComponents(float a, float b, float c, float d, float e, float f)
           Creates new SVGMatrix object.
 SVGPath createSVGPath()
           Creates new SVGPath object.
 SVGRect createSVGRect()
           Creates new SVGRect object.
 SVGRGBColor createSVGRGBColor(int red, int green, int blue)
           Creates new SVGRGBColor object.
 float getCurrentRotate()
           Returns current user agent rotation angle in degrees.
 float getCurrentScale()
           Returns current user agent scale (zoom) coefficient.
 float getCurrentTime()
           Returns current animation timeline time in seconds.
 SVGPoint getCurrentTranslate()
           Current user agent translation used for scrolling or panning (The returned SVGPoint object is "live" and setting its x and y components will change user agent's translation).
 void setCurrentRotate(float value)
           Sets current user agent rotate coefficient in degrees.
 void setCurrentScale(float value)
           Sets current user agent scale (zoom) coefficient.
 void setCurrentTime(float seconds)
           Sets current animation timeline time (in seconds).
 
Methods inherited from interface org.w3c.dom.svg.SVGLocatableElement
getBBox, getScreenBBox, getScreenCTM
 
Methods inherited from interface org.w3c.dom.svg.SVGElement
getFirstElementChild, getFloatTrait, getId, getMatrixTrait, getNextElementSibling, getPathTrait, getRectTrait, getRGBColorTrait, getTrait, getTraitNS, setFloatTrait, setId, setMatrixTrait, setPathTrait, setRectTrait, setRGBColorTrait, setTrait, setTraitNS
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 
Methods inherited from interface org.w3c.dom.events.EventTarget
addEventListener, dispatchEvent, removeEventListener
 

Method Detail

createSVGMatrixComponents

public SVGMatrix createSVGMatrixComponents(float a,
                                           float b,
                                           float c,
                                           float d,
                                           float e,
                                           float f)

Creates new SVGMatrix object. This object can be used to modify value of traits which are compatible with SVGMatrix type using setMatrixTrait method. The internal representation of the matrix is as follows:

          [  a  c  e  ]
          [  b  d  f  ]
          [  0  0  1  ]
      

Parameters:
a - the 'a' component of the matrix to be set.
b - the 'b' component of the matrix to be set.
c - the 'c' component of the matrix to be set.
d - the 'd' component of the matrix to be set.
e - the 'e' component of the matrix to be set.
f - the 'f' component of the matrix to be set.
Returns:
the newly created SVGMatrix object.
Since:
JDE 4.6.0
See Also:
SVGMatrix

createSVGPath

public SVGPath createSVGPath()

Creates new SVGPath object. This object can be used to modify value of traits which are compatible with SVGPath type using setPathTrait method.

Returns:
the newly created SVGPath object with empty path commands.
Since:
JDE 4.6.0

createSVGRect

public SVGRect createSVGRect()

Creates new SVGRect object. This object can be used to modify value of traits which are compatible with SVGRect type using setRectTrait method. The intial values for x, y, width, height of this new SVGRect are zero.

Returns:
the newly created SVGRect object.
Since:
JDE 4.6.0

createSVGRGBColor

public SVGRGBColor createSVGRGBColor(int red,
                                     int green,
                                     int blue)
                              throws SVGException

Creates new SVGRGBColor object. This object can be used to modify value of traits which are compatible with SVGRGBColor type using setRGBColorTrait method.

Parameters:
red - the red component of SVGRGBColor object.
green - the green component of SVGRGBColor object.
blue - the blue component of SVGRGBColor object.
Returns:
the newly created SVGRGBColor object with specified (r,g,b) values.
Throws:
SVGException - with error code SVG_INVALID_VALUE_ERR: if any of the parameters is not in the 0..255 range.
Since:
JDE 4.6.0

getCurrentRotate

public float getCurrentRotate()

Returns current user agent rotation angle in degrees. The initial value for currentRotate is 0.

Returns:
the current user agent rotation coefficient in degrees.
Since:
JDE 4.6.0

getCurrentScale

public float getCurrentScale()

Returns current user agent scale (zoom) coefficient. The initial value for currentScale is 1.

Returns:
the current user agent scale coefficient.
Since:
JDE 4.6.0

getCurrentTime

public float getCurrentTime()

Returns current animation timeline time in seconds.

Returns:
the current animation timeline time in seconds.
Since:
JDE 4.6.0

getCurrentTranslate

public SVGPoint getCurrentTranslate()

Current user agent translation used for scrolling or panning (The returned SVGPoint object is "live" and setting its x and y components will change user agent's translation). The initial values for currentTranslate is SVGPoint(0,0).

Returns:
returns the current user agent translation.
Since:
JDE 4.6.0

setCurrentRotate

public void setCurrentRotate(float value)

Sets current user agent rotate coefficient in degrees.

Parameters:
value - the value of user agent rotate coefficient to be set.
Since:
JDE 4.6.0

setCurrentScale

public void setCurrentScale(float value)
                     throws DOMException

Sets current user agent scale (zoom) coefficient.

Parameters:
value - the value of user agent scale coefficient to be set.
Throws:
DOMException - with error code INVALID_ACCESS_ERR if the scale value is set to zero.
Since:
JDE 4.6.0

setCurrentTime

public void setCurrentTime(float seconds)

Sets current animation timeline time (in seconds). This API is required to support moving forwards in timeline. The underlying implementations are normally designed to seek forward in time and setting the time backwards is not meant to play the animation backwards. Note: Moving backwards in time is a costly feature for the implementations to support.

Parameters:
seconds - the value of time to be set in seconds.
Since:
JDE 4.6.0



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.