RE: Minimum acceptable/desired Java version and related thoughts
Idem, OK to raise -Message d'origine- De : A.J.Brasher [mailto:a.j.bras...@open.ac.uk] Envoyé : lundi 8 novembre 2010 10:51 À : 'batik-users@xmlgraphics.apache.org' Objet : RE: Minimum acceptable/desired Java version and related thoughts I'm also running 1.6 so another vote for raising min version to Java 1.5. Andrew -Original Message- From: Tonny Kohar [mailto:tonny.ko...@gmail.com] Sent: 08 November 2010 04:04 To: batik-users@xmlgraphics.apache.org Subject: Re: Minimum acceptable/desired Java version and related thoughts Hi, 2010/11/7 Helder Magalhães helder.magalh...@gmail.com: In the scope of bug 46434 [1], I believe it was highly desired to have user feedback about this. To sum up, the question is which Java version are you using and/or, tightly related, whether you'd agree to raise the minimum version to Java 1.5. For me, I am running Java 6 (1.6). so +1 for raising minimum ver to 1.5 FYI, Java 5 is already end of life as well, http://java.sun.com/j2se/1.5/ Cheers Tonny Kohar -- Sketsa SVG Editor imagine, design, create ... http://www.kiyut.com - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org -- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England Wales and a charity registered in Scotland (SC 038302). - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
RE: coordinate conversion
OK, I'll give it a try I thought I missed something, but it is not straightforward at all! Do you think it will be costfull if ran on each mouse move? I want that my user can click an element of the canvas and move it in a different location. And I want the canvas updated during the mousemove so that he can see the result in real time De : jonathan wood [mailto:jonathanshaww...@gmail.com] Envoyé : lundi 1 mars 2010 04:03 À : batik-users@xmlgraphics.apache.org Objet : Re: coordinate conversion Most of what you need can be found in SVGLocatable. The below is not tested, but should be close: Point awtPoint = ...; Element myEl = document.getElementById(my-el); SVGPoint svgPoint = document.getRootElement.createSVGPoint(); svgPoint.setX(awtPoint.getX()); svgPoint.setY(awtPoint.getY()); SVGMatrix m = ((SVGLocatable)myEl).getScreenCTM(); m = m.inverse(); svgPoint = svgPoint.matrixTransform(m); On Fri, Feb 26, 2010 at 8:34 AM, dao dao.ho...@gmail.com wrote: hello, Sorry for this stupid question: how do I transform coordinates from a AWT mouse event to the coordinates in the svg file the canvas represents? I mean, I have a panel with the canvas (rotated, zoomed, panned in the worst case) and I want to know the coordinates of the svg point my mouse cursor is pointing. -- Dao Hodac 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.
RE: appending a child element in a document
I found a solution to make this work with your information I want to underline that the valuable/quick support/advice of this mail list I would have dropped the batik solution. And it certainly would have been a big mistake! So, I add a rendering listener addGVTTreeRendererListener(new GVTTreeRendererAdapter() { public void gvtRenderingCompleted(GVTTreeRendererEvent arg0) { SvgRepaintEngine.getInstance().renderingComplete(); } }); And my SvgRepaintEngine does this: public void push(final UpdateTask todo) { ...wait canvas initialized (by GVTTreeBuildComplete)... if (useUpdateQueue) { canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new Runnable() { public void run() { todo.doit(canvas.getSVGDocument()); //modifies the document } }); } else { todo.doit(canvas.getSVGDocument()); //directly modifies the document } ...calls the remote clients... } public void renderingComplete() { useUpdateQueue = true; } It seems to work. Like you said, I will merge the UpdateTasks to make bundles and modify coherent parts in 1 runnable De : thomas.dewe...@kodak.com [mailto:thomas.dewe...@kodak.com] Envoyé : mardi 12 janvier 2010 12:24 À : batik-users@xmlgraphics.apache.org Cc : batik-users@xmlgraphics.apache.org Objet : Re: appending a child element in a document Hi Dao, dao dao.ho...@gmail.com wrote on 01/11/2010 05:45:08 PM: I put my batik canvas in a panel, that I put in a frame. I have 2 modes. the frame is visible or not (because it is a server which can display locally or remotely. In this last case, I don't want to draw the frame) at the beginning of the process (ie after the treebuild complete) I want to append a child to a node of the document. If I have a local frame (setVisible(true)), I do this and it works fine: the element getMaskLayer().appendChild(mask); canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new Runnable() { public void run() { mask.setAttribute(style, display:none); } });; but when I put if I run the program with frame.setVisible(false), and I dump the document, I do not have the style attribute set. So, why the setVisible influences the behavior? Because the UpdateManager is only started after the first rendering of the SVG document completes. If the canvas isn't visible there isn't a first rendering. FYI Then, I decided to do this: canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new Runnable() { public void run() { getMaskLayer().appendChild(mask); mask.setAttribute(style, display:none); } });; In this case, the element is not appended. I dump the document doing this several seconds after the call is performed Right because the UpdateManager isn't started until after the document is rendered for the first time. The question is what should you do? The answer is I don't know, I think it's exactly right that a non-visible SVG Canvas doesn't do anything. 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.
RE: animate an element
Hello, Are you talking about this? ((SVGOMAnimationElement)anim).beginElement(); In this case, what's the best practice? It has to be called within a runnable of the runnableQueue of the canvas? Is that the right cast? De : thomas.dewe...@kodak.com [mailto:thomas.dewe...@kodak.com] Envoyé : mardi 12 janvier 2010 12:29 À : batik-users@xmlgraphics.apache.org Cc : batik-users@xmlgraphics.apache.org Objet : Re: animate an element Hi Dao, dao dao.ho...@gmail.com wrote on 01/12/2010 06:06:53 AM: you mean that I have to set all the attributes in the same runnable? of the updaterunnablequeue? If you don't set all the attributes in the same runnable then Batik is free to trigger a rendering between them. This is very likely to cause odd behavior. Additionally, there is non-trivial overhead associated with running a runnable, so having a runnable set just one attribute will add significant overhead. I'd suggest simply adding a 'submit' method to your SvgRepainEngine that submits one Runnable with the list of 'Task' objects you have pushed since the last call to 'submit'. On Tue, Jan 12, 2010 at 11:56 AM, thomas.dewe...@kodak.com wrote: Hi Dao, dao dao.ho...@gmail.com wrote on 01/11/2010 06:22:58 PM: Actually, I created the anim elements with the namespace http://www.w3.org/2000/svg http://www.w3.org/2000/svg . It is in fact null... how can I know which element belongs to which namespace? Attributes that don't have a prefix (i.e. xlink:) should be in the null namespace. Attributes that have a prefix should be in the namespace associated with that prefix. In SVG this means that essentially only the xlink attributes need namespaces. But when I do this public void setVisible(final Element elt, boolean b) { final Element mask = elt2mask.get(elt); if (mask == null) return; Element anim = (Element) mask.getElementsByTagNameNS(null, animate).item(0); String animId = anim.getAttribute(id); if (b) { SvgRepaintEngine.getInstance().push(new AttributeUpdateTask (mask.getAttribute( id),opacity, 1)); SvgRepaintEngine.getInstance().push(new AttributeUpdateTask(animId, from, 0)); SvgRepaintEngine.getInstance().push(new AttributeUpdateTask (animId, to, 1 )); } else { SvgRepaintEngine.getInstance().push(new AttributeUpdateTask (mask.getAttribute( id),opacity, 0)); SvgRepaintEngine.getInstance().push(new AttributeUpdateTask(animId, from, 1)); SvgRepaintEngine.getInstance().push(new AttributeUpdateTask (animId, to, 0 )); } the animation does not perform, and the opacity changes immediately (I tried to remove the first change) I think this is because you haven't started the animation, probably by calling 'beginElement()' in your case. Note that the SvgRepaintEngine only calls the invokeLater of the update manager to make a setAttribute You _really_ should have a way to bundle those changes together, you could get strange results if a repaint started in between some of those set attribute calls. On Sat, Jan 9, 2010 at 2:58 PM, thomas.dewe...@kodak.com wrote: Hi Dao, dao dao.ho...@gmail.com wrote on 01/06/2010 09:17:33 AM: hello, I am running into a problem while attempting to animate an object. I create an animation object using batik and I add this to my ALWAYS_DYNAMIC canvas. The dump of the XML is like that after the append: What do you get if you call: String an = animateElem.getAttributeNS(null, attributeName); I see that in your 'dump' it looks OK, but the dump can easly not represent the details of the DOM in memory. Can you post the code you use to create the animate element? I get this exception. What's wrong with me? org.apache.batik.bridge.BridgeException: file:/C:/Users/to81028/ runtime-EclipseApplication/aet/image/toto.svg:0 The attribute of the element g is not animatable at This means that in the animation bridge the getAttributeNS call above is returning either null or (not entirely sure which). Are you perhaps appending the element before setting all of it's attributes? org.apache.batik.bridge.SVGAnimationElementBridge.initializeAnimation (SVGAnimationElementBridge.java:213) at org.apache.batik.bridge.SVGAnimationElementBridge.handleElement (SVGAnimationElementBridge.java:154) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode (GVTBuilder.java:198) at org.apache.batik.bridge.GVTBuilder.buildComposite (GVTBuilder.java:171) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode (GVTBuilder.java:219) ... -- Dao Hodac -- Dao Hodac -- Dao Hodac 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
RE: create a JSVGCanvas from an inputstream
Hi, I have tried your suggestion, but for the moment, it fails. I have created the document like this. Note that panel.svg does not exist: private static final String DOC_URI = jar:file://panel.svg; ... String xmlDocument = remoteEngine.getSvgDocument(); ByteArrayInputStream bais = new ByteArrayInputStream(xmlDocument.getBytes()); String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); return f.createDocument(DOC_URI, bais); In my jar (I run with: java -cp theJar.jar ...), I have a widget.svg file at the root if the folder structure. I get this error: Unable to make sense of URL for connection (since I want to use a symbol set in the file widget.svg) Is there a problem with the URI? De : thomas.dewe...@kodak.com [mailto:thomas.dewe...@kodak.com] Envoyé : lundi 4 janvier 2010 12:27 À : batik-users@xmlgraphics.apache.org Cc : batik-users@xmlgraphics.apache.org Objet : Re: create a JSVGCanvas from an inputstream Hi Dao, dao dao.ho...@gmail.com wrote on 01/02/2010 05:33:04 PM: I understand, but how can I refer to that document in an other document? (see the xlink:href from my mail)? After you have created your document from an InputStream you can set the base URL for the document. There are two ways to do this, the 'xml:base' attribute or by calling batik.dom.svg.SVGOMDocument.setDocumentURI (or setURLObject, or setParsedURL). I would suggest setting that URL to a JAR file URL that points to a non-existent file in your JAR, that is in the same directory as your 'widgets.svg' file. Then if you use xlink:href=widgets.svg#blah it will resolve the reference to the file in your Jar file. On Sat, Jan 2, 2010 at 11:27 PM, jonathan wood jonathanshaww...@gmail.com wrote: Hi Dao, I also included a load from jar in the previous examples. The key is the line: InputStream templateStream = MyClass.class.getResourceAsStream(template.svg); getResourceAsStream will allow you to load from the classpath (including your jar). to recap: InputStream templateStream = MyClass.class.getResourceAsStream(template.svg); String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); SVGDocument doc = null; try { doc = f.createSVGDocument(null, templateStream); } catch (IOException ex) { } myCanvas.setSVGDocument(doc); On Sat, Jan 2, 2010 at 3:30 PM, dao dao.ho...@gmail.com wrote: to continue with this inputstream document: My document that I build from an inputstream references an other document by referencing some symbols (use xlink:href= widgets.svg#warningMask ...) How can I do to make this work: Either I create an other document I receive from my server which is widget.svg and tell me how I can reference it (is it necessary to create a file from the stream in the file widgets.svg?) Either I have the widgets.svg file in my application's jar. In that case, How can I reference a file in a jar? Do you suggest me an other way to process? 2010/1/1 Helder Magalhães helder.magalh...@gmail.com Hi dao, Response inline... Added in [2]. not sure of how to reference the thread Great! :-) I noticed an entry added to the how-to, but the actual page [1] doesn't exist yet...? To reference a thread, just copy a link from the archives [2]. While using the official archives, the trick seems to be selecting the desired thread or particular message and clicking on the Message view link in order to get the desired thread/message hyperlink. In this particular case, it would be [3]. As we're at it, given than navigation/search features are not very user friendly in the official archives IMHO, I frequently use the Nabble archive [4], specially for searches... ;-) Hope this helps, Helder [1] http://wiki.apache.org/xmlgraphics-batik/InputStreamInitialisation http://wiki.apache.org/xmlgraphics-batik/InputStreamInitialisation [2] http://mail-archives.apache.org/mod_mbox/ http://mail-archives.apache.org/mod_mbox/ [3] http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik- http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik- users/200912.mbox/% 3c272595f40912300947w60080f76ibdc29c7a1a702...@mail.gmail.com%3e [4] http://old.nabble.com/Batik-f308.html http://old.nabble.com/Batik-f308.html - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org -- Dao Hodac -- Dao Hodac This mail has originated outside your organization, either from an external partner or the Global Internet.
RE: create a JSVGCanvas from an inputstream
Sorry for the DOC_URI, it works fine now with jar:/file:/E:/ATOLE/gate/animator/MoowClient.jar!/panel.svg Just note that in a bat file, the ! is interpreted so the command line is like: java -Djava.rmi.server.codebase=file:///F:/ATOLE/gate/animator/MoowClient.jar -Dsvg.document.URI=jar:file:///F:/ATOLE/gate/animator/MoowClient.jar^!/panel.svg -Djava.rmi.server.hostname=TODA300038225 -Djava.security.policy=server.policy -cp MoowClient.jar com.moow.animator.engine.application.Main TODA300038225 %* I add this to the wiki. Thank's a lot for this thread De : thomas.dewe...@kodak.com [mailto:thomas.dewe...@kodak.com] Envoyé : lundi 4 janvier 2010 13:58 À : batik-users@xmlgraphics.apache.org Cc : batik-users@xmlgraphics.apache.org Objet : RE: create a JSVGCanvas from an inputstream Hi Olivier, HODAC, Olivier olivier.ho...@airbus.com wrote on 01/04/2010 07:22:05 AM: I have tried your suggestion, but for the moment, it fails. I have created the document like this. Note that panel.svg does not exist: private static final String DOC_URI = jar:file://panel.svg file:///\\panel.svg\ ; This isn't a proper Jar file URL. Please check the syntax of a jar file URL. I get this error: Unable to make sense of URL for connection (since I want to use a symbol set in the file widget.svg) Is there a problem with the URI? Yes. De : thomas.dewe...@kodak.com [mailto:thomas.dewe...@kodak.com mailto:thomas.dewe...@kodak.com ] Envoyé : lundi 4 janvier 2010 12:27 À : batik-users@xmlgraphics.apache.org Cc : batik-users@xmlgraphics.apache.org Objet : Re: create a JSVGCanvas from an inputstream Hi Dao, dao dao.ho...@gmail.com wrote on 01/02/2010 05:33:04 PM: I understand, but how can I refer to that document in an other document? (see the xlink:href from my mail)? After you have created your document from an InputStream you can set the base URL for the document. There are two ways to do this, the 'xml:base' attribute or by calling batik.dom.svg.SVGOMDocument.setDocumentURI (or setURLObject, or setParsedURL). I would suggest setting that URL to a JAR file URL that points to a non-existent file in your JAR, that is in the same directory as your 'widgets.svg' file. Then if you use xlink:href=widgets.svg#blah it will resolve the reference to the file in your Jar file. On Sat, Jan 2, 2010 at 11:27 PM, jonathan wood jonathanshaww...@gmail.com wrote: Hi Dao, I also included a load from jar in the previous examples. The key is the line: InputStream templateStream = MyClass.class.getResourceAsStream(template.svg); getResourceAsStream will allow you to load from the classpath (including your jar). to recap: InputStream templateStream = MyClass.class.getResourceAsStream(template.svg); String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); SVGDocument doc = null; try { doc = f.createSVGDocument(null, templateStream); } catch (IOException ex) { } myCanvas.setSVGDocument(doc); On Sat, Jan 2, 2010 at 3:30 PM, dao dao.ho...@gmail.com wrote: to continue with this inputstream document: My document that I build from an inputstream references an other document by referencing some symbols (use xlink:href= widgets.svg#warningMask ...) How can I do to make this work: Either I create an other document I receive from my server which is widget.svg and tell me how I can reference it (is it necessary to create a file from the stream in the file widgets.svg?) Either I have the widgets.svg file in my application's jar. In that case, How can I reference a file in a jar? Do you suggest me an other way to process? 2010/1/1 Helder Magalhães helder.magalh...@gmail.com Hi dao, Response inline... Added in [2]. not sure of how to reference the thread Great! :-) I noticed an entry added to the how-to, but the actual page [1] doesn't exist yet...? To reference a thread, just copy a link from the archives [2]. While using the official archives, the trick seems to be selecting the desired thread or particular message and clicking on the Message view link in order to get the desired thread/message hyperlink. In this particular case, it would be [3]. As we're at it, given than navigation/search features are not very user friendly in the official archives IMHO, I frequently use the Nabble archive [4], specially for searches... ;-) Hope this helps, Helder [1] http://wiki.apache.org/xmlgraphics-batik/InputStreamInitialisation http://wiki.apache.org/xmlgraphics-batik/InputStreamInitialisation [2] http://mail-archives.apache.org/mod_mbox/ http://mail
RE: SVG update performances over X11 export display
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.magalh...@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, Is there a way to do this with the batik framework: beginBatchModifications() thread1 - getUpdateRunnableQueue().invokeLater(runnable1) thread2 - getUpdateRunnableQueue().invokeLater(runnable2) thread3 - getUpdateRunnableQueue().invokeLater(runnable3) thread2 - getUpdateRunnableQueue().invokeLater(runnable4) thread1 - 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? 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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
RE: SVG update performances over X11 export display
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.dewe...@kodak.com [mailto:thomas.dewe...@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 olivier.ho...@airbus.com wrote on 12/01/2009 05:18:19 AM: 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? No, aside from the source code. When I do a setAttribute style, for example, does batik repaints only the necessary part of the display (the rectangle surrounding the element)? Batik only updates the parts of the canvas that needs updating. 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. -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.magalh...@gmail.com mailto:helder.magalh...@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, Is there a way to do this with the batik framework: beginBatchModifications() thread1 - getUpdateRunnableQueue().invokeLater(runnable1) thread2 - getUpdateRunnableQueue().invokeLater(runnable2) thread3 - getUpdateRunnableQueue().invokeLater(runnable3) thread2 - getUpdateRunnableQueue().invokeLater(runnable4) thread1 - 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? 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 http://www.w3.org/TR/SVG/struct.html#DOMInterfaces [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ dom/svg/SVGSVGContext.html - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org This mail has originated outside
RE: SVG update performances over X11 export display
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.dewe...@kodak.com [mailto:thomas.dewe...@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 olivier.ho...@airbus.com wrote on 11/30/2009 10:24:00 AM: When I suspendRedraw, my invokeLater calls piles up the runnables in 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). 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... 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. -Message d'origine- De : Helder Magalhães [mailto:helder.magalh...@gmail.com mailto:helder.magalh...@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, Is there a way to do this with the batik framework: beginBatchModifications() thread1 - getUpdateRunnableQueue().invokeLater(runnable1) thread2 - getUpdateRunnableQueue().invokeLater(runnable2) thread3 - getUpdateRunnableQueue().invokeLater(runnable3) thread2 - getUpdateRunnableQueue().invokeLater(runnable4) thread1 - 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? 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 http://www.w3.org/TR/SVG/struct.html#DOMInterfaces [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ dom/svg/SVGSVGContext.html - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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
RE: SVG update performances over X11 export display
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.dewe...@kodak.com [mailto:thomas.dewe...@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 olivier.ho...@airbus.com wrote on 12/01/2009 05:18:19 AM: 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? No, aside from the source code. When I do a setAttribute style, for example, does batik repaints only the necessary part of the display (the rectangle surrounding the element)? Batik only updates the parts of the canvas that needs updating. 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. -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.magalh...@gmail.com mailto:helder.magalh...@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, Is there a way to do this with the batik framework: beginBatchModifications() thread1 - getUpdateRunnableQueue().invokeLater(runnable1) thread2 - getUpdateRunnableQueue().invokeLater(runnable2) thread3 - getUpdateRunnableQueue().invokeLater(runnable3) thread2 - getUpdateRunnableQueue().invokeLater(runnable4) thread1 - 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? 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 http://www.w3.org/TR/SVG/struct.html#DOMInterfaces [2] http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ dom/svg/SVGSVGContext.html - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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
RE: SVG elements events
Yes, exaclty. Thank's, it is so difficult when you are not used to deal with W3C documentation I'll bookmark this. De : jonathan wood [mailto:jonathanshaww...@gmail.com] Envoyé : vendredi 27 novembre 2009 20:14 À : batik-users@xmlgraphics.apache.org Objet : Re: SVG elements events Hello Olivier, You should be able to find what you are looking for here: http://www.w3.org/TR/SVG/interact.html On Thu, Nov 26, 2009 at 5:42 AM, HODAC, Olivier olivier.ho...@airbus.com wrote: Hello, I want to register some mouse events on an SVG element. Where can I find the list of events I can register? I can find samples with EventTarget etr = (EventTarget) elt; etr.addEventListener(click, new org.w3c.dom.events.EventListener() { but what are the other event types ? For example, I want to register a mouse hover to highlight an element of the SVG regards Olivier Dao Ho Dac 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. 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.
SVG update performances over X11 export display
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.ho...@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.
RE: SVG update performances over X11 export display
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 - getUpdateRunnableQueue().invokeLater(runnable1) thread2 - getUpdateRunnableQueue().invokeLater(runnable2) thread3 - getUpdateRunnableQueue().invokeLater(runnable3) thread2 - getUpdateRunnableQueue().invokeLater(runnable4) thread1 - 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.magalh...@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, I modify the document in the thread getUpdateManager().getUpdateRunnableQueue().invokeLater Good, this is the recommended way [1] for doing it. :-) 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... 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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
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.magalh...@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, Is there a way to do this with the batik framework: beginBatchModifications() thread1 - getUpdateRunnableQueue().invokeLater(runnable1) thread2 - getUpdateRunnableQueue().invokeLater(runnable2) thread3 - getUpdateRunnableQueue().invokeLater(runnable3) thread2 - getUpdateRunnableQueue().invokeLater(runnable4) thread1 - 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? 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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
SVG elements events
Hello, I want to register some mouse events on an SVG element. Where can I find the list of events I can register? I can find samples with EventTarget etr = (EventTarget) elt; etr.addEventListener(click, new org.w3c.dom.events.EventListener() { but what are the other event types ? For example, I want to register a mouse hover to highlight an element of the SVG regards Olivier Dao Ho Dac 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.
locate an SVG element using x, y position
Hello, I'd like to add a mouse listener on my JSVGCanvas to select an element of my rendered SVG. How can I find the right node using x,y mouse postion? 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.ho...@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.
transform attribute marshaller
Hello, I am totally newby with batik and I am wondering if I am thinking right. I have seen that there is some parsers that are used with handlers. Butr here is my requirement: I want to change dynamically in java the position and some attributes of my initial svg file. I am focussing for the moment on the transform attribute (to move and rescale my object) and the fill attr ( to change the color) I am doing the following. You can see that I have to create the whole transform value string each time (I could have used the format method, by the way) by hand Is there a way to do that with some ready to use classes (ex: TransformableElement.setTransform(X_POS, value)) ? protected void setSize(double d) { getElt().setAttributeNS(null, transform, matrix(+d+ 0 0 +d+ 243.3438 143.687)); } getSvgCanvas().getUpdateManager().getUpdateRunnableQueue().invokeLater(n ew Runnable() { public void run() { setSize(theNewSize)); } }); } Olivier Dao Ho Dac Flight Test Software Architect Airbus France - EVIDA Phone : + 33 (0)5 67 19 81 34 Fax : +33(0)5 61 93 80 02 Mailto:olivier.ho...@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.
RE: transform attribute marshaller
Thanks michael If I understand well, I create a new affineTransform from the attribute transform string using the static method AffineTransform at = AWTTransformProducer.createAffineTransform(String s) Then, I use the setters from the AffineTransform to set the rotation value, etc... Finally, I use the standart java MessageFormat stuff to marshall it? You mean that I explicitely write: MessageFormat.format(matrix(%f %f %f %f %f %f), at.getScaleX() , etc...)? -Message d'origine- De : Bishop, Michael W. CTR USJFCOM JFL [mailto:michael.bishop@jfcom.mil] Envoyé : mercredi 2 septembre 2009 16:35 À : batik-users@xmlgraphics.apache.org Objet : RE: transform attribute marshaller Hello, I use Batik's AWTTransformProducer to go from a transform attribute to an AffineTransform. I manipulate the AffineTransform however I need to, then use the MessageFormat class to write out the transform attribute with the 6 values of the matrix. I haven't found a better way to produce the transform attribute, but I find manipulating an AffineTransform to be easier to work with. I don't know how familiar you are with transforms, but you might want to search this list for AffineTransformUtil if transform operations don't work the way you expect them to with cumulative updates. Michael Bishop -Original Message- From: HODAC, Olivier [mailto:olivier.ho...@airbus.com] Sent: Wednesday, September 02, 2009 10:04 AM To: batik-users@xmlgraphics.apache.org Subject: transform attribute marshaller Hello, I am totally newby with batik and I am wondering if I am thinking right. I have seen that there is some parsers that are used with handlers. Butr here is my requirement: I want to change dynamically in java the position and some attributes of my initial svg file. I am focussing for the moment on the transform attribute (to move and rescale my object) and the fill attr ( to change the color) I am doing the following. You can see that I have to create the whole transform value string each time (I could have used the format method, by the way) by hand Is there a way to do that with some ready to use classes (ex: TransformableElement.setTransform(X_POS, value)) ? protected void setSize(double d) { getElt().setAttributeNS(null, transform, matrix(+d+ 0 0 +d+ 243.3438 143.687)); } getSvgCanvas().getUpdateManager().getUpdateRunnableQueue().invokeLater(n ew Runnable() { public void run() { setSize(theNewSize)); } }); } Olivier Dao Ho Dac Flight Test Software Architect Airbus France - EVIDA Phone : + 33 (0)5 67 19 81 34 Fax : +33(0)5 61 93 80 02 Mailto:olivier.ho...@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. - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
RE: transform attribute marshaller
OK, thank's (so fast!!!) -Message d'origine- De : Bishop, Michael W. CTR USJFCOM JFL [mailto:michael.bishop@jfcom.mil] Envoyé : mercredi 2 septembre 2009 17:11 À : batik-users@xmlgraphics.apache.org Objet : RE: transform attribute marshaller Yes, except for at.getScaleX(), I do: double[] matrixValues = new double[6]; matrix.getMatrix(matrixValues); Then I use matrixValues[0 - 5] to populate the matrix part of the transform attribute. Although, reading the Javadoc, I guess it doesn't matter. You could use: getScaleX(), getShearY(), getShearX(), getScaleY(), getTranslateX(), and getTranslateY() in that order to get the same values. Either way, it's a little tedious, but it works. Michael -Original Message- From: HODAC, Olivier [mailto:olivier.ho...@airbus.com] Sent: Wednesday, September 02, 2009 10:56 AM To: batik-users@xmlgraphics.apache.org Subject: RE: transform attribute marshaller Thanks michael If I understand well, I create a new affineTransform from the attribute transform string using the static method AffineTransform at = AWTTransformProducer.createAffineTransform(String s) Then, I use the setters from the AffineTransform to set the rotation value, etc... Finally, I use the standart java MessageFormat stuff to marshall it? You mean that I explicitely write: MessageFormat.format(matrix(%f %f %f %f %f %f), at.getScaleX() , etc...)? -Message d'origine- De : Bishop, Michael W. CTR USJFCOM JFL [mailto:michael.bishop@jfcom.mil] Envoyé : mercredi 2 septembre 2009 16:35 À : batik-users@xmlgraphics.apache.org Objet : RE: transform attribute marshaller Hello, I use Batik's AWTTransformProducer to go from a transform attribute to an AffineTransform. I manipulate the AffineTransform however I need to, then use the MessageFormat class to write out the transform attribute with the 6 values of the matrix. I haven't found a better way to produce the transform attribute, but I find manipulating an AffineTransform to be easier to work with. I don't know how familiar you are with transforms, but you might want to search this list for AffineTransformUtil if transform operations don't work the way you expect them to with cumulative updates. Michael Bishop -Original Message- From: HODAC, Olivier [mailto:olivier.ho...@airbus.com] Sent: Wednesday, September 02, 2009 10:04 AM To: batik-users@xmlgraphics.apache.org Subject: transform attribute marshaller Hello, I am totally newby with batik and I am wondering if I am thinking right. I have seen that there is some parsers that are used with handlers. Butr here is my requirement: I want to change dynamically in java the position and some attributes of my initial svg file. I am focussing for the moment on the transform attribute (to move and rescale my object) and the fill attr ( to change the color) I am doing the following. You can see that I have to create the whole transform value string each time (I could have used the format method, by the way) by hand Is there a way to do that with some ready to use classes (ex: TransformableElement.setTransform(X_POS, value)) ? protected void setSize(double d) { getElt().setAttributeNS(null, transform, matrix(+d+ 0 0 +d+ 243.3438 143.687)); } getSvgCanvas().getUpdateManager().getUpdateRunnableQueue().invokeLater(n ew Runnable() { public void run() { setSize(theNewSize)); } }); } Olivier Dao Ho Dac Flight Test Software Architect Airbus France - EVIDA Phone : + 33 (0)5 67 19 81 34 Fax : +33(0)5 61 93 80 02 Mailto:olivier.ho...@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. - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@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