Did you find any substantial performance differences between these
implementations?
No - in fact, I had no choice, as the team I joined up with
was already using dom4j, and having two separate DOM-packages
wasn't worth the effort.
I found dom4j was easier to use - then again, I could have
been ab
Jorg Heymans wrote:
Actually how about JDOM? Can it be used with Batik?
It can, as can dom4j.
However, in both cases you have to either add the
resulting w3c-DOM document to your SVGCanvas
by setDocument(org.w3c.dom.Document) or
(Thomas has suggested this to me for speed reasons,
which you seem ve
Hi,
I got a group ( ) by ID from a document and want to know the position
and size of the group.
With 'position' I mean the upper left corner of an imaginary rectangle
arround all elements of the group. 'Size' should be the edge length of the
rectangle...
I've thought about this myself, recently,
Hello Thomas,
In a strange fashion, the problem is 'solved':
As tried using the facilities provided by batik
for loading the document instead of using dom4j,
and thus switched the parameter given for loading
back to a URL - which I *thought* I had already tried
before.
The Result, however, didn't
Hi Tonny,
If by anycase you use jnlp/webstart thing, java ClassLoader have
peculiar that you need to be aware of. The ClassLoader only can only get
resources if in the same jar file, if it is in different jar. You need
to create some empty anchor Java class to reference to the classloader
to differ
Hi Thomas,
Instead of showing the default "image not found"-icon, the SVG-Canvas
displays an image just the size I indicated in the referencing tag:
Displays an image of what?
Uh...shouldn't write mails that late :)
It displays an "broken image" image.
What makes me wonder is that the images se
Hi again,
just when I thought I was done, bad stuff happened:
After some major refactoring, the image-elements in my graphics aren't shown properly anymore,
but the problem is different from the last time we met:
Instead of showing the default "image not found"-icon, the SVG-Canvas displays
an ima
Hi Thomas,
Do the tspan element's have the fill attribute set?
As far as I know, they haven't - the parent text element
has no fill set (at first), and I don't set fill on them
programatically.
Also does this explain why the text 'disappeared'?
Not to me, but I thought you could make more sense
of
Something else just crosses my mind: Is there anything special I should consider
with the text if it is divided into TSpanElements? After reading the Specification
I thought, that fill-attributes are inherited to all children, but this wouldn't be the
first exception from the rule made for a TextEl
Hi again, Thomas,
My guess would be that the code that is setting the fill on the
polygon is going overboard and setting the fill on the text as well.
One other suggestion, set stroke to a third color (black or
something) for the text. This will let you know if the problem is
that the fill i
Hi Thomas,
This code looks right to me. is there any chance that you are
doing something silly like setting the text to the same color as
the background?
Chances were :), but I thought of this, too, and explicitly set
the colors to be of pure red (255,0,0) for the background and
pure green (0,2
Hello,
after good progress due to your last tips (thanks again), I have encountered another
problem:
Trying to set a text color, which I thought to be one of the easiest of tasks.
I wrote this code:
public void setTextColor(SVGGElement element, Color color) {
NodeList list = element.getChildNod
7;t think that I have to reconstruct the entire document by hand, so I have to be
missing
something - is there a way to import the complete document-structure of one document to
another?
Thanks again
-Urs
Urs Reupke wrote:
up to now I used LoadSVGDocument(URL) to load files to display, and it
was go
Hello,
up to now I used LoadSVGDocument(URL) to load files to display, and it was good -
but when today, for various reasons, I tried to convert the program to use SetDocument,
things failed miserably:
Using JDOM 1.0, I wrote a method to read the SVG-File as a JDOM Document,
afterwards convert i
Hello Thomas,
I am a little surprised to hear this. In general I think the
two render similar quality. The one place where Adobe is significantly
better is text (especially at small point sizes).
Can you be more specific about what you thing needs
improvement?
Text is the main issue, but o
Hello,
I noticed that there's quite a difference between SVGs rendered by Batik and by Adobes SVGViewer when it comes to output quality.
Is there some property to enable Antialiasing or as Adobe calls it "Higher Quality" rendering? I found the class SVGRenderingHints,
but I'm clueless on how to us
Hey Gunter,
now i would like to add a link to another html or svg document to the
rectangle. if the user clicks on the rectangle, the other document
should appear.
You can easily achive the desired effect by adding an EventListener
to your rectangle. Simply add something like
... //your code
Node r
Thank you Thomas,
No, but if you are loading a 'static' SVG document (no script
tags or event attributes) then you need to tell Batik that you still
want access to the SVGDOM (which is provided by the context objects).
This can be done in the canvas with setDocumentState(ALWAYS_DYNAMIC),
or if y
Hi,
yesterday I hit upon a problem when trying to get the computed text length by calling SVGOMTextElement.getComputedTextLength() - a
NullPointerException occured, which, as close scrutiny revealed, had it's origin in the missing SVGContext of the element.
Now, I am somewhat at a loss - I thought
19 matches
Mail list logo