xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: How to get the element form SVG file.
Date Tue, 04 Apr 2006 00:04:43 GMT
Hi Zhao,

"comlong zhao" <comlong@gmail.com> wrote on 04/03/2006 07:42:48 PM:

>       Thanks a lot for your help, and coached by your word, the 
animaiton has 
> been added on the java3D object.  But, i could only use the animation 
> controled by the javascript, if you use some animation which is 
controled by 
> the tag named <animateTransform>, it does not work. Also for your code, 
it 
> could not generate the different .png files.  What is this problem, 
shold i 
> add some new functions? 

   Batik does not support SMIL animation at the moment.  Cameron has 
started
to add some support in the animation branch, also you might look at Doug
Schepters SMIL Script, which is part of SMIL animation written in 
JavaScript.

>       And next step for me is to add the interaction. I want to know how 
 i 
> could tell the svg file that i have pressed one button,and then i could 
get 
> the result (bufferedimages), so i need to rewrite the javascript to 
java? 

   Generally you just need to make the sure the DOM Event listener 
get's called.  This is done by dispatching the event to the GVT tree.
The code Batik uses for this is in batik.gvt.event.AWTEventDispatcher.
Once the event is dispatched it will normally modify the document which 
will
cause the update manager to run and hence the BufferedImage to be updated.
You must dispatch the event to the GVT tree in the UpdateManager's 
RunnableQueue or else it won't notice the changes.

>      please give me some suggestion, i will follow your help to do.
>      Thank you very much
>      zhao long
> 
> 
> On 3/23/06, thomas.deweese@kodak.com <thomas.deweese@kodak.com > wrote: 
> Hi Zhao,
> 
> "comlong zhao" <comlong@gmail.com> wrote on 03/22/2006 12:16:45 PM: 
> 
> >      Thanks for your words, it works well now. And for the SVG 
animation
> of
> > "3D.svg", i could only get 4 or 5 .png files.
> 
>    Why are you still generating PNG files?  You should delete to code 
> that
> saves PNG and just use BufferedImage.
> 
> > If i change the display size, i could get more .png files. They are 
from
> the
> > bufferedimage that is just what i need. But i want to know why they 
have 
> limited
> > numbers. I want to get a lot of bufferedimages, not stopping as the
> animation.
> > what should i do? please give me a idea.
> 
>   I suspect you want to remove this code from the end of main:
> 
>         for (int i=1; i<10; i++) {
>            final int x = 100+ (i*10);
>            try {
>                rq.invokeAndWait(new Runnable() {
>                        public void run() {
>                            rect.setAttributeNS(null, "x", ""+x);
>                        }
>                    });
>            } catch (InterruptedException ie) {
>                ie.printStackTrace();
>            }
>        }
>        render.manager.suspend();
> 
>   In particular the last line stops the updatemanager so no more
> updates will be delivered.  If you just delete all of this code you
> should get an endless supply of calls to the 'render' method... 
> 
> 
> >    Thank you very much.
> >    zhao long
> 
> > On 3/22/06, Tonny Kohar <tonny@kiyut.com> wrote:
> > Hi,
> >
> > On Wed, 2006-03-22 at 06:26 +0100, comlong zhao wrote: 
> > > Hello thomas:
> > >     In your code, you have already used the toString way.
> > >             File f = new File("anne.svg");
> > >             doc = df.createSVGDocument(f.toURL ().toString());
> > >    I use the annd.svg directly here.  When i run your code,  it also
> > > shows the error of
> > >   An I/O error occured while processing the URI:
> > >  "batikLogo.svg#Batik_Tag_Box "
> > >  specified on the element <use>
> > >         if i delete the element of use in anne.svg , it works well. 
Is
> > > it strange or i should not input the file name directly.
> > >      Thank you very much 
> > >      zhao long
> > >
> >
> > anne.svg in batik sample directory contains reference to batikLogo.svg
> > in the same directory. So if you move anne.svg out from the sample
> > directory, you also need to copy / move batikLogo.svg as well. If not
> > the reference will be broken
> >
> > Regards
> > Tonny Kohar
> > --
> > Sketsa
> > SVG Graphics Editor
> > http://www.kiyut.com 
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org 

> > For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message