org.vectomatic.dom.svg.itf
Interface ISVGLocatable

All Known Subinterfaces:
ISVGTransformable
All Known Implementing Classes:
OMSVGAElement, OMSVGCircleElement, OMSVGClipPathElement, OMSVGDefsElement, OMSVGEllipseElement, OMSVGForeignObjectElement, OMSVGGElement, OMSVGImageElement, OMSVGLineElement, OMSVGPathElement, OMSVGPolygonElement, OMSVGPolylineElement, OMSVGRectElement, OMSVGSVGElement, OMSVGSwitchElement, OMSVGTextElement, OMSVGUseElement

public interface ISVGLocatable

Interface ISVGLocatable is for all elements which either have a transform attribute or don't have a transform attribute but whose content can have a bounding box in current user space.


Method Summary
 OMSVGRect getBBox()
          Returns the tight bounding box in current user space (i.e., after application of the transform attribute, if any) on the geometry of all contained graphics elements, exclusive of stroking, clipping, masking and filter effects).
 OMSVGMatrix getCTM()
          Returns the transformation matrix from current user units (i.e., after application of the transform attribute, if any) to the viewport coordinate system for the getNearestViewportElement().
 OMSVGElement getFarthestViewportElement()
          The farthest ancestor svg element.
 OMSVGElement getNearestViewportElement()
          The element which established the current viewport.
 OMSVGMatrix getScreenCTM()
          Returns the transformation matrix from current user units (i.e., after application of the transform attribute, if any) to the parent user agent's notice of a "pixel".
 OMSVGMatrix getTransformToElement(OMSVGElement element)
          Returns the transformation matrix from the user coordinate system on the current element (after application of the transform attribute, if any) to the user coordinate system on parameter element (after application of its transform attribute, if any).
 

Method Detail

getNearestViewportElement

OMSVGElement getNearestViewportElement()
The element which established the current viewport. Often, the nearest ancestor svg element. Null if the current element is the outermost svg element.


getFarthestViewportElement

OMSVGElement getFarthestViewportElement()
The farthest ancestor svg element. Null if the current element is the outermost svg element.


getBBox

OMSVGRect getBBox()
Returns the tight bounding box in current user space (i.e., after application of the transform attribute, if any) on the geometry of all contained graphics elements, exclusive of stroking, clipping, masking and filter effects). Note that getBBox must return the actual bounding box at the time the method was called, even in case the element has not yet been rendered.

Returns:
An OMSVGRect object that defines the bounding box.

getCTM

OMSVGMatrix getCTM()
Returns the transformation matrix from current user units (i.e., after application of the transform attribute, if any) to the viewport coordinate system for the getNearestViewportElement().

Returns:
An OMSVGMatrix object that defines the CTM.

getScreenCTM

OMSVGMatrix getScreenCTM()
Returns the transformation matrix from current user units (i.e., after application of the transform attribute, if any) to the parent user agent's notice of a "pixel". For display devices, ideally this represents a physical screen pixel. For other devices or environments where physical pixel sizes are not known, then an algorithm similar to the CSS2 definition of a "pixel" can be used instead. Note that null is returned if this element is not hooked into the document tree. This method would have been more aptly named as getClientCTM, but the name getScreenCTM is kept for historical reasons.

Returns:
An OMSVGMatrix object that defines the given transformation matrix.

getTransformToElement

OMSVGMatrix getTransformToElement(OMSVGElement element)
                                  throws com.google.gwt.core.client.JavaScriptException
Returns the transformation matrix from the user coordinate system on the current element (after application of the transform attribute, if any) to the user coordinate system on parameter element (after application of its transform attribute, if any).

Parameters:
element - The target element.
Returns:
An OMSVGMatrix object that defines the transformation.
Throws:
SVGException(SVG_MATRIX_NOT_INVERTABLE) - Raised if the currently defined transformation matrices make it impossible to compute the given matrix (e.g., because one of the transformations is singular).
com.google.gwt.core.client.JavaScriptException


Copyright © 2012. All Rights Reserved.