Hello thomas, hello all:
         First, I want to ask what is difference between the GVTtree and the GraphicsNode. If the GVTtree is changed, whether the GraphicsNode is changed too?  more details more better. thanks a lot.
         For my project, I do not use the JSVGCanvas, the event is come from Canvas3D. I use the AWTEventDispatcher, the instance named "ad".  I use the normal way that    
        ad.setRootNode(gvtRoot);
        ad.setBaseTransform(curTxf);     //curTxf is the AffineTransform
         And then from the Frame I could call the MouseEvent of like this:

     public void mouseEvent1(final MouseEvent evt){        //transport the parameter of evt to this method       
        final Element rect = r;       // the element r has been initialized
        RunnableQueue rq = manager.getUpdateRunnableQueue();     // add the event to RunableQueue
          try {   rq.invokeAndWait(new Runnable() {
                        public void run() {
                            ad.mouseClicked(evt);               // set mouse event to change the GTV tree
                           rect.setAttributeNS(null, "x", ""+5);        // setAttribute of the document
                       };
                    });
            } catch (InterruptedException ie) {
                ie.printStackTrace();
            }
           if(manager.getUpdateTracker().hasChanged())      // test whether the GVTtree has been changed
            System.out.println("GTV changed");    }

       But unfortunately, I could find the GVTtree has been changed only by the Attribute changed. If I removed the line of attribute, it seems that the GTVTree will not been changed.  I want to know whether this is a right way that just only setRootNode() and then call the mouseCliked(). Or I should add some code. For the RunableQueue, I think this way is right, because if I removed it, I can not see the result of the Attribute changed.

       What should I do to change the GVTtree by one mouseclick?

       Thanks a lot

        Regards

         zhao

Reply via email to