Hi Kenneth,
Kenneth McDonald <[EMAIL PROTECTED]> wrote on 08/17/2007
01:52:01 AM:
> In spite of the length of the questions, I've tried to ask them in such
> a way that they can be answered with a "yes", "no", or
> single line or URL reference...:-)
>
> 1) Are there any batik examples out there that illustrate receiving
> events (mouse events, keypresses, etc.), and then dynamically
> updating the SVG DOM in response so the user sees some result?
> Basically, using Batik as a user interface. In general, I'm
> in serious need of sample code that uses Java to script Batik documents.
You can take a look at the various examples in 'samples'. Some
simple examples:
samples/tests/spec/scripting/removeOnClick.svg
samples/tests/spec/scripting/rectResizeOnClick.svg
There are some more complex examples in:
samples/sydney.svg
samples/solitaire/klondike.svg
These all use JavaScript but the equivalent Java code
is almost identical except you add your listeners with
'addEventListener' and you need a lot more casting...
> 2) I'm considering using Batik as the rendering engine for what will be
> a specialized text editor. Obviously, I'll need to write
> my own code to do text layout, as (to my knowledge) SVG doesn't offer
> any automated layout capabilities at all. (I'd be happy
> to be contradicted).
See samples/tests/spec/spec12/flowText4.svg
> Now let's say I have layed document consisting of a
> hundred paragraphs, each represented as an SVG box
> and each containing, say 200 individual bits of text, where each bit of
> text is a single SVG element. If I, say, resize the top paragraph
> to account for a word deletion, and then move the remaining paragraphs
> up, will Batik be
> able to do the re-rendering needed quickly enough to make the change
> look 'instantaneous' to a user?
I don't know, in general if you are just moving text element's
around it should be fairly quick. However one of the slower pieces
of Batik is it's text layout engine (mostly due to inefficiencies
in some JDK classes - due mostly to their generality).
> 3) Max document size would probably be, say 20,000 words each
> represented as an individual text elements, plus maybe
> another 20,000 elements used in charts. (Actually, it probably wouldn't
> be anywhere near that, but let's plan for growth here :-) )
> Will Batik be able to handle this amount of data reasonably?
I can't give a good answer, too much depends on the details of
the elements. I think 20K text elements is probably too much.
However, if you used the textFlow to hold each paragraph. It would
bring down the text element count by a lot.
> 4) Any recommendations for good SVG ref/tutorial sites or books? There
> are many out there, but most seem rather wordy
> and explain the obvious and simple, while ignoring the deeper and more
> difficult.
I think the examples I pointed to above are a pretty good place
to start. Especially more complex examples.
> I'm afraid that at the moment, my brain's stubborn refusal to engage
> means that reading the Batik API documentation isn't translating into
> a knowledge of how to construct, display, and manipulate SVG documents
> in Java.
Actually, reading the Batik API's is a really bad way to learn
SVG. However reading something like DOM Level 2 Events, and
reviewing the SVG DOM api's should tell you a lot.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]