Package org.apache.batik.bridge

Examples of org.apache.batik.bridge.MissingAttributeException


            = ctx.getViewCSS().getComputedStyle(element, null);

        String uriStr = XLinkSupport.getXLinkHref(svgElement);
        // nothing referenced.
        if (uriStr.length() == 0) {
            throw new MissingAttributeException(
                Messages.formatMessage("image.xlinkHref.required", null));
        }
        // bad URL type
        if (uriStr.indexOf('#') != -1) {
            throw new IllegalAttributeValueException(
View Full Code Here


        // parse the width attribute, (required and must be positive)
        s = svgElement.getAttributeNS(null, ATTR_WIDTH);
        float w;
        if (s.length() == 0) {
            throw new MissingAttributeException(
                Messages.formatMessage("image.width.required", null));
        } else {
            w = SVGUtilities.svgToUserSpace(svgElement,
                                            ATTR_WIDTH, s,
                                            uctx,
                                            UnitProcessor.HORIZONTAL_LENGTH);
            if (w < 0) {
                throw new IllegalAttributeValueException(
                    Messages.formatMessage("image.width.negative", null));
            }
        }

        // parse the height attribute, (required and must be positive)
        s = svgElement.getAttributeNS(null, ATTR_HEIGHT);
        float h;
        if (s.length() == 0) {
            throw new MissingAttributeException(
                Messages.formatMessage("image.height.required", null));
        } else {
            h = SVGUtilities.svgToUserSpace(svgElement,
                                            ATTR_HEIGHT, s,
                                            uctx,
View Full Code Here

        Filter in2 = null;

        // Get source 2
        String in2Attr = filterElement.getAttributeNS(null, ATTR_IN2);
        if (in2Attr.length() == 0) {
            throw new MissingAttributeException(
                Messages.formatMessage("feDisplacementMap.in2.required", null));
        }
        in2 = CSSUtilities.getFilterSource(filteredNode,
                                           in2Attr,
                                           bridgeContext,
View Full Code Here

        // parse the x attribute
        String xStr = filterElement.getAttributeNS(null, ATTR_X);
        if (xStr.length() == 0) {
            if (xDefault == null) {
                throw new MissingAttributeException(
                    Messages.formatMessage("region.x.required",
                        new Object[] {filterElement.getLocalName()}));
            } else {
                xStr = xDefault;
            }
        }
        // parse the y attribute
        String yStr = filterElement.getAttributeNS(null, ATTR_Y);
        if (yStr.length() == 0) {
            if (yDefault == null) {
                throw new MissingAttributeException(
                    Messages.formatMessage("region.y.required",
                        new Object[] {filterElement.getLocalName()}));
            } else {
                yStr = yDefault;
            }
        }
        // parse the width attribute
        String wStr = filterElement.getAttributeNS(null, ATTR_WIDTH);
        if (wStr.length() == 0) {
            if (wDefault == null) {
                throw new MissingAttributeException(
                    Messages.formatMessage("region.width.required",
                        new Object[] {filterElement.getLocalName()}));
            } else {
                wStr = wDefault;
            }
        }
        // parse the height attribute
        String hStr = filterElement.getAttributeNS(null, ATTR_HEIGHT);
        if (hStr.length() == 0) {
            if (hDefault == null) {
                throw new MissingAttributeException(
                    Messages.formatMessage("region.height.required",
                        new Object[] {filterElement.getLocalName()}));
            } else {
                hStr = hDefault;
            }
View Full Code Here

TOP

Related Classes of org.apache.batik.bridge.MissingAttributeException

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.