Package org.apache.batik.dom.svg

Examples of org.apache.batik.dom.svg.SVGOMDocument


                            // get the referenced element
                            String uri = XLinkSupport.getXLinkHref(fontFaceUriElement);
                            Element refElement = ctx.getReferencedElement(fontFaceUriElement, uri);
                            // make sure its a font element
                            if (refElement.getTagName().equals(SVG_FONT_TAG)) {
                                SVGOMDocument document
                                    = (SVGOMDocument)fontFaceUriElement.getOwnerDocument();
                                SVGOMDocument refDocument
                                    = (SVGOMDocument)refElement.getOwnerDocument();
                                boolean isLocal = (refDocument == document);
                                // import or clone the referenced element in current document
                                fontElement = (isLocal) ? refElement
                                    : (Element)document.importNode(refElement, true);
View Full Code Here


                            button = new JRadioButtonMenuItem(title);

                            button.addActionListener
                                (new java.awt.event.ActionListener() {
                                    public void actionPerformed(ActionEvent e) {
                                        SVGOMDocument doc;
                                        doc = (SVGOMDocument)svgCanvas.getSVGDocument();
                                        doc.enableAlternateStyleSheet(title);
                                        doc.clearViewCSS();
                                        svgCanvas.setSVGDocument(doc);
                                    }
                                });

                            buttonGroup.add(button);
View Full Code Here

                    }

                    if (st != null) {
                        if (svgDocument != null) {
                            try {
                                SVGOMDocument doc = (SVGOMDocument)svgDocument;
                                URL docURL = doc.getURLObject();
                                URL url = new URL(docURL, st);
                                String fi = svgCanvas.getFragmentIdentifier();
                                fi = (fi == null) ? "" : fi;
                                if (docURL.equals(url) && t.equals(fi)) {
                                    return;
View Full Code Here

     */
    public void linkActivated(LinkActivationEvent e) {
        String s = e.getReferencedURI();
        if (svgDocument != null) {
            try {
                SVGOMDocument doc = (SVGOMDocument)svgDocument;
                URL docURL = doc.getURLObject();
                URL url = new URL(docURL, s);
                if (!url.sameFile(docURL)) {
                    return;
                }
            } catch (MalformedURLException ex) {
View Full Code Here

                        }
                    }
                    if (s != null) {
                        if (svgDocument != null) {
                            try {
                                SVGOMDocument doc = (SVGOMDocument)svgDocument;
                                URL docURL = doc.getURLObject();
                                URL url = new URL(docURL, s);
                                String fi = svgCanvas.getFragmentIdentifier();
                                if (docURL.equals(url) && t.equals(fi)) {
                                    return;
                                }
View Full Code Here

        }
        localRefElement.setAttributeNS(XML_NAMESPACE_URI,
                                       "xml:base",
                                       uri);

        SVGOMDocument document
            = (SVGOMDocument)localRefElement.getOwnerDocument();
        AbstractViewCSS view = (AbstractViewCSS)document.getDefaultView();


        SVGOMDocument refDocument
            = (SVGOMDocument)refElement.getOwnerDocument();
        AbstractViewCSS refView = (AbstractViewCSS)refDocument.getDefaultView();
       
        HiddenChildElementSupport.setStyle(localRefElement,
                                           view,
                                           refElement,
                                           refView);
View Full Code Here

        if (uri.length() == 0)
            throw new BridgeException(e, ERR_URI_MALFORMED,
                                      new Object[] {uri});
           
        Element refElement = ctx.getReferencedElement(e, uri);
        SVGOMDocument document
            = (SVGOMDocument)e.getOwnerDocument();
        SVGOMDocument refDocument
            = (SVGOMDocument)refElement.getOwnerDocument();
        boolean isLocal = (refDocument == document);
        // import or clone the referenced element in current document
        Element localRefElement = (isLocal)
            ? (Element)refElement.cloneNode(true)
View Full Code Here

        // else should be an altGlyphDef element
        if (refElement.getTagName().equals(SVG_ALT_GLYPH_DEF_TAG)) {

            // if not local import the referenced altGlyphDef
            // into the current document
            SVGOMDocument document
                = (SVGOMDocument)altGlyphElement.getOwnerDocument();
            SVGOMDocument refDocument
                = (SVGOMDocument)refElement.getOwnerDocument();
            boolean isLocal = (refDocument == document);

            Element localRefElement = (isLocal) ? refElement
                                 : (Element)document.importNode(refElement, true);
View Full Code Here

            // or referenced element not a glyph
            return null;
        }

        // see if the referenced glyph element is local
        SVGOMDocument document
            = (SVGOMDocument)altGlyphElement.getOwnerDocument();
        SVGOMDocument refDocument
            = (SVGOMDocument)refGlyphElement.getOwnerDocument();
        boolean isLocal = (refDocument == document);

        // if not local, import both the glyph and its font-face element
        Element localGlyphElement = null;
View Full Code Here

                    URL oldURI = ((SVGOMDocument)svgDocument).getURLObject();
                    URL newURI = null;
                    try {
      // if the anchor element is in an external resource
      if (elt.getOwnerDocument() != svgDocument) {
          SVGOMDocument doc =
        (SVGOMDocument)elt.getOwnerDocument();
          href = new URL(doc.getURLObject(), href).toString();
      }
                        newURI = new URL(oldURI, href);
                    } catch (MalformedURLException e) {
                        userAgent.displayError(e);
                        return;
                    }

                    href = newURI.toString();
                    svgUserAgent.openLink(href, true);
                } else {
                    JSVGComponent.this.loadSVGDocument(href);
                }
                return;
            }

            // Avoid reloading if possible.
            if (svgDocument != null) {
                URL oldURI = ((SVGOMDocument)svgDocument).getURLObject();
                URL newURI = null;
                try {
        // if the anchor element is in an external resource
        if (elt.getOwnerDocument() != svgDocument) {
      SVGOMDocument doc =
          (SVGOMDocument)elt.getOwnerDocument();
      href = new URL(doc.getURLObject(), href).toString();
        }
                    newURI = new URL(oldURI, href);
                } catch (MalformedURLException e) {
                    userAgent.displayError(e);
                    return;
View Full Code Here

TOP

Related Classes of org.apache.batik.dom.svg.SVGOMDocument

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.