Examples of RootGraphicsNode


Examples of org.apache.batik.gvt.RootGraphicsNode

    /**
     * Disposes all resources of this renderer.
     */
    public void dispose() {
        if (treeRoot != null && repaintHandler != null) {
            RootGraphicsNode root = (RootGraphicsNode) this.treeRoot;
            root.removeGraphicsNodePaintListener(updateListener);
            root.removeGlobalPropertyChangeListener(updateListener);
        }
        super.dispose();
    }
View Full Code Here

Examples of org.apache.batik.gvt.RootGraphicsNode

    public GraphicsNode build(BridgeContext ctx, Document document) {
        // inform the bridge context the builder to use
        ctx.setGVTBuilder(this);

        // build the GVT tree
        RootGraphicsNode rootNode = new RootGraphicsNode();
        Element svgElement = document.getDocumentElement();
        GraphicsNode topNode = null;
        try {
            // get the appropriate bridge according to the specified element
            Bridge bridge = ctx.getBridge(svgElement);
            if (bridge == null || !(bridge instanceof GraphicsNodeBridge)) {
                return null;
            }
            // create the associated composite graphics node
            GraphicsNodeBridge gnBridge = (GraphicsNodeBridge)bridge;
            topNode = gnBridge.createGraphicsNode(ctx, svgElement);
            if (topNode == null) {
                return null;
            }
            buildComposite(ctx, svgElement, (CompositeGraphicsNode)topNode);
            gnBridge.buildGraphicsNode(ctx, svgElement, topNode);
        } catch (BridgeException ex) {
            // update the exception with the missing parameters
            ex.setGraphicsNode(rootNode);
            Element errElement = ex.getElement();
            ex.setLineNumber(ctx.getDocumentLoader().getLineNumber(errElement));
            ex.printStackTrace();
            throw ex; // re-throw the udpated exception
        } finally {
            if (topNode != null) {
                rootNode.getChildren().add(topNode);
            }
        }
        // <!> FIXME: TO BE REMOVED
        if (ctx.isDynamic()) {
            BridgeEventSupport.loadScripts(ctx, document);
View Full Code Here

Examples of org.apache.flex.forks.batik.gvt.RootGraphicsNode

                public void run() {
                    synchronized (UpdateManager.this) {
                        running = true;
       
                        updateTracker = new UpdateTracker();
                        RootGraphicsNode root = graphicsNode.getRoot();
                        if (root != null){
                            root.addTreeGraphicsNodeChangeListener
                                (updateTracker);
                        }

                        repaintManager = new RepaintManager(r);
View Full Code Here

Examples of org.apache.flex.forks.batik.gvt.RootGraphicsNode

        // inform the bridge context the builder to use
        ctx.setGVTBuilder(this);

        // build the GVT tree
        RootGraphicsNode rootNode = new RootGraphicsNode();
        Element svgElement = document.getDocumentElement();
        GraphicsNode topNode = null;
        try {
            // get the appropriate bridge according to the specified element
            Bridge bridge = ctx.getBridge(svgElement);
            if (bridge == null || !(bridge instanceof GraphicsNodeBridge)) {
                return null;
            }
            // create the associated composite graphics node
            GraphicsNodeBridge gnBridge = (GraphicsNodeBridge)bridge;
            topNode = gnBridge.createGraphicsNode(ctx, svgElement);
            if (topNode == null) {
                return null;
            }
            rootNode.getChildren().add(topNode);

            buildComposite(ctx, svgElement, (CompositeGraphicsNode)topNode);
            gnBridge.buildGraphicsNode(ctx, svgElement, topNode);
        } catch (BridgeException ex) {
            // update the exception with the missing parameters
View Full Code Here

Examples of org.apache.flex.forks.batik.gvt.RootGraphicsNode

                             GraphicsNode paintedNode,
                             float opacity) {


        // extract pattern content
        RootGraphicsNode patternContentNode;
        patternContentNode = (RootGraphicsNode)
            ctx.getElementData(patternElement);

        if (patternContentNode == null) {
            patternContentNode = extractPatternContent(patternElement, ctx);
View Full Code Here

Examples of org.apache.flex.forks.batik.gvt.RootGraphicsNode

        RootGraphicsNode extractPatternContent(Element patternElement,
                                                    BridgeContext ctx) {

        List refs = new LinkedList();
        for (;;) {
            RootGraphicsNode content
                = extractLocalPatternContent(patternElement, ctx);
            if (content != null) {
                return content; // pattern content found, exit
            }
            String uri = XLinkSupport.getXLinkHref(patternElement);
View Full Code Here

Examples of org.apache.flex.forks.batik.gvt.RootGraphicsNode

    protected static
        RootGraphicsNode extractLocalPatternContent(Element e,
                                                         BridgeContext ctx) {

        GVTBuilder builder = ctx.getGVTBuilder();
        RootGraphicsNode content = null;
        for (Node n = e.getFirstChild(); n != null; n = n.getNextSibling()) {
            // check if the Node is valid
            if (n.getNodeType() != Node.ELEMENT_NODE) {
                continue;
            }

            GraphicsNode gn = builder.build(ctx, (Element)n);
            // check if a GraphicsNode has been created
            if (gn != null) {
                // lazy instantation of the grouping element.
                if (content == null) {
                    content = new RootGraphicsNode();
                }
                content.getChildren().add(gn);
            }
        }
        return content;
    }
View Full Code Here

Examples of org.apache.flex.forks.batik.gvt.RootGraphicsNode

        // inform the bridge context the builder to use
        ctx.setGVTBuilder(this);

        // build the GVT tree
        DocumentBridge dBridge = ctx.getDocumentBridge();
        RootGraphicsNode rootNode = null;
        try {
            // create the root node
            rootNode = dBridge.createGraphicsNode(ctx, document);
            Element svgElement = document.getDocumentElement();
            GraphicsNode topNode = null;

            // get the appropriate bridge according to the specified element
            Bridge bridge = ctx.getBridge(svgElement);
            if (bridge == null || !(bridge instanceof GraphicsNodeBridge)) {
                return null;
            }
            // create the associated composite graphics node
            GraphicsNodeBridge gnBridge = (GraphicsNodeBridge)bridge;
            topNode = gnBridge.createGraphicsNode(ctx, svgElement);
            if (topNode == null) {
                return null;
            }
            rootNode.getChildren().add(topNode);

            buildComposite(ctx, svgElement, (CompositeGraphicsNode)topNode);
            gnBridge.buildGraphicsNode(ctx, svgElement, topNode);

            // finally, build the root node
View Full Code Here

Examples of org.apache.flex.forks.batik.gvt.RootGraphicsNode

                public void run() {
                    synchronized (UpdateManager.this) {
                        running = true;

                        updateTracker = new UpdateTracker();
                        RootGraphicsNode root = graphicsNode.getRoot();
                        if (root != null){
                            root.addTreeGraphicsNodeChangeListener
                                (updateTracker);
                        }

                        repaintManager = new RepaintManager(r);
View Full Code Here

Examples of org.apache.flex.forks.batik.gvt.RootGraphicsNode

     * @param doc the document node that describes the graphics node to build
     * @return a graphics node that represents the specified document node
     */
    public RootGraphicsNode createGraphicsNode(BridgeContext ctx,
                                               Document doc) {
        RootGraphicsNode gn = new RootGraphicsNode();
        this.document = doc;
        this.node = gn;
        this.ctx = ctx;
        ((SVGOMDocument) doc).setSVGContext(this);
        return gn;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.