Package org.apache.batik.bridge

Examples of org.apache.batik.bridge.IllegalAttributeValueException


             Element clipPathElement = null;
             try {
                 clipPathElement = ur.getElement(uriString);
             } catch (Exception ex) {
                 throw new IllegalAttributeValueException(
                     Messages.formatMessage("bad.uri",
                                            new Object[] {uriString}));
             }
             // Now use the bridge to create the Clip
             Bridge bridge = ctx.getBridge(clipPathElement);
             if (bridge == null || !(bridge instanceof ClipBridge)) {
                 throw new IllegalAttributeValueException(
                     Messages.formatMessage("clipPath.reference.illegal",
                                new Object[] {clipPathElement.getLocalName()}));
             }
             ClipBridge clipBridge = (ClipBridge)bridge;
             SVGOMDocument doc =
View Full Code Here


             Element maskElement = null;
             try {
                 maskElement = ur.getElement(uriString);
             } catch (Exception ex) {
                 throw new IllegalAttributeValueException(
                     Messages.formatMessage("bad.uri",
                                            new Object[] {uriString}));
             }
             // Now use the bridge to create the Mask
             Bridge bridge = ctx.getBridge(maskElement);
             if (bridge == null || !(bridge instanceof MaskBridge)) {
                 throw new IllegalAttributeValueException(
                     Messages.formatMessage("mask.reference.illegal",
                                    new Object[] {maskElement.getLocalName()}));
             }
             MaskBridge maskBridge = (MaskBridge)bridge;
             SVGOMDocument doc = (SVGOMDocument)maskElement.getOwnerDocument();
View Full Code Here

        Element paintElement = null;
        try {
            paintElement = ur.getElement(uri);
        } catch (Exception ex) {
            throw new IllegalAttributeValueException(
                Messages.formatMessage("bad.uri",
                                       new Object[] {uri}));
        }

        Bridge bridge = ctx.getBridge(paintElement);
        if (bridge == null || !(bridge instanceof PaintBridge)) {
            throw new IllegalAttributeValueException(
                    Messages.formatMessage("paint.reference.illegal",
                                   new Object[] {paintElement.getLocalName()}));

        }
        PaintBridge paintBridge = (PaintBridge)bridge;
View Full Code Here

            Element filterElement = null;
            try {
                filterElement = ur.getElement(uriString);
            } catch (Exception ex) {
                throw new IllegalAttributeValueException(
                    Messages.formatMessage("bad.uri",
                                           new Object[] {uriString}));
            }
            Bridge bridge = ctx.getBridge(filterElement);
            if (bridge == null || !(bridge instanceof FilterBridge)) {
                 throw new IllegalAttributeValueException(
                     Messages.formatMessage("filter.reference.illegal",
                                  new Object[] {filterElement.getLocalName()}));
            }
            FilterBridge filterBridge = (FilterBridge)bridge;
            SVGOMDocument doc = (SVGOMDocument)filterElement.getOwnerDocument();
View Full Code Here

            r = SVGUtilities.svgToUserSpace(svgElement,
                                            ATTR_R, s,
                                            uctx,
                                            UnitProcessor.OTHER_LENGTH);
            if (r < 0) {
                throw new IllegalAttributeValueException(
                    Messages.formatMessage("circle.r.negative", null));
            }
        }

        float x = cx - r;
View Full Code Here

        int unitsType;
        try {
            unitsType = SVGUtilities.parseCoordinateSystem(units);
        } catch (IllegalArgumentException ex) {
            throw new IllegalAttributeValueException(
                Messages.formatMessage("linearGradient.units.invalid",
                                       new Object[] {units,
                                                     ATTR_GRADIENT_UNITS}));
        }
        SVGElement svgPaintedElement = (SVGElement) paintedElement;
View Full Code Here

        } else if (VALUE_XOR.equals(ruleStr)) {
            rule = CompositeRule.XOR;

        } else {
            throw new IllegalAttributeValueException(
                Messages.formatMessage("feComposite.operator.invalid",
                                       new Object[] { ruleStr }));
        }
        return rule;
    }
View Full Code Here

            rx = SVGUtilities.svgToUserSpace(svgElement,
                                             ATTR_RX, s,
                                             uctx,
                                             UnitProcessor.HORIZONTAL_LENGTH);
            if (rx < 0) {
                throw new IllegalAttributeValueException(
                    Messages.formatMessage("ellipse.rx.negative", null));
            }
        }

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

        float x = cx - rx;
View Full Code Here

            URL baseURL = ((SVGOMDocument)svgDoc).getURLObject();
            URL url = null;
            try {
                url = new URL(baseURL, uriStr);
            } catch (MalformedURLException mue) {
                throw new IllegalAttributeValueException(
                    Messages.formatMessage("feImage.xlinkHref.badURL", null));
            }

            try {

                URIResolver ur =
                    new URIResolver(svgDoc, bridgeContext.getDocumentLoader());

                Node refNode = ur.getNode(url.toString());
                if (refNode == null) {
                    throw new IllegalAttributeValueException(
                        Messages.formatMessage("feImage.xlinkHref.badURL",
                                               null));
                }

                Element refElement;
                if (refNode.getNodeType() == refNode.DOCUMENT_NODE) {
                    refElement = ((SVGDocument)refNode).getRootElement();
                } else {
                    refElement = (Element)refNode;
                }

                // Cannot access referenced file...
                if(refElement == null){
                    throw new IllegalAttributeValueException(
                        Messages.formatMessage("feImage.xlinkHref.badURL",
                                               null));
                }

                GraphicsNode gn =
View Full Code Here

        ph.setWindingRule(wr);
        p.setPointsHandler(ph);
        try {
            p.parse(new StringReader(pts));
        } catch (ParseException ex) {
            throw new IllegalAttributeValueException(
                Messages.formatMessage("polyline.points.invalid",
                                       new Object[] {ex.getMessage()}),
                node);
        } finally {
            node.setShape(ph.getShape());
View Full Code Here

TOP

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

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.