Examples of RootGraphicsNode


Examples of org.apache.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.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.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;
            }
            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, svgElement);
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.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.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.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.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

Examples of org.apache.batik.gvt.RootGraphicsNode

     * @param ctx the context to use
     * @param svgDocument the DOM tree that represents an SVG document
     */
    public GraphicsNode build(BridgeContext ctx, Document svgDocument){

        RootGraphicsNode root = ctx.getGVTFactory().createRootGraphicsNode();
        Element svgRoot = svgDocument.getDocumentElement();

        // Now, build corresponding canvas
        Bridge bridge = ctx.getBridge(svgRoot);
        if (bridge == null || !(bridge instanceof GraphicsNodeBridge)) {
            return root;
        }

        GraphicsNode treeRoot = null;
        GraphicsNodeBridge graphicsNodeBridge = (GraphicsNodeBridge) bridge;

        try {
            treeRoot = graphicsNodeBridge.createGraphicsNode(ctx, svgRoot);
            buildComposite(ctx,
                           (CompositeGraphicsNode)treeRoot,
                           svgRoot.getFirstChild());
            graphicsNodeBridge.buildGraphicsNode(treeRoot, ctx, svgRoot);

            // <!> TODO this should be done only if we want binding !!!!
            BridgeEventSupport.loadScripts(ctx, svgDocument);
            EventTarget target = (EventTarget) svgRoot;
            target.addEventListener("DOMAttrModified",
                                    new BridgeDOMAttrModifiedListener
                                    ((ConcreteBridgeContext)ctx),
                                    true);
            EventListener listener =
               new BridgeDOMInsertedRemovedListener((ConcreteBridgeContext)ctx);
            // Adds the Listener on Attr Modified event.
            target.addEventListener("DOMNodeInserted", listener, true);
            // Adds the Listener on Attr Modified event.
            target.addEventListener("DOMNodeRemoved", listener, true);
            BridgeEventSupport.addGVTListener(ctx, svgRoot);
            // <!> END TODO

        } catch (BuilderException ex) {
            ex.setRootGraphicsNode(root);
            throw ex;
        } finally {
            if (treeRoot != null) {
                root.getChildren().add(treeRoot);
            }
        }
        return root;
    }
View Full Code Here

Examples of org.apache.batik.gvt.RootGraphicsNode

    public void setTree(GraphicsNode newTreeRoot){
        if (!(newTreeRoot instanceof RootGraphicsNode)) {
            throw new IllegalArgumentException("not a RootGraphicsNode");
        }
        RootGraphicsNode root = (RootGraphicsNode) this.treeRoot;
        if (repaintHandler != null && root != null) {
            //root.removeGlobalPropertyChangeListener(updateListener);
            root.removeGraphicsNodePaintListener(updateListener);
        }
        root = (RootGraphicsNode) newTreeRoot;
        super.setTree(root);
        //root.addGlobalPropertyChangeListener(updateListener);
        if (repaintHandler != null) {
            root.addGraphicsNodePaintListener(updateListener);
        }
    }
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.