Package org.apache.flex.forks.batik.dom.svg

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


    /**
     * Initializes the given document.
     */
    protected void initializeDocument(Document document) {
        SVGOMDocument doc = (SVGOMDocument)document;
        CSSEngine eng = doc.getCSSEngine();
        if (eng == null) {
            SVGDOMImplementation impl;
            impl = (SVGDOMImplementation)doc.getImplementation();
            eng = impl.createCSSEngine(doc, this);
            eng.setCSSEngineUserAgent(new CSSEngineUserAgentWrapper(userAgent));
            doc.setCSSEngine(eng);
            eng.setMedia(userAgent.getMedia());
            String uri = userAgent.getUserStyleSheetURI();
            if (uri != null) {
                try {
                    URL url = new URL(uri);
View Full Code Here


    /**
     * Returns the CSS engine associated with given element.
     */
    public CSSEngine getCSSEngineForElement(Element e) {
        SVGOMDocument doc = (SVGOMDocument)e.getOwnerDocument();
        return doc.getCSSEngine();
    }
View Full Code Here

            Element ref = ur.getElement(uri, e);
            if (ref == null) {
                throw new BridgeException(e, ERR_URI_BAD_TARGET,
                                          new Object[] {uri});
            } else {
                SVGOMDocument refDoc = (SVGOMDocument)ref.getOwnerDocument();
                // This is new rather than attaching this BridgeContext
                // with the new document we now create a whole new
                // BridgeContext to go with the new document.
                // This means that the new document has it's own
                // world of stuff and it should avoid memory leaks
                // since the new document isn't 'tied into' this
                // bridge context.
                if (refDoc != document) {
                    CSSEngine eng = refDoc.getCSSEngine();
                    if (eng == null) {
                        BridgeContext subCtx;
                        subCtx = new BridgeContext(getUserAgent(),
                                                   getDocumentLoader());
                        subCtx.setGVTBuilder(getGVTBuilder());
View Full Code Here

                                   true);


        focusManager = new FocusManager(document);

        SVGOMDocument svgDocument = (SVGOMDocument)document;
        CSSEngine cssEngine = svgDocument.getCSSEngine();
        cssPropertiesChangedListener = new CSSPropertiesChangedListener();
        cssEngine.addCSSEngineListener(cssPropertiesChangedListener);
    }
View Full Code Here

                                          true);
            evtTarget.removeEventListener("DOMCharacterDataModified",
                                          domCharacterDataModifiedListener,
                                          true);
           
            SVGOMDocument svgDocument = (SVGOMDocument)document;
            CSSEngine cssEngine = svgDocument.getCSSEngine();
            if (cssEngine != null) {
                cssEngine.removeCSSEngineListener
                    (cssPropertiesChangedListener);
                cssEngine.dispose();
                svgDocument.setCSSEngine(null);
            }
        }
        Iterator iter = interpreterMap.values().iterator();
        while (iter.hasNext()) {
            Interpreter interpreter = (Interpreter)iter.next();
View Full Code Here

     */
    public Value getDefaultFontFamily() {
        // No cache needed since the default font family is asked only
        // one time on the root element (only if it does not have its
        // own font-family).
        SVGOMDocument      doc  = (SVGOMDocument)document;
        SVGStylableElement root = (SVGStylableElement)doc.getRootElement();
        String str = userAgent.getDefaultFontFamily();
        return doc.getCSSEngine().parsePropertyValue
            (root,SVGConstants.CSS_FONT_FAMILY_PROPERTY, str);
    }
View Full Code Here

            String uri = XLinkSupport.getXLinkHref(patternElement);
            if (uri.length() == 0) {
                return null; // no xlink:href found, exit
            }
            // check if there is circular dependencies
            SVGOMDocument doc =
                (SVGOMDocument)patternElement.getOwnerDocument();
            ParsedURL purl = new ParsedURL(doc.getURL(), uri);
            if (!purl.complete())
                throw new BridgeException(patternElement,
                                          ERR_URI_MALFORMED,
                                          new Object[] {uri});
View Full Code Here

        // else should be an altGlyphDef element
        if (refElement.getLocalName().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

            // couldn't find the referenced glyph element,
            // 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

            width = ((Float)hints.get(KEY_WIDTH)).floatValue();
        if (hints.containsKey(KEY_HEIGHT))
            height = ((Float)hints.get(KEY_HEIGHT)).floatValue();


        SVGOMDocument svgDoc = (SVGOMDocument)document;
        SVGSVGElement root = svgDoc.getRootElement();
        ctx = createBridgeContext(svgDoc);

        // build the GVT tree
        builder = new GVTBuilder();
        // flag that indicates if the document is dynamic
View Full Code Here

TOP

Related Classes of org.apache.flex.forks.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.