|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SVGSVGElement
This interface represents <svg> element in (SVG) document tree.
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.
Field Summary |
---|
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. |
|
SVGRGBColor |
createSVGRGBColor(int red,
int green,
int blue)
Creates new SVGRGBColor object. |
|
SVGRect |
createSVGRect()
Creates new SVGRect 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, getRGBColorTrait, getRectTrait, getTrait, getTraitNS, setFloatTrait, setId, setMatrixTrait, setPathTrait, setRGBColorTrait, setRectTrait, setTrait, setTraitNS |
Methods inherited from interface org.w3c.dom.Element |
---|
getAttribute, getAttributeNS, getAttributeNode, getAttributeNodeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNS, removeAttributeNode, setAttribute, setAttributeNS, setAttributeNode, setAttributeNodeNS, setIdAttribute, setIdAttributeNS, setIdAttributeNode |
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 |
---|
void setCurrentScale(float value) throws DOMException
Sets current user agent scale (zoom) coefficient.
value
- the value of user agent scale coefficient to be set.
DOMException
- with error code INVALID_ACCESS_ERR
if the scale value is set to zero.float getCurrentScale()
Returns current user agent scale (zoom) coefficient. The initial value for currentScale is 1.
void setCurrentRotate(float value)
Sets current user agent rotate coefficient in degrees.
value
- the value of user agent rotate coefficient to be set.float getCurrentRotate()
Returns current user agent rotation angle in degrees. The initial value for currentRotate is 0.
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).
float getCurrentTime()
Returns current animation timeline time in seconds.
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.
seconds
- the value of time to be set in seconds.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 ]
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.
SVGMatrix
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.
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.
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.
red
- the red component of SVGRGBColor object.green
- the green component of SVGRGBColor object.blue
- the blue component of SVGRGBColor object.
SVGException
- with error code SVG_INVALID_VALUE_ERR:
if any of the parameters is not in the 0..255 range.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal