@DOMObjectAttribute @DOMNameAttribute(name="SVGSVGElement") public class SVGSVGElement extends SVGGraphicsElement implements ISVGFitToViewBox, ISVGZoomAndPan, IDocumentEvent
A key interface definition is the SVGSVGElement interface, which is the interface that corresponds to the ‘svg’ element. This interface contains various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices.
SVGGraphicsElement
,
ISVGFitToViewBox
,
IDocumentEvent
,
IViewCSS
,
IDocumentCSS
Node.Flags
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, flags, nodeDocument, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
EventMap
PropertyChanged
Constructor and Description |
---|
SVGSVGElement(com.aspose.html.dom.DOMName name,
Document doc)
Initializes a new instance of the
SVGElement class. |
Modifier and Type | Method and Description |
---|---|
boolean |
animationsPaused()
Returns true if this SVG document fragment is in a paused state.
|
boolean |
checkEnclosure(SVGElement element,
SVGRect rect)
Returns true if the rendered content of the given element is entirely contained within the supplied rectangle.
|
boolean |
checkIntersection(SVGElement element,
SVGRect rect)
Returns true if the rendered content of the given element intersects the supplied rectangle.
|
Event |
createEvent(String eventType)
Creates an
Event of a type supported by the implementation. |
SVGAngle |
createSVGAngle()
Creates an SVGAngle object outside of any document trees.
|
SVGLength |
createSVGLength()
Creates an SVGLength object outside of any document trees.
|
SVGMatrix |
createSVGMatrix()
Creates an SVGMatrix object outside of any document trees.
|
SVGNumber |
createSVGNumber()
Creates an SVGNumber object outside of any document trees.
|
SVGPoint |
createSVGPoint()
Creates an SVGPoint object outside of any document trees.
|
SVGRect |
createSVGRect()
Creates an SVGRect object outside of any document trees.
|
SVGTransform |
createSVGTransform()
Creates an SVGTransform object outside of any document trees.
|
SVGTransform |
createSVGTransformFromMatrix(SVGMatrix matrix)
Creates an SVGTransform object outside of any document trees.
|
void |
deselectAll()
Unselects any selected objects, including any selections of text strings and type-in bars.
|
void |
forceRedraw()
In rendering environments supporting interactivity, forces the user agent to immediately redraw all regions of the viewport that require updating.
|
float |
getCurrentScale()
On an outermost svg element, this attribute indicates the current scale factor relative to the initial view to take into account user magnification and panning operations, as described under Magnification and panning.
|
float |
getCurrentTime()
Returns the current time in seconds relative to the start time for the current SVG document fragment.
|
SVGPoint |
getCurrentTranslate()
On an outermost svg element, the corresponding translation factor that takes into account user "magnification".
|
Element |
getElementById(String elementId)
Searches this SVG document fragment (i.e., the search is restricted to a subset of the document tree) for an Element whose id is given by elementId.
|
NodeList |
getEnclosureList(SVGRect rect,
SVGElement referenceElement)
Returns the list of graphics elements whose rendered content is entirely contained within the supplied rectangle.
|
SVGAnimatedLength |
getHeight()
Corresponds to attribute ‘height’ on the given ‘svg’ element.
|
NodeList |
getIntersectionList(SVGRect rect,
SVGElement referenceElement)
Returns the list of graphics elements whose rendered content intersects the supplied rectangle.
|
float |
getPixelUnitToMillimeterX()
Size of a pixel units (as defined by CSS2) along the x-axis of the viewport, which represents a unit somewhere in the range of 70dpi to 120dpi, and, on systems that support this, might actually match the characteristics of the target medium.
|
float |
getPixelUnitToMillimeterY()
Corresponding size of a pixel unit along the y-axis of the viewport.
|
SVGAnimatedPreserveAspectRatio |
getPreserveAspectRatio()
Corresponds to attribute ‘preserveAspectRatio’ on the given element.
|
float |
getScreenPixelToMillimeterX()
User interface (UI) events in DOM Level 2 indicate the screen positions at which the given UI event occurred.
|
float |
getScreenPixelToMillimeterY()
Corresponding size of a screen pixel along the y-axis of the viewport
Value:
Size of a screen pixel along the y-axis of the viewport
|
com.aspose.html.dom.svg.SVGContext |
getSVGContext() |
boolean |
getUseCurrentView()
The initial view (i.e., before magnification and panning) of the current innermost SVG document fragment can be either the "standard" view (i.e., based on attributes on the ‘svg’ element such as ‘viewBox’) or to a "custom" view (i.e., a hyperlink into a particular ‘view’ or other element - see Linking into SVG content: IRI fragments and SVG views).
|
SVGAnimatedRect |
getViewBox()
Corresponds to attribute ‘viewBox’ on the given element.
|
SVGAnimatedLength |
getWidth()
Corresponds to attribute ‘width’ on the given ‘svg’ element.
|
SVGAnimatedLength |
getX()
Corresponds to attribute ‘x’ on the given ‘svg’ element.
|
SVGAnimatedLength |
getY()
Corresponds to attribute ‘y’ on the given ‘svg’ element.
|
int |
getZoomAndPan()
Corresponds to attribute ‘zoomAndPan’ on the given element.
|
void |
pauseAnimations()
Suspends (i.e., pauses) all currently running animations that are defined within the SVG document fragment corresponding to this ‘svg’ element, causing the animation clock corresponding to this document fragment to stand still until it is unpaused.
|
void |
setCurrentScale(float value)
On an outermost svg element, this attribute indicates the current scale factor relative to the initial view to take into account user magnification and panning operations, as described under Magnification and panning.
|
void |
setCurrentTime(float seconds)
Adjusts the clock for this SVG document fragment, establishing a new current time.
|
void |
setZoomAndPan(int value)
Corresponds to attribute ‘zoomAndPan’ on the given element.
|
long |
suspendRedraw(long maxWaitMilliseconds)
Takes a time-out value which indicates that redraw shall not occur until:
- the corresponding unsuspendRedraw() call has been made,
- an unsuspendRedrawAll() call has been made, or
- its timer has timed out.
|
void |
unpauseAnimations()
Unsuspends (i.e., unpauses) currently running animations that are defined within the SVG document fragment, causing the animation clock to continue from the time at which it was suspended.
|
void |
unsuspendRedraw(long suspendHandleID)
Cancels a specified suspendRedraw() by providing a unique suspend handle ID that was returned by a previous suspendRedraw() call.
|
void |
unsuspendRedrawAll()
Cancels all currently active suspendRedraw() method calls.
|
getBBox, getCTM, getFarthestViewportElement, getNearestViewportElement, getRequiredExtensions, getRequiredFeatures, getScreenCTM, getSystemLanguage, getTransform
addSVGAttributeBinding, blur, focus, getClassName_SVGElement_New, getId_SVGElement_New, getOwnerSVGElement, getStyle, getSVGAttributeBindings, getTabIndex, getViewportElement, isReadOnly, isRendered, setId_SVGElement_New, setTabIndex
attachShadow, equals, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildElementCount, getChildren, getClassName, getComputedStyle, getComputedStyle, getData, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getId, getInnerHTML, getLastElementChild, getLocalName, getNamespaceURI, getNextElementSibling, getNodeName, getNodeType, getOuterHTML, getPrefix, getPreviousElementSibling, getSchemaTypeInfo, getShadowRoot, getStyleContainer, getTag, getTagName, getTextContent, hasAttribute, hasAttributeNS, hasAttributes, querySelector, querySelectorAll, remove, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, setData, setId, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setInnerHTML, setOuterHTML, setTextContent
adoptNode, appendChild, cloneNode, deepClone, getBaseURI, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, getRegisteredObservers, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceAll, replaceChild, setNodeValue, setParentNode, setPrefix, toString
addEventListener, addEventListener, addEventListener, addEventListener, dispatchEvent, dispose, removeEventListener, removeEventListener, removeEventListener
fireNotifyPropertyChanged, getCurrentValues, getRuntimesBinding, setCurrentValues, setField, setRuntimesBinding
public SVGSVGElement(com.aspose.html.dom.DOMName name, Document doc)
Initializes a new instance of the SVGElement
class.
name
- The element name.doc
- The document.public com.aspose.html.dom.svg.SVGContext getSVGContext()
getSVGContext
in class SVGElement
@DOMNameAttribute(name="x") public SVGAnimatedLength getX()
Corresponds to attribute ‘x’ on the given ‘svg’ element.
Value: Corresponds to attribute ‘x’ on the given ‘svg’ element.@DOMNameAttribute(name="y") public SVGAnimatedLength getY()
Corresponds to attribute ‘y’ on the given ‘svg’ element.
Value: Corresponds to attribute ‘y’ on the given ‘svg’ element.@DOMNameAttribute(name="width") public SVGAnimatedLength getWidth()
Corresponds to attribute ‘width’ on the given ‘svg’ element.
Value: Corresponds to attribute ‘width’ on the given ‘svg’ element.@DOMNameAttribute(name="height") public SVGAnimatedLength getHeight()
Corresponds to attribute ‘height’ on the given ‘svg’ element.
Value: Corresponds to attribute ‘height’ on the given ‘svg’ element.@DOMNameAttribute(name="useCurrentView") public boolean getUseCurrentView()
The initial view (i.e., before magnification and panning) of the current innermost SVG document fragment can be either the "standard" view (i.e., based on attributes on the ‘svg’ element such as ‘viewBox’) or to a "custom" view (i.e., a hyperlink into a particular ‘view’ or other element - see Linking into SVG content: IRI fragments and SVG views). If the initial view is the "standard" view, then this attribute is false. If the initial view is a "custom" view, then this attribute is true.
Value: The initial view of the current innermost SVG document.@DOMNameAttribute(name="currentScale") public float getCurrentScale()
On an outermost svg element, this attribute indicates the current scale factor relative to the initial view to take into account user magnification and panning operations, as described under Magnification and panning. DOM attributes currentScale and currentTranslate are equivalent to the 2x3 matrix [a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]. If "magnification" is enabled (i.e., zoomAndPan="magnify"), then the effect is as if an extra transformation were placed at the outermost level on the SVG document fragment (i.e., outside the outermost svg element). When accessed on an ‘svg’ element that is not an outermost svg element, it is undefined what behavior this attribute has.
Value: The current scale.@DOMNameAttribute(name="currentScale") public void setCurrentScale(float value)
On an outermost svg element, this attribute indicates the current scale factor relative to the initial view to take into account user magnification and panning operations, as described under Magnification and panning. DOM attributes currentScale and currentTranslate are equivalent to the 2x3 matrix [a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]. If "magnification" is enabled (i.e., zoomAndPan="magnify"), then the effect is as if an extra transformation were placed at the outermost level on the SVG document fragment (i.e., outside the outermost svg element). When accessed on an ‘svg’ element that is not an outermost svg element, it is undefined what behavior this attribute has.
Value: The current scale.@DOMNameAttribute(name="currentTranslate") public SVGPoint getCurrentTranslate()
On an outermost svg element, the corresponding translation factor that takes into account user "magnification". When accessed on an ‘svg’ element that is not an outermost svg element, it is undefined what behavior this attribute has.
Value: The current translate.@DOMNameAttribute(name="pixelUnitToMillimeterX") public float getPixelUnitToMillimeterX()
Size of a pixel units (as defined by CSS2) along the x-axis of the viewport, which represents a unit somewhere in the range of 70dpi to 120dpi, and, on systems that support this, might actually match the characteristics of the target medium. On systems where it is impossible to know the size of a pixel, a suitable default pixel size is provided.
Value: Size of a pixel units (as defined by CSS2) along the x-axis of the viewport@DOMNameAttribute(name="pixelUnitToMillimeterY") public float getPixelUnitToMillimeterY()
Corresponding size of a pixel unit along the y-axis of the viewport.
Value: Size of a pixel unit along the y-axis of the viewport.@DOMNameAttribute(name="screenPixelToMillimeterX") public float getScreenPixelToMillimeterX()
User interface (UI) events in DOM Level 2 indicate the screen positions at which the given UI event occurred. When the user agent actually knows the physical size of a "screen unit", this attribute will express that information; otherwise, user agents will provide a suitable default value such as .28mm.
Value: Size of a screen pixel along the x-axis of the viewport@DOMNameAttribute(name="screenPixelToMillimeterY") public float getScreenPixelToMillimeterY()
Corresponding size of a screen pixel along the y-axis of the viewport
Value: Size of a screen pixel along the y-axis of the viewport@DOMNameAttribute(name="suspendRedraw") public long suspendRedraw(long maxWaitMilliseconds)
Takes a time-out value which indicates that redraw shall not occur until: - the corresponding unsuspendRedraw() call has been made, - an unsuspendRedrawAll() call has been made, or - its timer has timed out. In environments that do not support interactivity(e.g., print media), then redraw shall not be suspended.Calls to suspendRedraw() and unsuspendRedraw() should, but need not be, made in balanced pairs. To suspend redraw actions as a collection of SVG DOM changes occur, precede the changes to the SVG DOM with a method call similar to:
suspendHandleID = suspendRedraw(maxWaitMilliseconds);and follow the changes with a method call similar to:
unsuspendRedraw(suspendHandleID);Note that multiple suspendRedraw calls can be used at once and that each such method call is treated independently of the other suspendRedraw method calls.
maxWaitMilliseconds
- The amount of time in milliseconds to hold off before redrawing the device. Values greater than 60 seconds will be truncated down to 60 seconds.@DOMNameAttribute(name="unsuspendRedraw") public void unsuspendRedraw(long suspendHandleID)
Cancels a specified suspendRedraw() by providing a unique suspend handle ID that was returned by a previous suspendRedraw() call.
suspendHandleID
- A number which acts as a unique identifier for the desired suspendRedraw() call. The number supplied must be a value returned from a previous call to suspendRedraw(). If an invalid handle ID value is provided then the request to unsuspendRedraw() is silently ignored.@DOMNameAttribute(name="unsuspendRedrawAll") public void unsuspendRedrawAll()
Cancels all currently active suspendRedraw() method calls. This method is most useful at the very end of a set of SVG DOM calls to ensure that all pending suspendRedraw() method calls have been cancelled.
@DOMNameAttribute(name="forceRedraw") public void forceRedraw()
In rendering environments supporting interactivity, forces the user agent to immediately redraw all regions of the viewport that require updating.
@DOMNameAttribute(name="pauseAnimations") public void pauseAnimations()
Suspends (i.e., pauses) all currently running animations that are defined within the SVG document fragment corresponding to this ‘svg’ element, causing the animation clock corresponding to this document fragment to stand still until it is unpaused.
@DOMNameAttribute(name="unpauseAnimations") public void unpauseAnimations()
Unsuspends (i.e., unpauses) currently running animations that are defined within the SVG document fragment, causing the animation clock to continue from the time at which it was suspended.
@DOMNameAttribute(name="animationsPaused") public boolean animationsPaused()
Returns true if this SVG document fragment is in a paused state.
@DOMNameAttribute(name="getCurrentTime") public float getCurrentTime()
Returns the current time in seconds relative to the start time for the current SVG document fragment. If getCurrentTime is called before the document timeline has begun (for example, by script running in a ‘script’ element before the document's SVGLoad event is dispatched), then 0 is returned.
@DOMNameAttribute(name="setCurrentTime") public void setCurrentTime(float seconds)
Adjusts the clock for this SVG document fragment, establishing a new current time. If setCurrentTime is called before the document timeline has begun (for example, by script running in a ‘script’ element before the document's SVGLoad event is dispatched), then the value of seconds in the last invocation of the method gives the time that the document will seek to once the document timeline has begun.
seconds
- The new current time in seconds relative to the start time for the current SVG document fragment.@DOMNameAttribute(name="getIntersectionList") public NodeList getIntersectionList(SVGRect rect, SVGElement referenceElement)
Returns the list of graphics elements whose rendered content intersects the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in ‘pointer-events’ processing.
rect
- The test rectangle. The values are in the initial coordinate system for the current ‘svg’ element.referenceElement
- If not null, then any intersected element that doesn't have the referenceElement as ancestor must not be included in the returned NodeList.@DOMNameAttribute(name="getEnclosureList") public NodeList getEnclosureList(SVGRect rect, SVGElement referenceElement)
Returns the list of graphics elements whose rendered content is entirely contained within the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in ‘pointer-events’ processing.
rect
- The test rectangle. The values are in the initial coordinate system for the current ‘svg’ element.referenceElement
- If not null, then any intersected element that doesn't have the referenceElement as ancestor must not be included in the returned NodeList.@DOMNameAttribute(name="checkIntersection") public boolean checkIntersection(SVGElement element, SVGRect rect)
Returns true if the rendered content of the given element intersects the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in ‘pointer-events’ processing.
element
- The element on which to perform the given test.rect
- The test rectangle. The values are in the initial coordinate system for the current ‘svg’ element.@DOMNameAttribute(name="checkEnclosure") public boolean checkEnclosure(SVGElement element, SVGRect rect)
Returns true if the rendered content of the given element is entirely contained within the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in ‘pointer-events’ processing.
element
- The element on which to perform the given test.rect
- The test rectangle. The values are in the initial coordinate system for the current ‘svg’ element.@DOMNameAttribute(name="deselectAll") public void deselectAll()
Unselects any selected objects, including any selections of text strings and type-in bars.
@DOMNameAttribute(name="createSVGNumber") public SVGNumber createSVGNumber()
Creates an SVGNumber object outside of any document trees. The object is initialized to a value of zero.
@DOMNameAttribute(name="createSVGLength") public SVGLength createSVGLength()
Creates an SVGLength object outside of any document trees. The object is initialized to the value of 0 user units.
@DOMNameAttribute(name="createSVGAngle") public SVGAngle createSVGAngle()
Creates an SVGAngle object outside of any document trees. The object is initialized to the value 0 degrees (unitless).
@DOMNameAttribute(name="createSVGPoint") public SVGPoint createSVGPoint()
Creates an SVGPoint object outside of any document trees. The object is initialized to the point (0,0) in the user coordinate system.
@DOMNameAttribute(name="createSVGMatrix") public SVGMatrix createSVGMatrix()
Creates an SVGMatrix object outside of any document trees. The object is initialized to the identity matrix.
@DOMNameAttribute(name="createSVGRect") public SVGRect createSVGRect()
Creates an SVGRect object outside of any document trees. The object is initialized such that all values are set to 0 user units.
@DOMNameAttribute(name="createSVGTransform") public SVGTransform createSVGTransform()
Creates an SVGTransform object outside of any document trees. The object is initialized to an identity matrix transform (SVG_TRANSFORM_MATRIX).
@DOMNameAttribute(name="createSVGTransformFromMatrix") public SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix)
Creates an SVGTransform object outside of any document trees. The object is initialized to the given matrix transform (i.e., SVG_TRANSFORM_MATRIX). The values from the parameter matrix are copied, the matrix parameter is not adopted as SVGTransform::matrix.
matrix
- The transform matrix.@DOMNameAttribute(name="getElementById") public Element getElementById(String elementId)
Searches this SVG document fragment (i.e., the search is restricted to a subset of the document tree) for an Element whose id is given by elementId. If an Element is found, that Element is returned. If no such element exists, returns null. Behavior is not defined if more than one element has this id.
elementId
- The unique id value for an element.public SVGAnimatedRect getViewBox()
Corresponds to attribute ‘viewBox’ on the given element.
Value: The ‘viewBox’ of the given element.getViewBox
in interface ISVGFitToViewBox
public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio()
Corresponds to attribute ‘preserveAspectRatio’ on the given element.
Value: The ‘preserveAspectRatio’ of the given element.getPreserveAspectRatio
in interface ISVGFitToViewBox
public int getZoomAndPan()
Corresponds to attribute ‘zoomAndPan’ on the given element. The value must be one of the SVG_ZOOMANDPAN_* constants defined on this interface.
getZoomAndPan
in interface ISVGZoomAndPan
DOMException
- Code DOMException.NO_MODIFICATION_ALLOWED_ERR
.
Raised on an attempt to change the value of a read only attribute.
Value:
The zoom and pan.public void setZoomAndPan(int value)
Corresponds to attribute ‘zoomAndPan’ on the given element. The value must be one of the SVG_ZOOMANDPAN_* constants defined on this interface.
setZoomAndPan
in interface ISVGZoomAndPan
DOMException
- Code DOMException.NO_MODIFICATION_ALLOWED_ERR
.
Raised on an attempt to change the value of a read only attribute.
Value:
The zoom and pan.public Event createEvent(String eventType)
Creates an Event
of a type supported by the implementation.
createEvent
in interface IDocumentEvent
eventType
- The eventType parameter specifies the type of Event
interface to be created.
Event
interface specified is supported by the implementation this method will return a new
Event
of the interface type requested.
If the Event
is to be dispatched via the EventTarget.dispatchEvent(com.aspose.html.dom.events.Event)
method the appropriate
Event.initEvent(String, boolean, boolean)
method must be called after creation in order to initialize the Event
's values.
The IDocumentEvent.createEvent(String)
method is used in creating Event
s when it is either inconvenient
or unnecessary for the user to create an Event
themselves.
In cases where the implementation provided Event
is insufficient, users may supply their own
Event
implementations for use with the EventTarget.dispatchEvent(com.aspose.html.dom.events.Event)
method.
Event
DOMException
- NOT_SUPPORTED_ERR: Raised if the implementation does not support the type of Event
interface requested