draw a set of points
hello, Is it possible to draw a point with SVG? polylines, paths, etc... seems not appropriate to do that. Do I need to draw a rect or circle with a size of 0 (or 1)? I want to draw a chart representing a set of points not linked together regards, -- Dao Hodac
Re: background for text
interesting, I never think filter oriented... but if I want to highlight a filled shape, the yellow never appears, isn't it? On Tue, Dec 22, 2009 at 12:05 AM, Cameron McCormack c...@mcc.id.au wrote: dao: I'd like to highlight a text element of my svg file: text transform=matrix(1 0 0 1 433.8965 494.4141) style=fill:#00; font-family:'CourierNewPSMT'; font-size:24;00.00/text I cannot see any way to set the background of a text, or to get the box size to draw a rectangle around it. Do you know how I can do this? A hacky way of declaratively drawing background for your text is to use a filter: svg xmlns='http://www.w3.org/2000/svg' font-size='24' filter id='f' x='0' y='0' width='100%' height='100%' feFlood flood-color='yellow' result='bg'/ feMerge feMergeNode in='bg'/ feMergeNode in='SourceGraphic'/ /feMerge /filter text x='20' y='100' filter='url(#f)'Hello there/text /svg The overhead of doing this is probably much greater than computing the bounding box of the text and inserting a rect to draw the background, though. -- Cameron McCormack ≝ http://mcc.id.au/ - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org -- Dao Hodac
Re: Rendering part of svg document at specified position in JGVTComponent
Thank you for the answer. The reason why I don't want to use JSVGCanvas is memory saving. In my project it is crucial and we've decided to give up with SVG DOM and work only with gvt objects. Currently I'm trying to change JGVTComponent as you suggested (still have some refresh problem). 2009/12/22 thomas.dewe...@kodak.com: Hi Tomasz, Tomasz Chojnacki chojn...@gmail.com wrote on 12/20/2009 01:08:54 PM: I want to insert JGVTComponent into JScrollPane and have the cavas (component) as large as SVG document. The problem is that for large zooms rendering of whole svg extend consumes lots of memory, the simplest way to avoid this is to render only currently visible box of scroll pane and update the rendered part on the viewbox change. Why don't you use JSVGScrollPane? I see you are using a JGVTComponent rather than JSVGCanvas, but I would suggest simply adapting JSVGScrollPane to just the JGVTComponent. Or you could just use the JSVGCanvas and be done... I've tried to override getRenderRect method of JGVTComponent but it only refreshes JGVTComponent and not svg content itself. I've attached simple test (SVGApplication.java) Is there a way to force rendering of specified svg content on JGVTComponent (or any other panel) in explicitly pointed area ? best regards It's possible but you wold have to mostly rewrite the JGVTComponent. - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
animation code example
hello, is there a tutorial of how to create animation elements with batik? do I need to create the elements from scratch (using DOM) or batik provides a animation framework? I ask because there is the package org.apache.batik.animhttp://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/anim/package-summary.html but I cannot find any code snippet with google -- Dao Hodac
Re: draw a set of points
Use a circle or rect with a size that fits the coord system that you need to use. Because of scalability, the width of a point is fairly meaningless. On Tue, Dec 22, 2009 at 8:06 AM, dao dao.ho...@gmail.com wrote: hello, Is it possible to draw a point with SVG? polylines, paths, etc... seems not appropriate to do that. Do I need to draw a rect or circle with a size of 0 (or 1)? I want to draw a chart representing a set of points not linked together regards, -- Dao Hodac
Re: draw a set of points
On Tue, 22 Dec 2009 14:06:12 +0100 dao dao.ho...@gmail.com wrote: hello, Is it possible to draw a point with SVG? polylines, paths, etc... seems not appropriate to do that. Do I need to draw a rect or circle with a size of 0 (or 1)? I want to draw a chart representing a set of points not linked together This took me a while to completely resolve in my mind. A point would have no size, so would not be drawn. What most people are thinking of when they say they want to draw a point, is that they want a pixel. But, vector graphics doesn't really have a concept of pixels. Drawing a rect or circle at a small size would probably give you the effect you want. But, zooming in would cause it to grow. This and the position of lines, are probably the concepts that are the hardest to remember when changing from raster graphics to vector graphics. G. Wade -- The function of good software is to make the complex appear to be simple. -- Grady Booch - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
Re: animation code example
Batik's animation is really just SVG animationhttp://www.w3.org/TR/SVG11/animate.htmlwhich is mainly SMILhttp://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimationFramework(with batik additionshttp://www.w3.org/TR/SVG11/animate.html#SVGExtensionsToSMILAnimation). Create the DOM objects just as you would build rects, etc and add them to the target elements. You'll find many examples by broadening your search to include javascript. The DOM calls are the same. On Tue, Dec 22, 2009 at 12:48 PM, dao dao.ho...@gmail.com wrote: hello, is there a tutorial of how to create animation elements with batik? do I need to create the elements from scratch (using DOM) or batik provides a animation framework? I ask because there is the package org.apache.batik.animhttp://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/anim/package-summary.html but I cannot find any code snippet with google -- Dao Hodac