<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>batik-users@xmlgraphics.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/"/>
<id>http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/</id>
<updated>2009-12-08T04:30:30Z</updated>
<entry>
<title>RE: Rendering the clipped area on an SVG to a Graphics2d object</title>
<author><name>&quot;Ryan Breidenbach&quot; &lt;rsbreidenbach@containerstore.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c972870457212F24A9C437AD491B72DF906E4A66E@DFWCOMAS2.containerstore.com%3e"/>
<id>urn:uuid:%3c972870457212F24A9C437AD491B72DF906E4A66E@DFWCOMAS2-containerstore-com%3e</id>
<updated>2009-12-07T23:16:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
That did the trick. Thanks a ton for the help.

 

From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Sent: Sunday, December 06, 2009 6:57 AM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Rendering the clipped area on an SVG to a Graphics2d object

 

Hi Ryan, 

"Ryan Breidenbach" &lt;rsbreidenbach@containerstore.com&gt; wrote on
12/04/2009 01:19:27 PM:

&gt; I have an SVG image loaded as a GraphicsNode object. This SVG image 
&gt; has a clip area that I want to render. So far, this is how I am doing
it: 
&gt;   
&gt;         // find the bounds of the clip area 
&gt;         int width =
graphicsNode.getPrimitiveBounds().getBounds().width + 2; 
&gt;         int height =
graphicsNode.getPrimitiveBounds().getBounds().height + 2; 
&gt;   
&gt;         // create an Graphics object the same size as the clip area
(for my PDF document) 
&gt;         PdfTemplate template = pdf.createTemplate(width, height); 
&gt;         Graphics2D graphics = template.createGraphics(width, height); 
&gt;   
&gt;         // paint the SVG onto the graphics 
&gt;         try { 
&gt;             graphicsNode.primitivePaint(graphics); 
&gt;         } finally { 
&gt;             graphics.dispose(); 
&gt;         } 
&gt;   
&gt; This works fine when the clip area is positioned at the (0, 0) x - y
&gt; coordinates. This breaks down, however, with the clip area is in the
&gt; "middle" of the entire SVG image. 

   In this case you need to translate the clipped area to position
(0,0). 
I'm not familiar with your PDF engine but probably you can manage it
with, 

 
graphics.translate(-graphicsNode.getPrimitiveBounds().getBounds().x, 
 
-graphicsNode.getPrimitiveBounds().getBounds().y); 


########################################################################
"This email message, including any attachments, is for the sole use of the intended recipients
and may contain confidential and privileged information.  Unauthorized use, disclosure or
distribution of this email is strictly forbidden.  If you have received this message in error,
please reply to the above sender notifying them of this error, and then kindly delete the
message."
########################################################################


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: complex batik use</title>
<author><name>Ronald Paloschi &lt;ronald@audaces.com.br&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c4B1CFCB7.3000902@audaces.com.br%3e"/>
<id>urn:uuid:%3c4B1CFCB7-3000902@audaces-com-br%3e</id>
<updated>2009-12-07T13:01:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Thomas,

Indeed! I think you figured out exactly what I'm planning to do.

I agree that the challenge would be huge to support everything SVG 
supports in my application... but some of SVG's features won't be needed 
at all... so I'll  not need to handle them as my application is not an 
SVG application.

Thanks for the link and information... exactly what I was looking for! I 
really appreciate your help.

Regards,
Ronald





thomas.deweese@kodak.com escreveu:
&gt; Hi Ronald,
&gt;
&gt; Ronald Paloschi &lt;ronald@audaces.com.br&gt; wrote on 12/03/2009 11:44:35 AM:
&gt;
&gt; &gt; So, my goal is to use batik inside my c++ application. How? What I
&gt; &gt; thought till now:
&gt; &gt;    * We already have a C++ model defined (legacy, so we wont change 
&gt; that).
&gt; &gt;    * My main goal is to tell batik to read an SVG and provide-me with
&gt; &gt;      the data so that I can manually convert it to my model.
&gt;
&gt; &gt; Now my questions:
&gt; &gt;    * I realized that it uses a GVTBuilder class to generate 
&gt; GraphicsNode
&gt; &gt;      interface objects (now they are high level as I want).
&gt; &gt;    * I would like to simply iterate this GraphicsNode objects and
&gt; &gt;      convertt them to my structures (a small layer tying Java and 
&gt; C++ worlds).
&gt; &gt;    * I observed that all of this is done thinking about the screen (of
&gt; &gt;      course). Even the Shapes are the AWT shapes inside the 
&gt; ShapeNode objects
&gt; &gt;      for example. I think its acceptable since I dont care about this
&gt; &gt;      objects. I have my model.
&gt; &gt;    * Basically I need a list of GraphicsNode objects and a class that
&gt; &gt;      provides this to me.
&gt;
&gt;    If you take a look at the Wiki page "Boot SVG &amp; CSS DOM":
&gt;         http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom
&gt;
&gt;    You will see at the end of the sequence of code you have the
&gt; 'rootGN'.  This is the top of the rendering tree for the document.
&gt; If you simply walk that tree (CompositeGraphicsNode provides
&gt; an interface to iterate over their children).
&gt;
&gt;    Doing this to get the basic geometry will be fairly simple.
&gt; Where you are likely to run into problem is when you hit documents
&gt; that use more complex features of SVG, such as multi-stop gradients,
&gt; patters (the fill is defined by another rendering tree of SVG),
&gt; Masking, and Filters.
&gt;
&gt;    Supporting all of that stuff will be a lot of work and I
&gt; suspect that your existing graphics model won't handle it all.
&gt;
&gt;    Also this approach obviously makes it essentially impossible
&gt; to handle dynamic content.
&gt;
&gt;    Anyway good luck!
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Rendering the clipped area on an SVG to a Graphics2d object</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOFB398E81E.40B8475B-ON85257684.0046D04B-85257684.0047272B@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOFB398E81E-40B8475B-ON85257684-0046D04B-85257684-0047272B@knotes-kodak-com%3e</id>
<updated>2009-12-06T12:57:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Ryan,

"Ryan Breidenbach" &lt;rsbreidenbach@containerstore.com&gt; wrote on 12/04/2009 
01:19:27 PM:

&gt; I have an SVG image loaded as a GraphicsNode object. This SVG image 
&gt; has a clip area that I want to render. So far, this is how I am doing 
it:
&gt; 
&gt;         // find the bounds of the clip area
&gt;         int width = graphicsNode.getPrimitiveBounds().getBounds().width 
+ 2;
&gt;         int height = 
graphicsNode.getPrimitiveBounds().getBounds().height + 2;
&gt; 
&gt;         // create an Graphics object the same size as the clip area (for 
my PDF document)
&gt;         PdfTemplate template = pdf.createTemplate(width, height);
&gt;         Graphics2D graphics = template.createGraphics(width, height);
&gt; 
&gt;         // paint the SVG onto the graphics
&gt;         try {
&gt;             graphicsNode.primitivePaint(graphics);
&gt;         } finally {
&gt;             graphics.dispose();
&gt;         }
&gt; 
&gt; This works fine when the clip area is positioned at the (0, 0) x ? y
&gt; coordinates. This breaks down, however, with the clip area is in the
&gt; ?middle? of the entire SVG image.

   In this case you need to translate the clipped area to position (0,0).
I'm not familiar with your PDF engine but probably you can manage it with,

 graphics.translate(-graphicsNode.getPrimitiveBounds().getBounds().x,
 -graphicsNode.getPrimitiveBounds().getBounds().y);



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: complex batik use</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOF5A9AEC92.DD2E2261-ON85257684.0045CA29-85257684.0046B59E@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOF5A9AEC92-DD2E2261-ON85257684-0045CA29-85257684-0046B59E@knotes-kodak-com%3e</id>
<updated>2009-12-06T12:52:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Ronald,

Ronald Paloschi &lt;ronald@audaces.com.br&gt; wrote on 12/03/2009 11:44:35 AM:

&gt; So, my goal is to use batik inside my c++ application. How? What I 
&gt; thought till now:
&gt;    * We already have a C++ model defined (legacy, so we wont change 
that).
&gt;    * My main goal is to tell batik to read an SVG and provide-me with 
&gt;      the data so that I can manually convert it to my model.

&gt; Now my questions:
&gt;    * I realized that it uses a GVTBuilder class to generate GraphicsNode 

&gt;      interface objects (now they are high level as I want).
&gt;    * I would like to simply iterate this GraphicsNode objects and 
&gt;      convertt them to my structures (a small layer tying Java and C++ 
worlds).
&gt;    * I observed that all of this is done thinking about the screen (of 
&gt;      course). Even the Shapes are the AWT shapes inside the ShapeNode 
objects 
&gt;      for example. I think its acceptable since I dont care about this 
&gt;      objects. I have my model.
&gt;    * Basically I need a list of GraphicsNode objects and a class that 
&gt;      provides this to me.

   If you take a look at the Wiki page "Boot SVG &amp; CSS DOM":
        http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom

   You will see at the end of the sequence of code you have the
'rootGN'.  This is the top of the rendering tree for the document.
If you simply walk that tree (CompositeGraphicsNode provides
an interface to iterate over their children).

   Doing this to get the basic geometry will be fairly simple.
Where you are likely to run into problem is when you hit documents
that use more complex features of SVG, such as multi-stop gradients,
patters (the fill is defined by another rendering tree of SVG),
Masking, and Filters.

   Supporting all of that stuff will be a lot of work and I
suspect that your existing graphics model won't handle it all.

   Also this approach obviously makes it essentially impossible
to handle dynamic content.

   Anyway good luck!



</pre>
</div>
</content>
</entry>
<entry>
<title>Rendering the clipped area on an SVG to a Graphics2d object</title>
<author><name>&quot;Ryan Breidenbach&quot; &lt;rsbreidenbach@containerstore.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c972870457212F24A9C437AD491B72DF906E4A4C0@DFWCOMAS2.containerstore.com%3e"/>
<id>urn:uuid:%3c972870457212F24A9C437AD491B72DF906E4A4C0@DFWCOMAS2-containerstore-com%3e</id>
<updated>2009-12-04T18:19:27Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I have an SVG image loaded as a GraphicsNode object. This SVG image has
a clip area that I want to render. So far, this is how I am doing it:

 

        // find the bounds of the clip area

        int width = graphicsNode.getPrimitiveBounds().getBounds().width
+ 2;

        int height =
graphicsNode.getPrimitiveBounds().getBounds().height + 2;

 

        // create an Graphics object the same size as the clip area (for
my PDF document)

        PdfTemplate template = pdf.createTemplate(width, height);

        Graphics2D graphics = template.createGraphics(width, height);

 

        // paint the SVG onto the graphics

        try {

            graphicsNode.primitivePaint(graphics);

        } finally {

            graphics.dispose();

        }

 

This works fine when the clip area is positioned at the (0, 0) x - y
coordinates. This breaks down, however, with the clip area is in the
"middle" of the entire SVG image. I know this should be straightforward
(maybe something like using the setClip() method? Use a filter?), but I
am struggling with exactly how to do this. The Batik API is very
specialize to the graphics domain, so it is very hard for the lay person
to grok. I have searched for clip example with no success.

 

I have been struggling with this for days now and cannot figure how to
do this. Any help would be appreciated.

 

Ryan

 


########################################################################
"This email message, including any attachments, is for the sole use of the intended recipients
and may contain confidential and privileged information.  Unauthorized use, disclosure or
distribution of this email is strictly forbidden.  If you have received this message in error,
please reply to the above sender notifying them of this error, and then kindly delete the
message."
########################################################################


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: complex batik use</title>
<author><name>Ronald Paloschi &lt;ronald@audaces.com.br&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c4B18ED8D.9000005@audaces.com.br%3e"/>
<id>urn:uuid:%3c4B18ED8D-9000005@audaces-com-br%3e</id>
<updated>2009-12-04T11:07:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello Michael,

Well, I agree with you that it would be better if we could put as many 
logic as possible regarding svg on the java side.
The problem is that the app code is legacy and, as I said earlier we 
need to convert data to our C++ model.
Maybe usign batik for just "parsing" svg's in order to convert them to 
my model is a little overkill... Im just importing an svg document to my 
C++ model.

Anyway, thanks a lot for your help!

[]s
Ronald



Kerschbaum Michael escreveu:
&gt; Hello, 
&gt;
&gt; As I understand is, you would like to transform the complete (or what
&gt; you need) Batik functions via JNI to a nother Programming Language like
&gt; C++. E.g. the Batik loads the svg and you transform the DOM Tree to C++
&gt; ?
&gt;
&gt; Hmmm...
&gt;
&gt; Is this really required ? Dou you really need all the functions in a
&gt; sourrounding world ? What we do is that we have a Java Part that uses
&gt; Batik. This Part ( e.g. a Java Bean) has an interface like.. loadSVG,
&gt; setUri ... ShowLayer, etc.. And a second interface to transform the
&gt; actions in the application to the sourounding world, like
&gt; gvtTreeRendered, symbolsLoaded, error, etc... 
&gt;
&gt; The question is how many logic would be in which part ?! We have a lot
&gt; logic in the Java Part, and only view this in an applet or an other Java
&gt; Application or in WinForm or in .NET or in Delphi... And there is only
&gt; e.g. the RadioButtons for the different Layers.. ? Or a + , - for zoom
&gt; =&gt; calls zoom(int) in the interface to the Bean or ActiveX component.
&gt;
&gt; So the Java part can be used without any sourrounding box...
&gt;
&gt; mfg
&gt; Michael Kerschbaum 
&gt;
&gt;
&gt; -----Original Message-----
&gt; From: Ronald Paloschi [mailto:ronald@audaces.com.br] 
&gt; Sent: Friday, December 04, 2009 11:37 AM
&gt; To: batik-users@xmlgraphics.apache.org
&gt; Subject: Re: complex batik use
&gt;
&gt; Hello Michael, thanks for your answer!
&gt;
&gt; Your environment is almost the same, except for .NET part (sadly, our
&gt; compiler is not Microsoft, so we can't integrate .NET CLR modules in our
&gt;
&gt; C++ app).
&gt; Anyway, if we abstract this part (lets assume you are using .NET with
&gt; WPF and I will be using JNI auto-generated c++ code as a proxy to batik
&gt; classes), I would really aprecciate in knowing how do you interpret
&gt; batik's svg data, for example, to convert svg entyties into your .NET
&gt; model. I presume you have to do that, isn't?
&gt;
&gt; That is excactly the same problem that I have to solve and I aprreciate
&gt; your help.
&gt;
&gt; Thanks in advance,
&gt; Ronald
&gt;
&gt;
&gt; Kerschbaum Michael escreveu:
&gt;   
&gt;&gt; Hello,
&gt;&gt;
&gt;&gt; We use Batik in an *.NET Application with WPF. Ist Java with ActiveX 
&gt;&gt; in an WinForm. This winForm is added to *.NET (C#, C++) Application. 
&gt;&gt; I'am only responsible for the Java Batik part, because we use the 
&gt;&gt; Batik also in an only Java Application.
&gt;&gt;
&gt;&gt; Let me know if your are interrestet in knowing details... Then i must 
&gt;&gt; talk with same guys from our company to get details.
&gt;&gt;  
&gt;&gt;
&gt;&gt; mfg
&gt;&gt; Michael Kerschbaum
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; -----Original Message-----
&gt;&gt; From: Ronald Paloschi [mailto:ronald@audaces.com.br]
&gt;&gt; Sent: Thursday, December 03, 2009 5:45 PM
&gt;&gt; To: batik-users@xmlgraphics.apache.org
&gt;&gt; Subject: complex batik use
&gt;&gt;
&gt;&gt; Hi all,
&gt;&gt;
&gt;&gt; This is my first message to the mailing list.
&gt;&gt; My question is a little complex, so, let me explin it a little
&gt;&gt;     
&gt; further:
&gt;   
&gt;&gt;    * In our company we have a c++ graphical application.
&gt;&gt;    * We have a new feature request that is to be able to read svg
&gt;&gt;     
&gt; files.
&gt;   
&gt;&gt;    * A home-made c++ solution for this would take ages to complete, 
&gt;&gt; just the parser would be a considerable amount of job.
&gt;&gt;    * I studied batik in action for the kind of SVG that we need and it
&gt;&gt;     
&gt;
&gt;   
&gt;&gt; rocks!
&gt;&gt;
&gt;&gt; So, my goal is to use batik inside my c++ application. How? What I 
&gt;&gt; thought till now:
&gt;&gt;    * We already have a C++ model defined (legacy, so we wont change 
&gt;&gt; that).
&gt;&gt;    * My main goal is to tell batik to read an SVG and provide-me with 
&gt;&gt; the data so that I can manually convert it to my model.
&gt;&gt;    * I`m planning to use JNI++ to glue things up. Till here everything
&gt;&gt;     
&gt;
&gt;   
&gt;&gt; is OK.
&gt;&gt;
&gt;&gt; Now my questions:
&gt;&gt;    * The simplest way to get the data as I realized is haveing a DOM 
&gt;&gt; model of the SVG (quite low level).
&gt;&gt;    * I studied the provided SVGViewer sample to see how things are 
&gt;&gt; done in JSVGCanvas;
&gt;&gt;    * I realized that it uses a GVTBuilder class to generate 
&gt;&gt; GraphicsNode interface objects (now they are high level as I want).
&gt;&gt;    * I would like to simply iterate this GraphicsNode objects and 
&gt;&gt; convertt them to my structures (a small layer tying Java and C++ 
&gt;&gt; worlds).
&gt;&gt;    * I observed that all of this is done thinking about the screen (of
&gt;&gt;     
&gt;
&gt;   
&gt;&gt; course). Even the Shapes are the AWT shapes inside the ShapeNode 
&gt;&gt; objects for example. I think its acceptable since I dont care about 
&gt;&gt; this objects. I have my model.
&gt;&gt;    * Basically I need a list of GraphicsNode objects and a class that 
&gt;&gt; provides this to me.
&gt;&gt;
&gt;&gt; I hope I could explain a little bit what are my objectives... I wanna 
&gt;&gt; hear your thoughts on that...
&gt;&gt; (please abstract the JNI problem, that is a trivial problem to me... )
&gt;&gt;
&gt;&gt; Thanks in advance,
&gt;&gt; Ronald
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt;&gt; For additional commands, e-mail: 
&gt;&gt; batik-users-help@xmlgraphics.apache.org
&gt;&gt;
&gt;&gt;
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt;&gt; For additional commands, e-mail: 
&gt;&gt; batik-users-help@xmlgraphics.apache.org
&gt;&gt;
&gt;&gt;
&gt;&gt;   
&gt;&gt;     
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt;
&gt;
&gt;   



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: complex batik use</title>
<author><name>&quot;Kerschbaum Michael &quot; &lt;m.kerschbaum@pke.at&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c8B2945FA22A46E44A8FFE0B0553025B4071C69@01-EXCH2.wan.pke.at%3e"/>
<id>urn:uuid:%3c8B2945FA22A46E44A8FFE0B0553025B4071C69@01-EXCH2-wan-pke-at%3e</id>
<updated>2009-12-04T10:53:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello, 

As I understand is, you would like to transform the complete (or what
you need) Batik functions via JNI to a nother Programming Language like
C++. E.g. the Batik loads the svg and you transform the DOM Tree to C++
?

Hmmm...

Is this really required ? Dou you really need all the functions in a
sourrounding world ? What we do is that we have a Java Part that uses
Batik. This Part ( e.g. a Java Bean) has an interface like.. loadSVG,
setUri ... ShowLayer, etc.. And a second interface to transform the
actions in the application to the sourounding world, like
gvtTreeRendered, symbolsLoaded, error, etc... 

The question is how many logic would be in which part ?! We have a lot
logic in the Java Part, and only view this in an applet or an other Java
Application or in WinForm or in .NET or in Delphi... And there is only
e.g. the RadioButtons for the different Layers.. ? Or a + , - for zoom
=&gt; calls zoom(int) in the interface to the Bean or ActiveX component.

So the Java part can be used without any sourrounding box...

mfg
Michael Kerschbaum 


-----Original Message-----
From: Ronald Paloschi [mailto:ronald@audaces.com.br] 
Sent: Friday, December 04, 2009 11:37 AM
To: batik-users@xmlgraphics.apache.org
Subject: Re: complex batik use

Hello Michael, thanks for your answer!

Your environment is almost the same, except for .NET part (sadly, our
compiler is not Microsoft, so we can't integrate .NET CLR modules in our

C++ app).
Anyway, if we abstract this part (lets assume you are using .NET with
WPF and I will be using JNI auto-generated c++ code as a proxy to batik
classes), I would really aprecciate in knowing how do you interpret
batik's svg data, for example, to convert svg entyties into your .NET
model. I presume you have to do that, isn't?

That is excactly the same problem that I have to solve and I aprreciate
your help.

Thanks in advance,
Ronald


Kerschbaum Michael escreveu:
&gt; Hello,
&gt;
&gt; We use Batik in an *.NET Application with WPF. Ist Java with ActiveX 
&gt; in an WinForm. This winForm is added to *.NET (C#, C++) Application. 
&gt; I'am only responsible for the Java Batik part, because we use the 
&gt; Batik also in an only Java Application.
&gt;
&gt; Let me know if your are interrestet in knowing details... Then i must 
&gt; talk with same guys from our company to get details.
&gt;  
&gt;
&gt; mfg
&gt; Michael Kerschbaum
&gt;
&gt;
&gt;
&gt; -----Original Message-----
&gt; From: Ronald Paloschi [mailto:ronald@audaces.com.br]
&gt; Sent: Thursday, December 03, 2009 5:45 PM
&gt; To: batik-users@xmlgraphics.apache.org
&gt; Subject: complex batik use
&gt;
&gt; Hi all,
&gt;
&gt; This is my first message to the mailing list.
&gt; My question is a little complex, so, let me explin it a little
further:
&gt;
&gt;    * In our company we have a c++ graphical application.
&gt;    * We have a new feature request that is to be able to read svg
files.
&gt;    * A home-made c++ solution for this would take ages to complete, 
&gt; just the parser would be a considerable amount of job.
&gt;    * I studied batik in action for the kind of SVG that we need and it

&gt; rocks!
&gt;
&gt; So, my goal is to use batik inside my c++ application. How? What I 
&gt; thought till now:
&gt;    * We already have a C++ model defined (legacy, so we wont change 
&gt; that).
&gt;    * My main goal is to tell batik to read an SVG and provide-me with 
&gt; the data so that I can manually convert it to my model.
&gt;    * I`m planning to use JNI++ to glue things up. Till here everything

&gt; is OK.
&gt;
&gt; Now my questions:
&gt;    * The simplest way to get the data as I realized is haveing a DOM 
&gt; model of the SVG (quite low level).
&gt;    * I studied the provided SVGViewer sample to see how things are 
&gt; done in JSVGCanvas;
&gt;    * I realized that it uses a GVTBuilder class to generate 
&gt; GraphicsNode interface objects (now they are high level as I want).
&gt;    * I would like to simply iterate this GraphicsNode objects and 
&gt; convertt them to my structures (a small layer tying Java and C++ 
&gt; worlds).
&gt;    * I observed that all of this is done thinking about the screen (of

&gt; course). Even the Shapes are the AWT shapes inside the ShapeNode 
&gt; objects for example. I think its acceptable since I dont care about 
&gt; this objects. I have my model.
&gt;    * Basically I need a list of GraphicsNode objects and a class that 
&gt; provides this to me.
&gt;
&gt; I hope I could explain a little bit what are my objectives... I wanna 
&gt; hear your thoughts on that...
&gt; (please abstract the JNI problem, that is a trivial problem to me... )
&gt;
&gt; Thanks in advance,
&gt; Ronald
&gt;
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: 
&gt; batik-users-help@xmlgraphics.apache.org
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: 
&gt; batik-users-help@xmlgraphics.apache.org
&gt;
&gt;
&gt;   


---------------------------------------------------------------------
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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: complex batik use</title>
<author><name>Ronald Paloschi &lt;ronald@audaces.com.br&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c4B18E64F.1030707@audaces.com.br%3e"/>
<id>urn:uuid:%3c4B18E64F-1030707@audaces-com-br%3e</id>
<updated>2009-12-04T10:37:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello Michael, thanks for your answer!

Your environment is almost the same, except for .NET part (sadly, our 
compiler is not Microsoft, so we can't integrate .NET CLR modules in our 
C++ app).
Anyway, if we abstract this part (lets assume you are using .NET with 
WPF and I will be using JNI auto-generated c++ code as a proxy to batik 
classes), I would really aprecciate in knowing how do you interpret 
batik's svg data, for example, to convert svg entyties into your .NET 
model. I presume you have to do that, isn't?

That is excactly the same problem that I have to solve and I aprreciate 
your help.

Thanks in advance,
Ronald


Kerschbaum Michael escreveu:
&gt; Hello,
&gt;
&gt; We use Batik in an *.NET Application with WPF. Ist Java with ActiveX in
&gt; an WinForm. This winForm is added to *.NET (C#, C++) Application. I'am
&gt; only responsible for the Java Batik part, because we use the Batik also
&gt; in an only Java Application.
&gt;
&gt; Let me know if your are interrestet in knowing details... Then i must
&gt; talk with same guys from our company to get details. 
&gt;  
&gt;
&gt; mfg
&gt; Michael Kerschbaum 
&gt;
&gt;
&gt;
&gt; -----Original Message-----
&gt; From: Ronald Paloschi [mailto:ronald@audaces.com.br] 
&gt; Sent: Thursday, December 03, 2009 5:45 PM
&gt; To: batik-users@xmlgraphics.apache.org
&gt; Subject: complex batik use
&gt;
&gt; Hi all,
&gt;
&gt; This is my first message to the mailing list.
&gt; My question is a little complex, so, let me explin it a little further:
&gt;
&gt;    * In our company we have a c++ graphical application.
&gt;    * We have a new feature request that is to be able to read svg files.
&gt;    * A home-made c++ solution for this would take ages to complete, just
&gt; the parser would be a considerable amount of job.
&gt;    * I studied batik in action for the kind of SVG that we need and it
&gt; rocks!
&gt;
&gt; So, my goal is to use batik inside my c++ application. How? What I
&gt; thought till now:
&gt;    * We already have a C++ model defined (legacy, so we wont change
&gt; that).
&gt;    * My main goal is to tell batik to read an SVG and provide-me with
&gt; the data so that I can manually convert it to my model.
&gt;    * I`m planning to use JNI++ to glue things up. Till here everything
&gt; is OK.
&gt;
&gt; Now my questions:
&gt;    * The simplest way to get the data as I realized is haveing a DOM
&gt; model of the SVG (quite low level).
&gt;    * I studied the provided SVGViewer sample to see how things are done
&gt; in JSVGCanvas;
&gt;    * I realized that it uses a GVTBuilder class to generate GraphicsNode
&gt; interface objects (now they are high level as I want).
&gt;    * I would like to simply iterate this GraphicsNode objects and
&gt; convertt them to my structures (a small layer tying Java and C++
&gt; worlds).
&gt;    * I observed that all of this is done thinking about the screen (of
&gt; course). Even the Shapes are the AWT shapes inside the ShapeNode objects
&gt; for example. I think its acceptable since I dont care about this
&gt; objects. I have my model.
&gt;    * Basically I need a list of GraphicsNode objects and a class that
&gt; provides this to me.
&gt;
&gt; I hope I could explain a little bit what are my objectives... I wanna
&gt; hear your thoughts on that...
&gt; (please abstract the JNI problem, that is a trivial problem to me... )
&gt;
&gt; Thanks in advance,
&gt; Ronald
&gt;
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt;
&gt;
&gt;   


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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: complex batik use</title>
<author><name>&quot;Kerschbaum Michael &quot; &lt;m.kerschbaum@pke.at&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c8B2945FA22A46E44A8FFE0B0553025B4071C5A@01-EXCH2.wan.pke.at%3e"/>
<id>urn:uuid:%3c8B2945FA22A46E44A8FFE0B0553025B4071C5A@01-EXCH2-wan-pke-at%3e</id>
<updated>2009-12-04T08:22:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hello,

We use Batik in an *.NET Application with WPF. Ist Java with ActiveX in
an WinForm. This winForm is added to *.NET (C#, C++) Application. I'am
only responsible for the Java Batik part, because we use the Batik also
in an only Java Application.

Let me know if your are interrestet in knowing details... Then i must
talk with same guys from our company to get details. 
 

mfg
Michael Kerschbaum 



-----Original Message-----
From: Ronald Paloschi [mailto:ronald@audaces.com.br] 
Sent: Thursday, December 03, 2009 5:45 PM
To: batik-users@xmlgraphics.apache.org
Subject: complex batik use

Hi all,

This is my first message to the mailing list.
My question is a little complex, so, let me explin it a little further:

   * In our company we have a c++ graphical application.
   * We have a new feature request that is to be able to read svg files.
   * A home-made c++ solution for this would take ages to complete, just
the parser would be a considerable amount of job.
   * I studied batik in action for the kind of SVG that we need and it
rocks!

So, my goal is to use batik inside my c++ application. How? What I
thought till now:
   * We already have a C++ model defined (legacy, so we wont change
that).
   * My main goal is to tell batik to read an SVG and provide-me with
the data so that I can manually convert it to my model.
   * I`m planning to use JNI++ to glue things up. Till here everything
is OK.

Now my questions:
   * The simplest way to get the data as I realized is haveing a DOM
model of the SVG (quite low level).
   * I studied the provided SVGViewer sample to see how things are done
in JSVGCanvas;
   * I realized that it uses a GVTBuilder class to generate GraphicsNode
interface objects (now they are high level as I want).
   * I would like to simply iterate this GraphicsNode objects and
convertt them to my structures (a small layer tying Java and C++
worlds).
   * I observed that all of this is done thinking about the screen (of
course). Even the Shapes are the AWT shapes inside the ShapeNode objects
for example. I think its acceptable since I dont care about this
objects. I have my model.
   * Basically I need a list of GraphicsNode objects and a class that
provides this to me.

I hope I could explain a little bit what are my objectives... I wanna
hear your thoughts on that...
(please abstract the JNI problem, that is a trivial problem to me... )

Thanks in advance,
Ronald



---------------------------------------------------------------------
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



</pre>
</div>
</content>
</entry>
<entry>
<title>complex batik use</title>
<author><name>Ronald Paloschi &lt;ronald@audaces.com.br&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c4B17EAF3.3040005@audaces.com.br%3e"/>
<id>urn:uuid:%3c4B17EAF3-3040005@audaces-com-br%3e</id>
<updated>2009-12-03T16:44:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

This is my first message to the mailing list.
My question is a little complex, so, let me explin it a little further:

   * In our company we have a c++ graphical application.
   * We have a new feature request that is to be able to read svg files.
   * A home-made c++ solution for this would take ages to complete, just 
the parser would be a considerable amount of job.
   * I studied batik in action for the kind of SVG that we need and it 
rocks!

So, my goal is to use batik inside my c++ application. How? What I 
thought till now:
   * We already have a C++ model defined (legacy, so we wont change that).
   * My main goal is to tell batik to read an SVG and provide-me with 
the data so that I can manually convert it to my model.
   * I`m planning to use JNI++ to glue things up. Till here everything 
is OK.

Now my questions:
   * The simplest way to get the data as I realized is haveing a DOM 
model of the SVG (quite low level).
   * I studied the provided SVGViewer sample to see how things are done 
in JSVGCanvas;
   * I realized that it uses a GVTBuilder class to generate GraphicsNode 
interface objects (now they are high level as I want).
   * I would like to simply iterate this GraphicsNode objects and 
convertt them to my structures (a small layer tying Java and C++ worlds).
   * I observed that all of this is done thinking about the screen (of 
course). Even the Shapes are the AWT shapes inside the ShapeNode objects 
for example. I think its acceptable since I dont care about this 
objects. I have my model.
   * Basically I need a list of GraphicsNode objects and a class that 
provides this to me.

I hope I could explain a little bit what are my objectives... I wanna 
hear your thoughts on that...
(please abstract the JNI problem, that is a trivial problem to me... )

Thanks in advance,
Ronald



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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Batik Rasterizer Clarification</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOF6D1DFE0C.043D7B9F-ON85257681.003DBBDB-85257681.003F100C@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOF6D1DFE0C-043D7B9F-ON85257681-003DBBDB-85257681-003F100C@knotes-kodak-com%3e</id>
<updated>2009-12-03T11:28:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Nagabhushan,

Nagabhushan Sss &lt;nagabsss@in.ibm.com&gt; wrote on 12/03/2009 06:03:08 AM:

&gt; Given an SVG file,  Batik Rasterizer produces the corresponding JPEG/PNG
&gt; image. I was interested in knowing the size of the output JPEG/PNG image
&gt; produced.

    This is complex because the Rasterizer factors in a number of 
hints/command line options etc to arrive at the final size.  If none
of those options are used then the document's "native" size is based on
following the CSS/SVG rules for fitting the document in a default 
400x400 viewport, and the Pixel to Millimeter conversion factor
(defaults to 0.264583 or 96dpi).

&gt; Nagabhushan Sss &lt;nagabsss@in.ibm.com&gt; wrote on 12/02/2009 03:21:01 AM:
&gt; 
&gt; &gt; I know it is possible in Batik Rasterizer to produce image for a given
&gt; &gt; width and height.
&gt; &gt; Is there a way to calculate the size required to produce an image that 
is
&gt; &gt; rendered at actual size ?

thomas.deweese@kodak.com wrote on 02/12/2009 04:32 PM:

&gt;     Care to define what 'actual size' means?
&gt; 
&gt;     In general SVG is resolution independent so the image _may_
&gt; have no 'actual size'.  I'm guessing this is not your case so you
&gt; need to let us know why you think your documents have an actual size.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Batik Rasterizer Clarification</title>
<author><name>Nagabhushan Sss &lt;nagabsss@in.ibm.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOF19042259.7052921B-ON65257681.003CAD3A-65257681.003CEAD4@in.ibm.com%3e"/>
<id>urn:uuid:%3cOF19042259-7052921B-ON65257681-003CAD3A-65257681-003CEAD4@in-ibm-com%3e</id>
<updated>2009-12-03T11:03:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

Given an SVG file,  Batik Rasterizer produces the corresponding JPEG/PNG
image. I was interested in knowing the size of the output JPEG/PNG image
produced.

Best Regards
Bhushna


                                                                           
             thomas.deweese@ko                                             
             dak.com                                                       
                                                                        To 
             02/12/2009 04:32          batik-users@xmlgraphics.apache.org  
             PM                                                         cc 
                                       batik-users@xmlgraphics.apache.org  
                                                                   Subject 
             Please respond to         Re: Batik Rasterizer Clarification  
             batik-users@xmlgr                                             
             aphics.apache.org                                             
                                                                           
                                                                           
                                                                           
                                                                           




Hi Nagabhushan,

Nagabhushan Sss &lt;nagabsss@in.ibm.com&gt; wrote on 12/02/2009 03:21:01 AM:

&gt; I know it is possible in Batik Rasterizer to produce image for a given
&gt; width and height.
&gt; Is there a way to calculate the size required to produce an image that is
&gt; rendered at actual size ?

    Care to define what 'actual size' means?

    In general SVG is resolution independent so the image _may_
have no 'actual size'.  I'm guessing this is not your case so you
need to let us know why you think your documents have an actual size.



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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Fit JSVGCanvas around an Element</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOF8B51FB4D.9DA34DE8-ON85257681.003C5E23-85257681.003C94C5@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOF8B51FB4D-9DA34DE8-ON85257681-003C5E23-85257681-003C94C5@knotes-kodak-com%3e</id>
<updated>2009-12-03T11:01:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Mistercaste,

mistercaste &lt;mistercaste@gmail.com&gt; wrote on 12/02/2009 07:19:35 AM:

&gt; I need to fit my canvas around an Element of my SVG document.
&gt; On the forum I found advice that said to do get the Screen CTM
&gt; of the Element and that's what I did.
&gt; But actually I don't know how to use this CTM in combination with
&gt; the RenderingTransform.

   Once again I must stress that you need to learn about Affine
Transforms.

   You can find similar code in Batik's SVG browser's 'find' dialog
(batik.apps.svgbrowser.FindDialog.showSelectedGraphicsNode)

&gt; Here follows my code:
&gt; 
&gt; 
&gt;     void centerOnElement(Element elementToCenter) {
&gt;         SVGMatrix matrix = ((SVGLocatable) 
elementToCenter).getScreenCTM();
&gt; 
&gt;         float[] flatMatrix = {
&gt;             matrix.getA(),
&gt;             matrix.getB(),
&gt;             matrix.getC(),
&gt;             matrix.getD(),
&gt;             matrix.getE(),
&gt;             matrix.getF()};
&gt; 
&gt;         final AffineTransform elementAT = new 
AffineTransform(flatMatrix);
&gt; 
&gt;         UpdateManager um = canvas.getUpdateManager();
&gt;         um.getUpdateRunnableQueue().invokeLater(new Runnable() {
&gt; 
&gt;             @Override
&gt;             public void run() {
&gt;                 at = canvas.getInitialTransform();
&gt;                 /*
&gt;                  * How do I work the elementAT AffineTransform
&gt;                  * so that it fits the element in the canvas?
&gt;                  */
&gt;                 canvas.setRenderingTransform(at);
&gt;             }
&gt;         });
&gt;     }
&gt; 
&gt; 
&gt; 
&gt; 
&gt; Thank you.
&gt; 
&gt; 
&gt; 
&gt; -- 
&gt; View this message in context: http://old.nabble.com/Fit-JSVGCanvas-
&gt; around-an-Element-tp26607989p26607989.html
&gt; Sent from the Batik - Users mailing list archive at Nabble.com.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: PDF Transcoder Zoom</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOFA48B02C6.B732D48F-ON85257681.003A9D61-85257681.003C03C8@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOFA48B02C6-B732D48F-ON85257681-003A9D61-85257681-003C03C8@knotes-kodak-com%3e</id>
<updated>2009-12-03T10:55:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Mistercaste,

mistercaste &lt;mistercaste@gmail.com&gt; wrote on 12/02/2009 06:48:10 AM:

&gt; I tried the following code (a bit.. uh.. randomly), but it
&gt; doesn't seem to work.
&gt; I don't know how to relate the bounds with the rendering
&gt; transform.

   If you are going to be doing any significant work with
SVG and/or Batik I strongly recommend that you learn to
work with Affine Transforms.  This is a general concept
in 2D graphics and understanding them is essential to 
doing anything non-trivial.

&gt; 
&gt;     private Rectangle getAOI() {
&gt;         AffineTransform rt = canvas.getRenderingTransform();
&gt;         Rectangle myRect = canvas.getBounds();

            try {
                rt = rt.createInverse();  // we want to go 
screen-&gt;document
                myRect = rt.createTransformedShape(myRect).getBounds();
            } catch (NoninvertibleTransformException) {
                /// nothing to do
            }
&gt; 
&gt;         return myRect;
&gt;     }
&gt; -- 
&gt; View this message in context: http://old.nabble.com/PDF-Transcoder-
&gt; Zoom-tp26593852p26607629.html
&gt; Sent from the Batik - Users mailing list archive at Nabble.com.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Fit JSVGCanvas around an Element</title>
<author><name>mistercaste &lt;mistercaste@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c26607989.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26607989-post@talk-nabble-com%3e</id>
<updated>2009-12-02T12:19:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi
I need to fit my canvas around an Element of my SVG document.
On the forum I found advice that said to do get the Screen CTM
of the Element and that's what I did.
But actually I don't know how to use this CTM in combination with
the RenderingTransform.

Here follows my code:


    void centerOnElement(Element elementToCenter) {
        SVGMatrix matrix = ((SVGLocatable) elementToCenter).getScreenCTM();

        float[] flatMatrix = {
            matrix.getA(),
            matrix.getB(),
            matrix.getC(),
            matrix.getD(),
            matrix.getE(),
            matrix.getF()};

        final AffineTransform elementAT = new AffineTransform(flatMatrix);

        UpdateManager um = canvas.getUpdateManager();
        um.getUpdateRunnableQueue().invokeLater(new Runnable() {

            @Override
            public void run() {
                at = canvas.getInitialTransform();
                /*
                 * How do I work the elementAT AffineTransform
                 * so that it fits the element in the canvas?
                 */
                canvas.setRenderingTransform(at);
            }
        });
    }




Thank you.



-- 
View this message in context: http://old.nabble.com/Fit-JSVGCanvas-around-an-Element-tp26607989p26607989.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: PDF Transcoder Zoom</title>
<author><name>Martin Jacobson &lt;jacobson.martin@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cdad1b2e70912020407p3c84dc6ep2d1fa39a1dbb7f4c@mail.gmail.com%3e"/>
<id>urn:uuid:%3cdad1b2e70912020407p3c84dc6ep2d1fa39a1dbb7f4c@mail-gmail-com%3e</id>
<updated>2009-12-02T12:07:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I don't know whether this will be of any help, but consider the following:
- You draw on an infinite drawing board
- The viewBox attribute on the SVG element describes the part of the
drawing board you want to see
- the height and width attributes describe how big you want the image to be

Surely, setting appropriate values (according the zoomed area, and the
output image size) is enough?

Martin


2009/12/2 mistercaste &lt;mistercaste@gmail.com&gt;:
&gt;
&gt; I tried the following code (a bit.. uh.. randomly), but it
&gt; doesn't seem to work.
&gt; I don't know how to relate the bounds with the rendering
&gt; transform.
&gt;
&gt; Â  Â private Rectangle getAOI() {
&gt; Â  Â  Â  Â AffineTransform rt = canvas.getRenderingTransform();
&gt; Â  Â  Â  Â double x = rt.getTranslateX();
&gt; Â  Â  Â  Â double y = rt.getTranslateY();
&gt; Â  Â  Â  Â double scaleX = rt.getScaleX();
&gt; Â  Â  Â  Â double scaleY = rt.getScaleY();
&gt;
&gt; Â  Â  Â  Â Rectangle myRect = canvas.getBounds();
&gt;
&gt; Â  Â  Â  Â myRect.setRect(
&gt; Â  Â  Â  Â  Â  Â  Â  Â cb.x * x,// X
&gt; Â  Â  Â  Â  Â  Â  Â  Â cb.y * y,// Y
&gt; Â  Â  Â  Â  Â  Â  Â  Â cb.width * scaleX,// Width
&gt; Â  Â  Â  Â  Â  Â  Â  Â cb.height * scaleY);// Height
&gt;
&gt; Â  Â  Â  Â return myRect;
&gt; Â  Â }
&gt; --
&gt; View this message in context: http://old.nabble.com/PDF-Transcoder-Zoom-tp26593852p26607629.html
&gt; Sent from the Batik - Users mailing list archive at Nabble.com.
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt;
&gt;



-- 
&gt;From my MacBook Pro

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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: PDF Transcoder Zoom</title>
<author><name>mistercaste &lt;mistercaste@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c26607629.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26607629-post@talk-nabble-com%3e</id>
<updated>2009-12-02T11:48:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

I tried the following code (a bit.. uh.. randomly), but it
doesn't seem to work.
I don't know how to relate the bounds with the rendering
transform.

    private Rectangle getAOI() {
        AffineTransform rt = canvas.getRenderingTransform();
        double x = rt.getTranslateX();
        double y = rt.getTranslateY();
        double scaleX = rt.getScaleX();
        double scaleY = rt.getScaleY();

        Rectangle myRect = canvas.getBounds();

        myRect.setRect(
                cb.x * x,// X
                cb.y * y,// Y
                cb.width * scaleX,// Width
                cb.height * scaleY);// Height

        return myRect;
    }
-- 
View this message in context: http://old.nabble.com/PDF-Transcoder-Zoom-tp26593852p26607629.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Batik Rasterizer Clarification</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOFFC170620.EADABF97-ON85257680.003C3B5F-85257680.003CAE67@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOFFC170620-EADABF97-ON85257680-003C3B5F-85257680-003CAE67@knotes-kodak-com%3e</id>
<updated>2009-12-02T11:02:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Nagabhushan,

Nagabhushan Sss &lt;nagabsss@in.ibm.com&gt; wrote on 12/02/2009 03:21:01 AM:

&gt; I know it is possible in Batik Rasterizer to produce image for a given
&gt; width and height.
&gt; Is there a way to calculate the size required to produce an image that 
is
&gt; rendered at actual size ?

    Care to define what 'actual size' means?

    In general SVG is resolution independent so the image _may_ 
have no 'actual size'.  I'm guessing this is not your case so you 
need to let us know why you think your documents have an actual size.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: PDF Transcoder Zoom</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOF14DE7721.3909DEC9-ON85257680.003B55EE-85257680.003C30A1@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOF14DE7721-3909DEC9-ON85257680-003B55EE-85257680-003C30A1@knotes-kodak-com%3e</id>
<updated>2009-12-02T10:57:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Mistercaste,

mistercaste &lt;mistercaste@gmail.com&gt; wrote on 12/01/2009 10:39:58 AM:

&gt; I need to transcode an SVG document inside my SVGCanvas out to a PDF.
&gt; Everything works great with the transcoder except if I zoom inside the
&gt; Canvas.
&gt; 
&gt; I don't know how to get the area of interest (AOI) Rectangle object that
&gt; I have to set as parameter in my transcoder. Any hint?

    You need to use the Canvas's rendering transform 
(getRenderingTransform) 
to map the canvas bounds to the svg document's coordinate system. 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: JavaDoc</title>
<author><name>mistercaste &lt;mistercaste@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c26605604.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26605604-post@talk-nabble-com%3e</id>
<updated>2009-12-02T09:04:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Here it is, I did it!! :-)

You can find it 
http://apache.fastbull.org/xml/commons/xml-commons-external-1.3.04-src.zip
here !

As general information source maybe it could be useful this page about "
http://xml.apache.org/mirrors.cgi Apache XML Projects Downloads ".

Good work, coders!






jonathan wood-3 wrote:
&gt; 
&gt; I'm not sure where the javadoc is, but the spec will get you far here:
&gt; 
&gt; http://www.w3.org/TR/SVG/types.html#BasicDOMInterfaces
&gt; 
&gt; good luck!
&gt; 
&gt; On Tue, Dec 1, 2009 at 11:42 AM, mistercaste &lt;mistercaste@gmail.com&gt;
&gt; wrote:
&gt; 
&gt;&gt;
&gt;&gt; Hi
&gt;&gt; I'm searching the org.w3c.dom.svg JavaDoc because a lot of Batik features
&gt;&gt; are based on this.
&gt;&gt; Is this part of the Batik project? Where can I find it?
&gt;&gt;
&gt;&gt; Thanks!
&gt;&gt; --
&gt;&gt; View this message in context:
&gt;&gt; http://old.nabble.com/JavaDoc-tp26594246p26594246.html
&gt;&gt; Sent from the Batik - Users mailing list archive at Nabble.com.
&gt;&gt;
&gt;&gt;
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt;&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt;&gt;
&gt;&gt;
&gt; 
&gt; 

-- 
View this message in context: http://old.nabble.com/JavaDoc-tp26594246p26605604.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Batik Rasterizer Clarification</title>
<author><name>Nagabhushan Sss &lt;nagabsss@in.ibm.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOF0BD832DB.6F7CAA35-ON65257680.002D3E6D-65257680.002E1349@in.ibm.com%3e"/>
<id>urn:uuid:%3cOF0BD832DB-6F7CAA35-ON65257680-002D3E6D-65257680-002E1349@in-ibm-com%3e</id>
<updated>2009-12-02T08:21:01Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi,

I am using the Batik Rasterizer to do conversion from svg to png/jpeg
image.
I know it is possible in Batik Rasterizer to produce image for a given
width and height.
Is there a way to calculate the size required to produce an image that is
rendered at actual size ?

Best Regards
Bhushan


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: JavaDoc</title>
<author><name>jonathan wood &lt;jonathanshawwood@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3ca1f2c5820912011126s70223234m2734055fd76c2444@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca1f2c5820912011126s70223234m2734055fd76c2444@mail-gmail-com%3e</id>
<updated>2009-12-01T19:26:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm not sure where the javadoc is, but the spec will get you far here:

http://www.w3.org/TR/SVG/types.html#BasicDOMInterfaces

good luck!

On Tue, Dec 1, 2009 at 11:42 AM, mistercaste &lt;mistercaste@gmail.com&gt; wrote:

&gt;
&gt; Hi
&gt; I'm searching the org.w3c.dom.svg JavaDoc because a lot of Batik features
&gt; are based on this.
&gt; Is this part of the Batik project? Where can I find it?
&gt;
&gt; Thanks!
&gt; --
&gt; View this message in context:
&gt; http://old.nabble.com/JavaDoc-tp26594246p26594246.html
&gt; Sent from the Batik - Users mailing list archive at Nabble.com.
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>JavaDoc</title>
<author><name>mistercaste &lt;mistercaste@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c26594246.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26594246-post@talk-nabble-com%3e</id>
<updated>2009-12-01T16:42:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi
I'm searching the org.w3c.dom.svg JavaDoc because a lot of Batik features
are based on this.
Is this part of the Batik project? Where can I find it?

Thanks!
-- 
View this message in context: http://old.nabble.com/JavaDoc-tp26594246p26594246.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOFE5854D82.4F2A2B3B-ON8525767F.0053AF49-8525767F.005A53F0@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOFE5854D82-4F2A2B3B-ON8525767F-0053AF49-8525767F-005A53F0@knotes-kodak-com%3e</id>
<updated>2009-12-01T16:26:38Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Olivier,

"HODAC, Olivier" &lt;OLIVIER.HODAC@airbus.com&gt; wrote on 12/01/2009 08:28:55 
AM:

&gt; Do you mean that if I set org.apache.batik.min_repaint_time=100ms 
&gt; (10 points a sec, this is my requirement) and I call the invokeLater
&gt; with higher frequency(say 50ms), batik will pile up the runnables in
&gt; the queue and poll them 10 times a second?

    Sort of, but not quite.

&gt; To better understand, in my example, the costfull redraw will be 
&gt; trigged each 100ms and will process 2 runnables each trig?

    Probably not.  The basic logic is as follows.
When a runnable is completed it checks if there is another runnable
ready to run.  If there isn't a runnable to run it updates the canvas.
If there is a runnable to run it checks how "out of date" the canvas
is, if it is greater than min repaint time then it will update the
canvas otherwise it will run the pending runnable.

&gt; Doing this, I will not have to implement the (un)suspensRedraw, is that 
true?

    Probably not, since I suspect that when the first runnable completes
there won't be another runnable waiting in the queue, so the update
manager will trigger the update.

&gt; 
&gt; De : thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
&gt; Envoyé : mardi 1 décembre 2009 12:09
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Cc : batik-users@xmlgraphics.apache.org
&gt; Objet : RE: SVG update performances over X11 export display
&gt; 
&gt; Hi HODAC, 
&gt; 
&gt; "HODAC, Olivier" &lt;OLIVIER.HODAC@airbus.com&gt; wrote on 11/30/2009 10:24:00 
AM:
&gt; 
&gt; &gt; When I suspendRedraw, my invokeLater calls piles up the runnables in
&gt; &gt; the runnableQueue. 
&gt; 
&gt;    This sounds like you are suspending the RunnableQueue not 
&gt; suspending Redraw.  When redraws are suspended the runnables should 
&gt; run as normal but the repaint operation should be skipped (dirty 
&gt; regions will accumulate). 
&gt; 
&gt; &gt; But when I release (unsuspend), what happends?
&gt; &gt; I suppose the update manager unpiles the runnables. Does the repaint
&gt; &gt; made only once when the queue is empty? It is not clear...
&gt; 
&gt;    When many runnables are submitted at once the UpdateManager 
&gt; will not repaint after every one but will repaint fairly frequently 
&gt; (~50FPS).  This behavior is controlled by the MIN_REPAINT_TIME in 
&gt; the UpdateManager which you can set with the property: 
&gt;          org.apache.batik.min_repaint_time 
&gt; 
&gt;     That said if you can 'logically' group the updates into sets 
&gt; then suspending redraw and re-enabling it is probably better. 
&gt; 
&gt; &gt; -----Message d'origine-----
&gt; &gt; De : Helder Magalhães [mailto:helder.magalhaes@gmail.com] 
&gt; &gt; Envoyé : lundi 30 novembre 2009 14:53
&gt; &gt; À : batik-users@xmlgraphics.apache.org
&gt; &gt; Objet : Re: SVG update performances over X11 export display
&gt; &gt; 
&gt; &gt; Hi Olivier,
&gt; &gt; 
&gt; &gt; 
&gt; &gt; &gt; Is there a way to do this with the batik framework:
&gt; &gt; &gt;
&gt; &gt; &gt; beginBatchModifications()
&gt; &gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; &gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; &gt; &gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; &gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; &gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; &gt; &gt; endBatch()
&gt; &gt; &gt;
&gt; &gt; &gt;
&gt; &gt; &gt; so that I will not have to manage my synchronized queue of 
&gt; &gt; runnable and ensure the repaint is performed by the endBatch?
&gt; &gt; 
&gt; &gt; Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
&gt; &gt; implements [2]. ;-)
&gt; &gt; 
&gt; &gt; 
&gt; &gt; Hope this helps,
&gt; &gt;  Helder
&gt; &gt; 
&gt; &gt; 
&gt; &gt; [1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces
&gt; &gt; [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/
&gt; &gt; dom/svg/SVGSVGContext.html
&gt; &gt; 
&gt; &gt; ---------------------------------------------------------------------
&gt; &gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; &gt; For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
&gt; &gt; 
&gt; &gt; 
&gt; &gt; This mail has originated outside your organization, either from an 
&gt; &gt; external partner or the Global Internet.
&gt; &gt; Keep this in mind if you answer this message.
&gt; &gt; 
&gt; &gt; 
&gt; &gt; 
&gt; &gt; 
&gt; &gt; The information in this e-mail is confidential. The contents may not
&gt; &gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; &gt; this e-mail by anyone else is unauthorised.
&gt; &gt; If you are not the intended recipient, please notify Airbus 
&gt; &gt; immediately and delete this e-mail.
&gt; &gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; &gt; completeness of this e-mail as it has been sent over public 
&gt; &gt; networks. If you have any concerns over the content of this message 
&gt; &gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; &gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; &gt; virus scanning software but you should take whatever measures you 
&gt; &gt; deem to be appropriate to ensure that this message and any 
&gt; &gt; attachments are virus free.
&gt; &gt; 
&gt; &gt; 
&gt; &gt; ---------------------------------------------------------------------
&gt; &gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; &gt; For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
&gt; &gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.



</pre>
</div>
</content>
</entry>
<entry>
<title>PDF Transcoder Zoom</title>
<author><name>mistercaste &lt;mistercaste@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c26593852.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c26593852-post@talk-nabble-com%3e</id>
<updated>2009-12-01T15:39:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi
I need to transcode an SVG document inside my SVGCanvas out to a PDF.
Everything works great with the transcoder except if I zoom inside the
Canvas.

I don't know how to get the area of interest (AOI) Rectangle object that
I have to set as parameter in my transcoder. Any hint?

Thank you!!


-- 
View this message in context: http://old.nabble.com/PDF-Transcoder-Zoom-tp26593852p26593852.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOFB286C129.791D3404-ON8525767F.00535413-8525767F.0053AB48@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOFB286C129-791D3404-ON8525767F-00535413-8525767F-0053AB48@knotes-kodak-com%3e</id>
<updated>2009-12-01T15:13:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Olivier,

"HODAC, Olivier" &lt;OLIVIER.HODAC@airbus.com&gt; wrote on 12/01/2009 08:23:17 
AM:

&gt; The double buffering trick seems to be a good lead. By giving me the
&gt; source classes, do you mean that I will have to modify the batik 
&gt; source code to turn off double buffering?

   You do not need to modify the code to turn off double buffering.
You can use JSVGCanvas.setDoubleBufferedRendering(false) - note that
this is quite different from turning off Swing's double buffering
(as you were doing in a different message).

   The real reason I pointed you at the code was because I give this
a small chance to fix your problem.  So you may need to play with
the code to discover a better fix.



&gt; De : thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
&gt; Envoyé : mardi 1 décembre 2009 12:27
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Cc : batik-users@xmlgraphics.apache.org
&gt; Objet : RE: SVG update performances over X11 export display
&gt; 
&gt; Hi Olivier, 
&gt; 
&gt; "HODAC, Olivier" &lt;OLIVIER.HODAC@airbus.com&gt; wrote on 12/01/2009 05:18:19 
AM:
&gt; 
&gt; &gt; I have very bad performances using batik to display and update a SVG
&gt; &gt; over a X11 export display. Is there any documentation to understand 
&gt; &gt; the policy of batik to do the repaint?
&gt; 
&gt;     No, aside from the source code. 
&gt; 
&gt; &gt; When I do a setAttribute style, for example, does batik repaints 
&gt; &gt; only the necessary part of the display (the rectangle surrounding 
&gt; &gt; the element)?
&gt; 
&gt;    Batik only updates the parts of the canvas that needs updating. 
&gt; 
&gt; &gt; If I have several layers, does batik repaints each one?
&gt; 
&gt;     The question is a bit unclear.  When Batik renders a rectangle it 
&gt; must repaint everything that intersects that rectangle - so if multiple 
&gt; 'layers' intersect that rectangle then they will all be repainted, 
within 
&gt; that rectangle.  In the end Batik only generates one update region for 
&gt; swing. 
&gt; 
&gt;     One thing that occurs to me that might be the cause of poor 
performance 
&gt; is the double buffering that Batik does.  It's possible that the JVM 
&gt; ends up sending the entire offscreen buffer to the client.  One thing 
&gt; that might help with that would be to try turning off double buffering 
in 
&gt; the Canvas. 
&gt; 
&gt;     The code that renders the Canvas is in 
batik.swing.gvt.JGVTComponent, 
&gt; the code that generates the swing updates is in 
batik.swing.svg.JSVGComponent 
&gt; (mostly updateCompleted callback). 
&gt; 
&gt;     I hope that helps. 
&gt; 
&gt; &gt; -----Message d'origine-----
&gt; &gt; De : HODAC, Olivier 
&gt; &gt; Envoyé : lundi 30 novembre 2009 16:24
&gt; &gt; À : batik-users@xmlgraphics.apache.org
&gt; &gt; Objet : RE: SVG update performances over X11 export display
&gt; &gt; 
&gt; &gt; Great!
&gt; &gt; 
&gt; &gt; I am watching the sources of Batik, but I cannot get the behaviour:
&gt; &gt; 
&gt; &gt; When I suspendRedraw, my invokeLater calls piles up the runnables in
&gt; &gt; the runnableQueue. But when I release (unsuspend), what happends?
&gt; &gt; I suppose the update manager unpiles the runnables. Does the repaint
&gt; &gt; made only once when the queue is empty? It is not clear...
&gt; &gt; 
&gt; &gt; -----Message d'origine-----
&gt; &gt; De : Helder Magalhães [mailto:helder.magalhaes@gmail.com] 
&gt; &gt; Envoyé : lundi 30 novembre 2009 14:53
&gt; &gt; À : batik-users@xmlgraphics.apache.org
&gt; &gt; Objet : Re: SVG update performances over X11 export display
&gt; &gt; 
&gt; &gt; Hi Olivier,
&gt; &gt; 
&gt; &gt; 
&gt; &gt; &gt; Is there a way to do this with the batik framework:
&gt; &gt; &gt;
&gt; &gt; &gt; beginBatchModifications()
&gt; &gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; &gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; &gt; &gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; &gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; &gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; &gt; &gt; endBatch()
&gt; &gt; &gt;
&gt; &gt; &gt;
&gt; &gt; &gt; so that I will not have to manage my synchronized queue of 
&gt; &gt; runnable and ensure the repaint is performed by the endBatch?
&gt; &gt; 
&gt; &gt; Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
&gt; &gt; implements [2]. ;-)
&gt; &gt; 
&gt; &gt; 
&gt; &gt; Hope this helps,
&gt; &gt;  Helder
&gt; &gt; 
&gt; &gt; 
&gt; &gt; [1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces
&gt; &gt; [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/
&gt; &gt; dom/svg/SVGSVGContext.html
&gt; &gt; 
&gt; &gt; ---------------------------------------------------------------------
&gt; &gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; &gt; For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
&gt; &gt; 
&gt; &gt; 
&gt; &gt; This mail has originated outside your organization, either from an 
&gt; &gt; external partner or the Global Internet.
&gt; &gt; Keep this in mind if you answer this message.
&gt; &gt; 
&gt; &gt; 
&gt; &gt; 
&gt; &gt; 
&gt; &gt; The information in this e-mail is confidential. The contents may not
&gt; &gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; &gt; this e-mail by anyone else is unauthorised.
&gt; &gt; If you are not the intended recipient, please notify Airbus 
&gt; &gt; immediately and delete this e-mail.
&gt; &gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; &gt; completeness of this e-mail as it has been sent over public 
&gt; &gt; networks. If you have any concerns over the content of this message 
&gt; &gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; &gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; &gt; virus scanning software but you should take whatever measures you 
&gt; &gt; deem to be appropriate to ensure that this message and any 
&gt; &gt; attachments are virus free.
&gt; &gt; 
&gt; &gt; 
&gt; &gt; ---------------------------------------------------------------------
&gt; &gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; &gt; For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
&gt; &gt; 
&gt; &gt; 
&gt; &gt; This mail has originated outside your organization, either from an 
&gt; &gt; external partner or the Global Internet.
&gt; &gt; Keep this in mind if you answer this message.
&gt; &gt; 
&gt; &gt; 
&gt; &gt; 
&gt; &gt; 
&gt; &gt; The information in this e-mail is confidential. The contents may not
&gt; &gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; &gt; this e-mail by anyone else is unauthorised.
&gt; &gt; If you are not the intended recipient, please notify Airbus 
&gt; &gt; immediately and delete this e-mail.
&gt; &gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; &gt; completeness of this e-mail as it has been sent over public 
&gt; &gt; networks. If you have any concerns over the content of this message 
&gt; &gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; &gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; &gt; virus scanning software but you should take whatever measures you 
&gt; &gt; deem to be appropriate to ensure that this message and any 
&gt; &gt; attachments are virus free.
&gt; &gt; 
&gt; &gt; 
&gt; &gt; ---------------------------------------------------------------------
&gt; &gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; &gt; For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
&gt; &gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>&quot;HODAC, Olivier&quot; &lt;OLIVIER.HODAC@airbus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c31682_1259676483_4B152343_31682_282_1_0471C9AC78F671458C5E3F9C69B73C8609C0261A@fr0-mailmb17.res.airbus.corp%3e"/>
<id>urn:uuid:%3c31682_1259676483_4B152343_31682_282_1_0471C9AC78F671458C5E3F9C69B73C8609C0261A@fr0-mailmb17-res-airbus-corp%3e</id>
<updated>2009-12-01T14:08:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Well, first feedback disabling the double buffering : ugly!

 

          javax.swing.RepaintManager.currentManager(null).setDoubleBufferingEnabled(false);

 

In display local or export mode, The canvas flikrs and beautiful white rects quickly appears.
It actually demonstrates that batik updates only the necessary parts, as the white rects are
over the regions to repaint.

 

I am wondering if JAVA is a good solution since I will export the display. Do you know an
other way to export the display of several linux stations on the same monitor?

 

I have several hosts that will compute the canvas, and my user needs to have the different
canvas on the same screen (side by side or on top of each other)

 

De : thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Envoyé : mardi 1 décembre 2009 12:27
À : batik-users@xmlgraphics.apache.org
Cc : batik-users@xmlgraphics.apache.org
Objet : RE: SVG update performances over X11 export display

 

Hi Olivier, 

"HODAC, Olivier" &lt;OLIVIER.HODAC@airbus.com&gt; wrote on 12/01/2009 05:18:19 AM:

&gt; I have very bad performances using batik to display and update a SVG
&gt; over a X11 export display. Is there any documentation to understand 
&gt; the policy of batik to do the repaint?

    No, aside from the source code. 

&gt; When I do a setAttribute style, for example, does batik repaints 
&gt; only the necessary part of the display (the rectangle surrounding 
&gt; the element)?

   Batik only updates the parts of the canvas that needs updating. 

&gt; If I have several layers, does batik repaints each one?

    The question is a bit unclear.  When Batik renders a rectangle it 
must repaint everything that intersects that rectangle - so if multiple 
'layers' intersect that rectangle then they will all be repainted, within 
that rectangle.  In the end Batik only generates one update region for 
swing. 

    One thing that occurs to me that might be the cause of poor performance 
is the double buffering that Batik does.  It's possible that the JVM 
ends up sending the entire offscreen buffer to the client.  One thing 
that might help with that would be to try turning off double buffering in 
the Canvas. 

    The code that renders the Canvas is in batik.swing.gvt.JGVTComponent, 
the code that generates the swing updates is in batik.swing.svg.JSVGComponent 
(mostly updateCompleted callback). 

    I hope that helps. 

&gt; -----Message d'origine-----
&gt; De : HODAC, Olivier 
&gt; Envoyé : lundi 30 novembre 2009 16:24
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Objet : RE: SVG update performances over X11 export display
&gt; 
&gt; Great!
&gt; 
&gt; I am watching the sources of Batik, but I cannot get the behaviour:
&gt; 
&gt; When I suspendRedraw, my invokeLater calls piles up the runnables in
&gt; the runnableQueue. But when I release (unsuspend), what happends?
&gt; I suppose the update manager unpiles the runnables. Does the repaint
&gt; made only once when the queue is empty? It is not clear...
&gt; 
&gt; -----Message d'origine-----
&gt; De : Helder Magalhães [mailto:helder.magalhaes@gmail.com &lt;mailto:helder.magalhaes@gmail.com&gt;
] 
&gt; Envoyé : lundi 30 novembre 2009 14:53
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Objet : Re: SVG update performances over X11 export display
&gt; 
&gt; Hi Olivier,
&gt; 
&gt; 
&gt; &gt; Is there a way to do this with the batik framework:
&gt; &gt;
&gt; &gt; beginBatchModifications()
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; &gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; &gt; endBatch()
&gt; &gt;
&gt; &gt;
&gt; &gt; so that I will not have to manage my synchronized queue of 
&gt; runnable and ensure the repaint is performed by the endBatch?
&gt; 
&gt; Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
&gt; implements [2]. ;-)
&gt; 
&gt; 
&gt; Hope this helps,
&gt;  Helder
&gt; 
&gt; 
&gt; [1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces &lt;http://www.w3.org/TR/SVG/struct.html#DOMInterfaces&gt;

&gt; [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ &lt;http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/&gt;

&gt; dom/svg/SVGSVGContext.html
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 
&gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 
&gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 

This mail has originated outside your organization, either from an external partner or the
Global Internet.
Keep this in mind if you answer this message.
 

The information in this e-mail is confidential. The contents may not be disclosed or used
by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as
it has been sent over public networks. If you have any concerns over the content of this message
or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software
but you should take whatever measures you deem to be appropriate to ensure that this message
and any attachments are virus free.



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>&quot;HODAC, Olivier&quot; &lt;OLIVIER.HODAC@airbus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c21679_1259674138_4B151A1A_21679_184_9_0471C9AC78F671458C5E3F9C69B73C8609C025FC@fr0-mailmb17.res.airbus.corp%3e"/>
<id>urn:uuid:%3c21679_1259674138_4B151A1A_21679_184_9_0471C9AC78F671458C5E3F9C69B73C8609C025FC@fr0-mailmb17-res-airbus-corp%3e</id>
<updated>2009-12-01T13:28:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Do you mean that if I set org.apache.batik.min_repaint_time=100ms (10 points a sec, this is
my requirement) and I call the invokeLater with higher frequency(say 50ms), batik will pile
up the runnables in the queue and poll them 10 times a second?

 

To better understand, in my example, the costfull redraw will be trigged each 100ms and will
process 2 runnables each trig?

 

Doing this, I will not have to implement the (un)suspensRedraw, is that true?

 

De : thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Envoyé : mardi 1 décembre 2009 12:09
À : batik-users@xmlgraphics.apache.org
Cc : batik-users@xmlgraphics.apache.org
Objet : RE: SVG update performances over X11 export display

 

Hi HODAC, 

"HODAC, Olivier" &lt;OLIVIER.HODAC@airbus.com&gt; wrote on 11/30/2009 10:24:00 AM:

&gt; When I suspendRedraw, my invokeLater calls piles up the runnables in
&gt; the runnableQueue. 

   This sounds like you are suspending the RunnableQueue not 
suspending Redraw.  When redraws are suspended the runnables should 
run as normal but the repaint operation should be skipped (dirty 
regions will accumulate). 

&gt; But when I release (unsuspend), what happends?
&gt; I suppose the update manager unpiles the runnables. Does the repaint
&gt; made only once when the queue is empty? It is not clear...

   When many runnables are submitted at once the UpdateManager 
will not repaint after every one but will repaint fairly frequently 
(~50FPS).  This behavior is controlled by the MIN_REPAINT_TIME in 
the UpdateManager which you can set with the property: 
         org.apache.batik.min_repaint_time 

    That said if you can 'logically' group the updates into sets 
then suspending redraw and re-enabling it is probably better. 

&gt; -----Message d'origine-----
&gt; De : Helder Magalhães [mailto:helder.magalhaes@gmail.com &lt;mailto:helder.magalhaes@gmail.com&gt;
] 
&gt; Envoyé : lundi 30 novembre 2009 14:53
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Objet : Re: SVG update performances over X11 export display
&gt; 
&gt; Hi Olivier,
&gt; 
&gt; 
&gt; &gt; Is there a way to do this with the batik framework:
&gt; &gt;
&gt; &gt; beginBatchModifications()
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; &gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; &gt; endBatch()
&gt; &gt;
&gt; &gt;
&gt; &gt; so that I will not have to manage my synchronized queue of 
&gt; runnable and ensure the repaint is performed by the endBatch?
&gt; 
&gt; Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
&gt; implements [2]. ;-)
&gt; 
&gt; 
&gt; Hope this helps,
&gt;  Helder
&gt; 
&gt; 
&gt; [1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces &lt;http://www.w3.org/TR/SVG/struct.html#DOMInterfaces&gt;

&gt; [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ &lt;http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/&gt;

&gt; dom/svg/SVGSVGContext.html
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 
&gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 

This mail has originated outside your organization, either from an external partner or the
Global Internet.
Keep this in mind if you answer this message.
 

The information in this e-mail is confidential. The contents may not be disclosed or used
by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as
it has been sent over public networks. If you have any concerns over the content of this message
or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software
but you should take whatever measures you deem to be appropriate to ensure that this message
and any attachments are virus free.



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>&quot;HODAC, Olivier&quot; &lt;OLIVIER.HODAC@airbus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c31148_1259673803_4B1518CB_31148_96_1_0471C9AC78F671458C5E3F9C69B73C8609C025F9@fr0-mailmb17.res.airbus.corp%3e"/>
<id>urn:uuid:%3c31148_1259673803_4B1518CB_31148_96_1_0471C9AC78F671458C5E3F9C69B73C8609C025F9@fr0-mailmb17-res-airbus-corp%3e</id>
<updated>2009-12-01T13:23:17Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The double buffering trick seems to be a good lead. By giving me the source classes, do you
mean that I will have to modify the batik source code to turn off double buffering?

 

De : thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Envoyé : mardi 1 décembre 2009 12:27
À : batik-users@xmlgraphics.apache.org
Cc : batik-users@xmlgraphics.apache.org
Objet : RE: SVG update performances over X11 export display

 

Hi Olivier, 

"HODAC, Olivier" &lt;OLIVIER.HODAC@airbus.com&gt; wrote on 12/01/2009 05:18:19 AM:

&gt; I have very bad performances using batik to display and update a SVG
&gt; over a X11 export display. Is there any documentation to understand 
&gt; the policy of batik to do the repaint?

    No, aside from the source code. 

&gt; When I do a setAttribute style, for example, does batik repaints 
&gt; only the necessary part of the display (the rectangle surrounding 
&gt; the element)?

   Batik only updates the parts of the canvas that needs updating. 

&gt; If I have several layers, does batik repaints each one?

    The question is a bit unclear.  When Batik renders a rectangle it 
must repaint everything that intersects that rectangle - so if multiple 
'layers' intersect that rectangle then they will all be repainted, within 
that rectangle.  In the end Batik only generates one update region for 
swing. 

    One thing that occurs to me that might be the cause of poor performance 
is the double buffering that Batik does.  It's possible that the JVM 
ends up sending the entire offscreen buffer to the client.  One thing 
that might help with that would be to try turning off double buffering in 
the Canvas. 

    The code that renders the Canvas is in batik.swing.gvt.JGVTComponent, 
the code that generates the swing updates is in batik.swing.svg.JSVGComponent 
(mostly updateCompleted callback). 

    I hope that helps. 

&gt; -----Message d'origine-----
&gt; De : HODAC, Olivier 
&gt; Envoyé : lundi 30 novembre 2009 16:24
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Objet : RE: SVG update performances over X11 export display
&gt; 
&gt; Great!
&gt; 
&gt; I am watching the sources of Batik, but I cannot get the behaviour:
&gt; 
&gt; When I suspendRedraw, my invokeLater calls piles up the runnables in
&gt; the runnableQueue. But when I release (unsuspend), what happends?
&gt; I suppose the update manager unpiles the runnables. Does the repaint
&gt; made only once when the queue is empty? It is not clear...
&gt; 
&gt; -----Message d'origine-----
&gt; De : Helder Magalhães [mailto:helder.magalhaes@gmail.com &lt;mailto:helder.magalhaes@gmail.com&gt;
] 
&gt; Envoyé : lundi 30 novembre 2009 14:53
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Objet : Re: SVG update performances over X11 export display
&gt; 
&gt; Hi Olivier,
&gt; 
&gt; 
&gt; &gt; Is there a way to do this with the batik framework:
&gt; &gt;
&gt; &gt; beginBatchModifications()
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; &gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; &gt; endBatch()
&gt; &gt;
&gt; &gt;
&gt; &gt; so that I will not have to manage my synchronized queue of 
&gt; runnable and ensure the repaint is performed by the endBatch?
&gt; 
&gt; Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
&gt; implements [2]. ;-)
&gt; 
&gt; 
&gt; Hope this helps,
&gt;  Helder
&gt; 
&gt; 
&gt; [1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces &lt;http://www.w3.org/TR/SVG/struct.html#DOMInterfaces&gt;

&gt; [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ &lt;http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/&gt;

&gt; dom/svg/SVGSVGContext.html
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 
&gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 
&gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 

This mail has originated outside your organization, either from an external partner or the
Global Internet.
Keep this in mind if you answer this message.
 

The information in this e-mail is confidential. The contents may not be disclosed or used
by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as
it has been sent over public networks. If you have any concerns over the content of this message
or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software
but you should take whatever measures you deem to be appropriate to ensure that this message
and any attachments are virus free.



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOF32A0D96B.8239AACB-ON8525767F.003D53CF-8525767F.003EEFB4@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOF32A0D96B-8239AACB-ON8525767F-003D53CF-8525767F-003EEFB4@knotes-kodak-com%3e</id>
<updated>2009-12-01T11:27:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Olivier,

"HODAC, Olivier" &lt;OLIVIER.HODAC@airbus.com&gt; wrote on 12/01/2009 05:18:19 
AM:

&gt; I have very bad performances using batik to display and update a SVG
&gt; over a X11 export display. Is there any documentation to understand 
&gt; the policy of batik to do the repaint?

    No, aside from the source code. 

&gt; When I do a setAttribute style, for example, does batik repaints 
&gt; only the necessary part of the display (the rectangle surrounding 
&gt; the element)?

   Batik only updates the parts of the canvas that needs updating.

&gt; If I have several layers, does batik repaints each one?

    The question is a bit unclear.  When Batik renders a rectangle it
must repaint everything that intersects that rectangle - so if multiple
'layers' intersect that rectangle then they will all be repainted, within
that rectangle.  In the end Batik only generates one update region for
swing.

    One thing that occurs to me that might be the cause of poor 
performance
is the double buffering that Batik does.  It's possible that the JVM
ends up sending the entire offscreen buffer to the client.  One thing
that might help with that would be to try turning off double buffering in
the Canvas.

    The code that renders the Canvas is in batik.swing.gvt.JGVTComponent, 
the code that generates the swing updates is in 
batik.swing.svg.JSVGComponent 
(mostly updateCompleted callback).

    I hope that helps.

&gt; -----Message d'origine-----
&gt; De : HODAC, Olivier 
&gt; Envoyé : lundi 30 novembre 2009 16:24
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Objet : RE: SVG update performances over X11 export display
&gt; 
&gt; Great!
&gt; 
&gt; I am watching the sources of Batik, but I cannot get the behaviour:
&gt; 
&gt; When I suspendRedraw, my invokeLater calls piles up the runnables in
&gt; the runnableQueue. But when I release (unsuspend), what happends?
&gt; I suppose the update manager unpiles the runnables. Does the repaint
&gt; made only once when the queue is empty? It is not clear...
&gt; 
&gt; -----Message d'origine-----
&gt; De : Helder Magalhães [mailto:helder.magalhaes@gmail.com] 
&gt; Envoyé : lundi 30 novembre 2009 14:53
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Objet : Re: SVG update performances over X11 export display
&gt; 
&gt; Hi Olivier,
&gt; 
&gt; 
&gt; &gt; Is there a way to do this with the batik framework:
&gt; &gt;
&gt; &gt; beginBatchModifications()
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; &gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; &gt; endBatch()
&gt; &gt;
&gt; &gt;
&gt; &gt; so that I will not have to manage my synchronized queue of 
&gt; runnable and ensure the repaint is performed by the endBatch?
&gt; 
&gt; Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
&gt; implements [2]. ;-)
&gt; 
&gt; 
&gt; Hope this helps,
&gt;  Helder
&gt; 
&gt; 
&gt; [1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces
&gt; [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/
&gt; dom/svg/SVGSVGContext.html
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 
&gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 
&gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOFB0395732.034AE500-ON8525767F.003C89AC-8525767F.003D4844@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOFB0395732-034AE500-ON8525767F-003C89AC-8525767F-003D4844@knotes-kodak-com%3e</id>
<updated>2009-12-01T11:09:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi HODAC,

"HODAC, Olivier" &lt;OLIVIER.HODAC@airbus.com&gt; wrote on 11/30/2009 10:24:00 
AM:

&gt; When I suspendRedraw, my invokeLater calls piles up the runnables in
&gt; the runnableQueue.

   This sounds like you are suspending the RunnableQueue not
suspending Redraw.  When redraws are suspended the runnables should
run as normal but the repaint operation should be skipped (dirty
regions will accumulate).

&gt; But when I release (unsuspend), what happends?
&gt; I suppose the update manager unpiles the runnables. Does the repaint
&gt; made only once when the queue is empty? It is not clear...

   When many runnables are submitted at once the UpdateManager
will not repaint after every one but will repaint fairly frequently
(~50FPS).  This behavior is controlled by the MIN_REPAINT_TIME in
the UpdateManager which you can set with the property:
         org.apache.batik.min_repaint_time

    That said if you can 'logically' group the updates into sets
then suspending redraw and re-enabling it is probably better.

&gt; -----Message d'origine-----
&gt; De : Helder Magalhães [mailto:helder.magalhaes@gmail.com] 
&gt; Envoyé : lundi 30 novembre 2009 14:53
&gt; À : batik-users@xmlgraphics.apache.org
&gt; Objet : Re: SVG update performances over X11 export display
&gt; 
&gt; Hi Olivier,
&gt; 
&gt; 
&gt; &gt; Is there a way to do this with the batik framework:
&gt; &gt;
&gt; &gt; beginBatchModifications()
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; &gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; &gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; &gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; &gt; endBatch()
&gt; &gt;
&gt; &gt;
&gt; &gt; so that I will not have to manage my synchronized queue of 
&gt; runnable and ensure the repaint is performed by the endBatch?
&gt; 
&gt; Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
&gt; implements [2]. ;-)
&gt; 
&gt; 
&gt; Hope this helps,
&gt;  Helder
&gt; 
&gt; 
&gt; [1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces
&gt; [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/
&gt; dom/svg/SVGSVGContext.html
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 
&gt; 
&gt; This mail has originated outside your organization, either from an 
&gt; external partner or the Global Internet.
&gt; Keep this in mind if you answer this message.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; The information in this e-mail is confidential. The contents may not
&gt; be disclosed or used by anyone other than the addressee. Access to 
&gt; this e-mail by anyone else is unauthorised.
&gt; If you are not the intended recipient, please notify Airbus 
&gt; immediately and delete this e-mail.
&gt; Airbus cannot accept any responsibility for the accuracy or 
&gt; completeness of this e-mail as it has been sent over public 
&gt; networks. If you have any concerns over the content of this message 
&gt; or its Accuracy or Integrity, please contact Airbus immediately.
&gt; All outgoing e-mails from Airbus are checked using regularly updated
&gt; virus scanning software but you should take whatever measures you 
&gt; deem to be appropriate to ensure that this message and any 
&gt; attachments are virus free.
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
&gt; For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: JPEGTranscoder throwing NullPointerException</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOFE947F2F8.0523CD7E-ON8525767F.003C444C-8525767F.003C74B2@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOFE947F2F8-0523CD7E-ON8525767F-003C444C-8525767F-003C74B2@knotes-kodak-com%3e</id>
<updated>2009-12-01T11:00:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Shekhar,

Shekhar Bhati &lt;shekhar.bhati@gmail.com&gt; wrote on 11/27/2009 12:14:46 AM:

&gt; We have functionality of printing the image and we are using
&gt; JPEGTranscoder for that.
&gt; We are facing an issue that the JPEGTranscoder.transcode is throwing
&gt; NullPointerExcpetion we try it on Solaris/AIX environment.
&gt; Is it a known issue?

    No.

&gt; Please suggest how to handle this problem.

    Provide some real information on the problem, like
the actual stack trace, or a stand-alone example of the
problem.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Dynamic addition of scripts to SVG in Batik</title>
<author><name>thomas.deweese@kodak.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3cOFF2BCCE93.D3FA9CB4-ON8525767F.003C01BC-8525767F.003C3A44@knotes.kodak.com%3e"/>
<id>urn:uuid:%3cOFF2BCCE93-D3FA9CB4-ON8525767F-003C01BC-8525767F-003C3A44@knotes-kodak-com%3e</id>
<updated>2009-12-01T10:57:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Tanul,

Tanul &lt;smart.pccs@gmail.com&gt; wrote on 11/24/2009 01:55:07 PM:

&gt; I am trying to update the ecma script in the SVG document at runtime. 
i.e.
&gt; the content of the &lt;script&gt;&lt;/script&gt; tag is updated during the course of
&gt; execution of the application.
&gt; 
&gt; Even after updating/adding the &lt;script&gt; tag, the updated script is not
&gt; available for execution.

    I'm not sure we support 'updating' but if you add a new script
element Batik should execute the code it contains.

&gt; Is it possible to update the scripts dynamically using batik? 

    I have done it in the past.  If you can produce a stand alone
example of the problem it might help figure out what the problem is.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: SVG update performances over X11 export display</title>
<author><name>=?ISO-8859-1?Q?Helder_Magalh=E3es?= &lt;helder.magalhaes@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c2a1ddf8a0912010241l5114fe6eu59ef29e11bcdf017@mail.gmail.com%3e"/>
<id>urn:uuid:%3c2a1ddf8a0912010241l5114fe6eu59ef29e11bcdf017@mail-gmail-com%3e</id>
<updated>2009-12-01T10:41:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Olivier,


&gt; I have very bad performances using batik to display and update a SVG over a X11 export
display.

I don't know about the internals of X11 export display, but I can
imagine that would be close to Remote Desktop and/or VNC, possibly
more efficient. But given that Java ultimately deals with buffered
images(bitmaps) I guess the X11 export's potential efficiency,
regarding vector operations, is kinda chopped down (please correct me
if I'm wrong!)... It might be possible to implement Batik rendering
directly using X11 primitive operations, which would then take
advantage of the X11 export display, but that would probably be a
crazy project (in terms of the amount of work and required Batik
refactoring)! :-D


&gt; Is there any documentation to understand the policy of batik to do the repaint?

You may take a look at the Batik architecture [1], but that's only a
starting point. The repaint internals are likely within the GVT
module, but I'm not sure if, else than the Javadoc (and the source
code itself, naturally), more documentation is available...


&gt; When I do a setAttribute style, for example, does batik repaints only the necessary
&gt; part of the display (the rectangle surrounding the element)?

That should be the case.


&gt; If I have several layers, does batik repaints each one?

I guess not. As far as I know, the repaint is made by areas so, if you
update the several layers in a single operation -- or using a batch
operation with the already stated (un)suspendRedraw -- than a single
repaint would be expected.


Thomas is the GVT expert [2] so he may be able to shed some light
here; as for me, this is hitting the limit of my current Batik
internals knowledge, so I really doubt I can provide much more useful
information.


As a side note, why not place some debug output in the repaint classes
and check what Batik is doing for yourself...? ;-)


Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/architecture.html
[2] http://xmlgraphics.apache.org/batik/contributors.html#expertise

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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>&quot;HODAC, Olivier&quot; &lt;OLIVIER.HODAC@airbus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c24326_1259662721_4B14ED81_24326_232_3_0471C9AC78F671458C5E3F9C69B73C8609C025A5@fr0-mailmb17.res.airbus.corp%3e"/>
<id>urn:uuid:%3c24326_1259662721_4B14ED81_24326_232_3_0471C9AC78F671458C5E3F9C69B73C8609C025A5@fr0-mailmb17-res-airbus-corp%3e</id>
<updated>2009-12-01T10:18:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello,

I have very bad performances using batik to display and update a SVG over a X11 export display.
Is there any documentation to understand the policy of batik to do the repaint?

When I do a setAttribute style, for example, does batik repaints only the necessary part of
the display (the rectangle surrounding the element)?
If I have several layers, does batik repaints each one?
Etc...

-----Message d'origine-----
De : HODAC, Olivier 
Envoyé : lundi 30 novembre 2009 16:24
À : batik-users@xmlgraphics.apache.org
Objet : RE: SVG update performances over X11 export display

Great!

I am watching the sources of Batik, but I cannot get the behaviour:

When I suspendRedraw, my invokeLater calls piles up the runnables in the runnableQueue. But
when I release (unsuspend), what happends?
I suppose the update manager unpiles the runnables. Does the repaint made only once when the
queue is empty? It is not clear...

-----Message d'origine-----
De : Helder Magalhães [mailto:helder.magalhaes@gmail.com] 
Envoyé : lundi 30 novembre 2009 14:53
À : batik-users@xmlgraphics.apache.org
Objet : Re: SVG update performances over X11 export display

Hi Olivier,


&gt; Is there a way to do this with the batik framework:
&gt;
&gt; beginBatchModifications()
&gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; endBatch()
&gt;
&gt;
&gt; so that I will not have to manage my synchronized queue of runnable and ensure the repaint
is performed by the endBatch?

Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
implements [2]. ;-)


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces
[2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/dom/svg/SVGSVGContext.html

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


This mail has originated outside your organization, either from an external partner or the
Global Internet.
Keep this in mind if you answer this message.




The information in this e-mail is confidential. The contents may not be disclosed or used
by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as
it has been sent over public networks. If you have any concerns over the content of this message
or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software
but you should take whatever measures you deem to be appropriate to ensure that this message
and any attachments are virus free.


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


This mail has originated outside your organization, either from an external partner or the
Global Internet.
Keep this in mind if you answer this message.




The information in this e-mail is confidential. The contents may not be disclosed or used
by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as
it has been sent over public networks. If you have any concerns over the content of this message
or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software
but you should take whatever measures you deem to be appropriate to ensure that this message
and any attachments are virus free.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>&quot;HODAC, Olivier&quot; &lt;OLIVIER.HODAC@airbus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200911.mbox/%3c21337_1259594639_4B13E38F_21337_280_2_0471C9AC78F671458C5E3F9C69B73C8609C024B9@fr0-mailmb17.res.airbus.corp%3e"/>
<id>urn:uuid:%3c21337_1259594639_4B13E38F_21337_280_2_0471C9AC78F671458C5E3F9C69B73C8609C024B9@fr0-mailmb17-res-airbus-corp%3e</id>
<updated>2009-11-30T15:24:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Great!

I am watching the sources of Batik, but I cannot get the behaviour:

When I suspendRedraw, my invokeLater calls piles up the runnables in the runnableQueue. But
when I release (unsuspend), what happends?
I suppose the update manager unpiles the runnables. Does the repaint made only once when the
queue is empty? It is not clear...

-----Message d'origine-----
De : Helder Magalhães [mailto:helder.magalhaes@gmail.com] 
Envoyé : lundi 30 novembre 2009 14:53
À : batik-users@xmlgraphics.apache.org
Objet : Re: SVG update performances over X11 export display

Hi Olivier,


&gt; Is there a way to do this with the batik framework:
&gt;
&gt; beginBatchModifications()
&gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; endBatch()
&gt;
&gt;
&gt; so that I will not have to manage my synchronized queue of runnable and ensure the repaint
is performed by the endBatch?

Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
implements [2]. ;-)


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces
[2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/dom/svg/SVGSVGContext.html

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


This mail has originated outside your organization, either from an external partner or the
Global Internet.
Keep this in mind if you answer this message.




The information in this e-mail is confidential. The contents may not be disclosed or used
by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as
it has been sent over public networks. If you have any concerns over the content of this message
or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software
but you should take whatever measures you deem to be appropriate to ensure that this message
and any attachments are virus free.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: SVG update performances over X11 export display</title>
<author><name>=?ISO-8859-1?Q?Helder_Magalh=E3es?= &lt;helder.magalhaes@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200911.mbox/%3c2a1ddf8a0911300553l73276535lf2714af55afabb9d@mail.gmail.com%3e"/>
<id>urn:uuid:%3c2a1ddf8a0911300553l73276535lf2714af55afabb9d@mail-gmail-com%3e</id>
<updated>2009-11-30T13:53:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Olivier,


&gt; Is there a way to do this with the batik framework:
&gt;
&gt; beginBatchModifications()
&gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
&gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
&gt; thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
&gt; thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
&gt; thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
&gt; endBatch()
&gt;
&gt;
&gt; so that I will not have to manage my synchronized queue of runnable and ensure the repaint
is performed by the endBatch?

Well, SVG has the "(un)suspendRedraw" [1] methods, which Batik
implements [2]. ;-)


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces
[2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/dom/svg/SVGSVGContext.html

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



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: SVG update performances over X11 export display</title>
<author><name>&quot;HODAC, Olivier&quot; &lt;OLIVIER.HODAC@airbus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200911.mbox/%3c25189_1259577353_4B13A009_25189_11_5_0471C9AC78F671458C5E3F9C69B73C8609C02406@fr0-mailmb17.res.airbus.corp%3e"/>
<id>urn:uuid:%3c25189_1259577353_4B13A009_25189_11_5_0471C9AC78F671458C5E3F9C69B73C8609C02406@fr0-mailmb17-res-airbus-corp%3e</id>
<updated>2009-11-30T10:35:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Of course...

Actually, I have several concurrent threads that wants to modify the document (by delegating
the modification to the UpdateRunnableQueue)

Is there a way to do this with the batik framework:

beginBatchModifications()
thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable1)
thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable2)
thread3 -&gt; getUpdateRunnableQueue().invokeLater(runnable3)
thread2 -&gt; getUpdateRunnableQueue().invokeLater(runnable4)
thread1 -&gt; getUpdateRunnableQueue().invokeLater(runnable5)
endBatch()


so that I will not have to manage my synchronized queue of runnable and ensure the repaint
is performed by the endBatch?

-----Message d'origine-----
De : Helder Magalhães [mailto:helder.magalhaes@gmail.com] 
Envoyé : lundi 30 novembre 2009 11:07
À : batik-users@xmlgraphics.apache.org
Objet : Re: SVG update performances over X11 export display

Hi Olivier,


&gt; I modify the
&gt; document in the thread
&gt;
&gt; getUpdateManager().getUpdateRunnableQueue().invokeLater

Good, this is the recommended way [1] for doing it. :-)


&gt; but I have several elements to change, and for the moment, I do a lot of
&gt; invokeLater. In my local machine, it runs very well. I try an export display
&gt; (linux, rhel) and the performances are completely degraded.
&gt;
&gt; Is there a best practice to have good performances with X11 export display?
&gt;
&gt; Of course, I'll first try to make 1 big invokeLater, unless somebody says it
&gt; is pointless...

I haven't tried to profile myself but making a big document updates is
intuitively quicker: it will cause less document repaints. This
performance benefits is expected independently of hardware/platform,
but naturally it will be noticed whenever there's a bottleneck (in
this case, apparently the display export).

I'm convinced you'll find related posts within the mailing list archives. ;-)


Regards,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/scripting/java.html

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


This mail has originated outside your organization, either from an external partner or the
Global Internet.
Keep this in mind if you answer this message.




The information in this e-mail is confidential. The contents may not be disclosed or used
by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as
it has been sent over public networks. If you have any concerns over the content of this message
or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software
but you should take whatever measures you deem to be appropriate to ensure that this message
and any attachments are virus free.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: SVG update performances over X11 export display</title>
<author><name>=?ISO-8859-1?Q?Helder_Magalh=E3es?= &lt;helder.magalhaes@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200911.mbox/%3c2a1ddf8a0911300207v109fbc97m8c95ad5636ac9757@mail.gmail.com%3e"/>
<id>urn:uuid:%3c2a1ddf8a0911300207v109fbc97m8c95ad5636ac9757@mail-gmail-com%3e</id>
<updated>2009-11-30T10:07:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Olivier,


&gt; I modify the
&gt; document in the thread
&gt;
&gt; getUpdateManager().getUpdateRunnableQueue().invokeLater

Good, this is the recommended way [1] for doing it. :-)


&gt; but I have several elements to change, and for the moment, I do a lot of
&gt; invokeLater. In my local machine, it runs very well. I try an export display
&gt; (linux, rhel) and the performances are completely degraded.
&gt;
&gt; Is there a best practice to have good performances with X11 export display?
&gt;
&gt; Of course, I’ll first try to make 1 big invokeLater, unless somebody says it
&gt; is pointless...

I haven't tried to profile myself but making a big document updates is
intuitively quicker: it will cause less document repaints. This
performance benefits is expected independently of hardware/platform,
but naturally it will be noticed whenever there's a bottleneck (in
this case, apparently the display export).

I'm convinced you'll find related posts within the mailing list archives. ;-)


Regards,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/scripting/java.html

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



</pre>
</div>
</content>
</entry>
<entry>
<title>SVG update performances over X11 export display</title>
<author><name>&quot;HODAC, Olivier&quot; &lt;OLIVIER.HODAC@airbus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200911.mbox/%3c19553_1259573132_4B138F8C_19553_80_7_0471C9AC78F671458C5E3F9C69B73C8609C023C7@fr0-mailmb17.res.airbus.corp%3e"/>
<id>urn:uuid:%3c19553_1259573132_4B138F8C_19553_80_7_0471C9AC78F671458C5E3F9C69B73C8609C023C7@fr0-mailmb17-res-airbus-corp%3e</id>
<updated>2009-11-30T09:25:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello,

I've written a little mokeup of an animated SVG application. I modify
the document in the thread

getUpdateManager().getUpdateRunnableQueue().invokeLater

but I have several elements to change, and for the moment, I do a lot of
invokeLater. In my local machine, it runs very well. I try an export
display (linux, rhel) and the performances are completely degraded.

Is there a best practice to have good performances with X11 export
display?

Of course, I'll first try to make 1 big invokeLater, unless somebody
says it is pointless...

Olivier Dao Ho Dac
Flight Test Software Architect
Airbus - EVIDA

Phone : + 33 (0)5 67 19 81 34
Fax : +33(0)5 61 93 80 02
Mailto:olivier.hodac@airbus.com




The information in this e-mail is confidential. The contents may not be disclosed or used
by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as
it has been sent over public networks. If you have any concerns over the content of this message
or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software
but you should take whatever measures you deem to be appropriate to ensure that this message
and any attachments are virus free.



</pre>
</div>
</content>
</entry>
</feed>
