Package org.w3c.dom.svg

Examples of org.w3c.dom.svg.SVGImageElement


     *  pointed by the reference
     */
    protected GraphicsNode buildImageGraphicsNode
        (BridgeContext ctx, Element e){

        SVGImageElement ie = (SVGImageElement) e;

        // 'xlink:href' attribute - required
        String uriStr = ie.getHref().getAnimVal();
        if (uriStr.length() == 0) {
            throw new BridgeException(ctx, e, ERR_ATTRIBUTE_MISSING,
                                      new Object[] {"xlink:href"});
        }
        if (uriStr.indexOf('#') != -1) {
View Full Code Here


                        || ln.equals(SVG_Y_ATTRIBUTE)) {
                    updateImageBounds();
                    return;
                } else if (ln.equals(SVG_WIDTH_ATTRIBUTE)
                        || ln.equals(SVG_HEIGHT_ATTRIBUTE)) {
                    SVGImageElement ie = (SVGImageElement) e;
                    ImageNode imageNode = (ImageNode) node;
                    float val;
                    if (ln.charAt(0) == 'w') {
                        val = ie.getWidth().getAnimVal().getValue();
                    } else {
                        val = ie.getHeight().getAnimVal().getValue();
                    }
                    if (val == 0 || imageNode.getImage() instanceof ShapeNode) {
                        rebuildImageNode();
                    } else {
                        updateImageBounds();
View Full Code Here

        ImageNode imgNode = (ImageNode)node;
        imgNode.setImage(inode);

        if (inode == null) {
            SVGImageElement ie = (SVGImageElement) e;
            String uriStr = ie.getHref().getAnimVal();
            throw new BridgeException(ctx, e, ERR_URI_IMAGE_INVALID,
                                      new Object[] {uriStr});
        }
    }
View Full Code Here

        float y = (float)bounds.getY();
        float w = (float)bounds.getWidth();
        float h = (float)bounds.getHeight();

        try {
            SVGImageElement ie = (SVGImageElement) e;
            SVGAnimatedPreserveAspectRatio aPAR = ie.getPreserveAspectRatio();

            AffineTransform at = ViewBox.getPreserveAspectRatioTransform
                (e, vb, w, h, aPAR, ctx);
            at.preConcatenate(AffineTransform.getTranslateInstance(x, y));
            node.setTransform(at);
View Full Code Here

     * @param element the image element
     */
    protected static Rectangle2D getImageBounds(BridgeContext ctx,
                                                Element element) {
        try {
            SVGImageElement ie = (SVGImageElement) element;

            // 'x' attribute - default is 0
            float x = ie.getX().getAnimVal().getValue();

            // 'y' attribute - default is 0
            float y = ie.getY().getAnimVal().getValue();

            // 'width' attribute - required
            float w = ie.getWidth().getAnimVal().getValue();

            // 'height' attribute - required
            float h = ie.getHeight().getAnimVal().getValue();

            return new Rectangle2D.Float(x, y, w, h);
        } catch (LiveAttributeException ex) {
            throw new BridgeException(ctx, ex);
        }
View Full Code Here

        hitCheckChildren = false;
        GraphicsNode node = buildImageGraphicsNode(ctx,e);

        if (node == null) {
            SVGImageElement ie = (SVGImageElement) e;
            String uriStr = ie.getHref().getAnimVal();
            throw new BridgeException(ctx, e, ERR_URI_IMAGE_INVALID,
                                      new Object[] {uriStr});
        }

        imageNode.setImage(node);
View Full Code Here

     *  pointed by the reference
     */
    protected GraphicsNode buildImageGraphicsNode
        (BridgeContext ctx, Element e){

        SVGImageElement ie = (SVGImageElement) e;

        // 'xlink:href' attribute - required
        String uriStr = ie.getHref().getAnimVal();
        if (uriStr.length() == 0) {
            throw new BridgeException(ctx, e, ERR_ATTRIBUTE_MISSING,
                                      new Object[] {"xlink:href"});
        }
        if (uriStr.indexOf('#') != -1) {
View Full Code Here

                        || ln.equals(SVG_Y_ATTRIBUTE)) {
                    updateImageBounds();
                    return;
                } else if (ln.equals(SVG_WIDTH_ATTRIBUTE)
                        || ln.equals(SVG_HEIGHT_ATTRIBUTE)) {
                    SVGImageElement ie = (SVGImageElement) e;
                    ImageNode imageNode = (ImageNode) node;
                    AbstractSVGAnimatedLength _attr;
                    if (ln.charAt(0) == 'w') {
                        _attr = (AbstractSVGAnimatedLength) ie.getWidth();
                    } else {
                        _attr = (AbstractSVGAnimatedLength) ie.getHeight();
                    }
                    float val = _attr.getCheckedValue();
                    if (val == 0 || imageNode.getImage() instanceof ShapeNode) {
                        rebuildImageNode();
                    } else {
View Full Code Here

        ImageNode imgNode = (ImageNode)node;
        imgNode.setImage(inode);

        if (inode == null) {
            SVGImageElement ie = (SVGImageElement) e;
            String uriStr = ie.getHref().getAnimVal();
            throw new BridgeException(ctx, e, ERR_URI_IMAGE_INVALID,
                                      new Object[] {uriStr});
        }
    }
View Full Code Here

        float y = (float)bounds.getY();
        float w = (float)bounds.getWidth();
        float h = (float)bounds.getHeight();

        try {
            SVGImageElement ie = (SVGImageElement) e;
            SVGOMAnimatedPreserveAspectRatio _par =
                (SVGOMAnimatedPreserveAspectRatio) ie.getPreserveAspectRatio();
            _par.check();

            AffineTransform at = ViewBox.getPreserveAspectRatioTransform
                (e, vb, w, h, _par, ctx);
            at.preConcatenate(AffineTransform.getTranslateInstance(x, y));
View Full Code Here

TOP

Related Classes of org.w3c.dom.svg.SVGImageElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.