You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Nirmesh Desai <nd...@cardiff.com> on 2008/07/16 02:30:11 UTC

minimal classes needed to use JSVGCanvas in applet

 

 

I am trying to reduce the size of the jar file used to contain classes
displaying svg.

 

I would like to reduce the size of this jar file and batik jars take
most percentage of space, I'd also don't want to use network loading of
classes.

 

Is there a lean distribution available with minimal functionality
defined for it?

 

Please do let me know of any info out there.

 

Thanks in advance.

 

Nirmesh.


Re: minimal classes needed to use JSVGCanvas in applet

Posted by Helder Magalhães <he...@gmail.com>.
> Said that (and thinking about it), I'd propose "batik-anim.jar" to be
> placed next to "batik-svg-dom.jar" with a double arrow (they depend on
> each other), and "batik-coded.jar" below "batik-transcoder.jar" (which
> intuitively depends on codec availability). Do agree on this? Is any
> tool is used to edit the graph or was it made by hand? (I could try to
> create an updated version, at least containing the two missing ones,
> until the whole dependency graph is revisited...)

Could anyone more familiar with Batik internals comment on the
proposal and/or regarding how was the SVG source generated (tool or by
hand?

I could then attempt to create 1) a patch to the documentation stating
it's outdated (by adding a note, for example) in install page [1] or
2) try to generate an updated SVG image. This would also help fixing
bug 44573. :-)

Regards,

 Helder Magalhães

[1] http://xmlgraphics.apache.org/batik/install.html
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=44573

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


RE: svg event on text value change

Posted by Nirmesh Desai <nd...@cardiff.com>.
Thanks Cameron,

The onload for svg element is working so I will use it to add DOMCharacterDataModified listeners to other elements.

The other elements have variable ids so I need to follow this approach
to wait till svg is loaded.


Nirmesh.


-----Original Message-----
From: Cameron McCormack [mailto:cam@mcc.id.au] 
Sent: Wednesday, July 16, 2008 4:21 PM
To: batik-users@xmlgraphics.apache.org
Subject: Re: svg event on text value change

Hi Nirmesh.

Nirmesh Desai:
> Is there a place where I can add this listener to appropriate nodes?
> 
> Currently onload throws error in batik saying the function not found.

Here’s an example:

<svg xmlns='http://www.w3.org/2000/svg' width='400' height='300' font-size='18'>
  <title id='title'>Initial title</title>
  <text x='20' y='30'>Document title: “<tspan id='t'> </tspan>”</text>
  <rect x='20' y='60' width='30' height='30'
        onclick='title.firstChild.nodeValue = "Hello!"'/>
  <text x='60' y='80'>← click to change title</text>
  <script>
    var title = document.getElementById('title');
    var t = document.getElementById('t');
    function update(evt) {
      t.firstChild.nodeValue = title.firstChild.nodeValue;
    }
    title.addEventListener('DOMCharacterDataModified', update, false);
    update();
  </script>
</svg>

-- 
Cameron McCormack ≝ http://mcc.id.au/

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



Re: svg event on text value change

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Nirmesh.

Nirmesh Desai:
> Is there a place where I can add this listener to appropriate nodes?
> 
> Currently onload throws error in batik saying the function not found.

Here’s an example:

<svg xmlns='http://www.w3.org/2000/svg' width='400' height='300' font-size='18'>
  <title id='title'>Initial title</title>
  <text x='20' y='30'>Document title: “<tspan id='t'> </tspan>”</text>
  <rect x='20' y='60' width='30' height='30'
        onclick='title.firstChild.nodeValue = "Hello!"'/>
  <text x='60' y='80'>← click to change title</text>
  <script>
    var title = document.getElementById('title');
    var t = document.getElementById('t');
    function update(evt) {
      t.firstChild.nodeValue = title.firstChild.nodeValue;
    }
    title.addEventListener('DOMCharacterDataModified', update, false);
    update();
  </script>
</svg>

-- 
Cameron McCormack ≝ http://mcc.id.au/

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


RE: svg event on text value change

Posted by Nirmesh Desai <nd...@cardiff.com>.
Thanks.

Is there a place where I can add this listener to appropriate nodes?

Currently onload throws error in batik saying the function not found.


Where can I add this line without using ui (mouse/keyboard) events..

node.addEventListener('DOMCharacterDataModified', doSomething, false);

Thanks again in advance.
Nirmesh.

-----Original Message-----
From: Cameron McCormack [mailto:cam@mcc.id.au] 
Sent: Wednesday, July 16, 2008 3:55 PM
To: batik-users@xmlgraphics.apache.org
Subject: Re: svg event on text value change

Nirmesh Desai:
> Is there an event for 'text' node's value change?

Yes, you can listen for a DOMCharacterDataModified event:

  http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent

-- 
Cameron McCormack ≝ http://mcc.id.au/

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



Re: svg event on text value change

Posted by Cameron McCormack <ca...@mcc.id.au>.
Nirmesh Desai:
> Is there an event for 'text' node's value change?

Yes, you can listen for a DOMCharacterDataModified event:

  http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent

-- 
Cameron McCormack ≝ http://mcc.id.au/

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


svg event on text value change

Posted by Nirmesh Desai <nd...@cardiff.com>.

Is there an event for 'text' node's value change?


I had managed to use DOMAttrModified event to get updates relayed to
other elements

However I do not want to add attribute just to use the listener, is a
direct event on text content change?

Thanks,
Nirmesh.



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


Re: minimal classes needed to use JSVGCanvas in applet

Posted by Helder Magalhães <he...@gmail.com>.
>> Helder Magalhães:
>> I recall a thread on the subject [2] but no conclusion was reached.

> Cameron McCormack
> My reply to that thread shows how to extract the current dependencies from the code:

Badly written - I should have stated that I read the post quickly (and
didn't analyze the instructions carefully)... :-|

Said that (and thinking about it), I'd propose "batik-anim.jar" to be
placed next to "batik-svg-dom.jar" with a double arrow (they depend on
each other), and "batik-coded.jar" below "batik-transcoder.jar" (which
intuitively depends on codec availability). Do agree on this? Is any
tool is used to edit the graph or was it made by hand? (I could try to
create an updated version, at least containing the two missing ones,
until the whole dependency graph is revisited...)

Regards,

 Helder Magalhães

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


Re: minimal classes needed to use JSVGCanvas in applet

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Helder.

Helder Magalhães:
> I haven't yet found a place in the dependency graph for
> "batik-anim.jar" (or "batik-codec.jar", but that's not required to
> view SVG content). I recall a thread on the subject [2] but no
> conclusion was reached. Could anyone suggest the order for these?

My reply to that thread shows how to extract the current dependencies
from the code:

  http://markmail.org/message/oqh2ucqnzj47cl7w

-- 
Cameron McCormack ≝ http://mcc.id.au/

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


Re: minimal classes needed to use JSVGCanvas in applet

Posted by Helder Magalhães <he...@gmail.com>.
>> Is there a lean distribution available with minimal functionality
>> defined for it?

AFAIK no/not yet! Would you provide one? ;-) I've been trying to
gather this kind of information and expect 1) to discuss it with Batik
developers and 2) possibly publish it in the Wiki [1] afterward. :-)
The only thing is that I don't have a notion of when will I be able to
do that... :-|

>    None provided by the project.  We do publish the jar file
> dependency list which might allow you to prune at that level.

In the meantime, based in the available dependency graph [2] (as
Thomas Deweese has pointed out), I suggest the following:

xml-apis.jar,
batik-ext.jar,batik-gui-util.jar,batik-util.jar,
batik-xml.jar,batik-css.jar,batik-awt-util.jar,
batik-parser.jar,batik-gvt.jar,batik-dom.jar, xerces_2_5_0.jar,
batik-svg-dom.jar,js.jar,batik-script.jar,
batik-bridge.jar,
batik-anim.jar,batik-extension.jar,batik-swing.jar,xml-apis-ext.jar,

Each line is a row in the dependency graph, inverted order so that
dependencies get orderly downloaded.
Note that it assumes a somehow recent JRE (1.5+?) in order to leave
xalan out (the heaviest one).

I haven't yet found a place in the dependency graph for
"batik-anim.jar" (or "batik-codec.jar", but that's not required to
view SVG content). I recall a thread on the subject [2] but no
conclusion was reached. Could anyone suggest the order for these?

Hope this helps,

 Helder Magalhães

[1] http://wiki.apache.org/xmlgraphics-batik/
[2] http://xmlgraphics.apache.org/batik/install.html#dependencyGraph
[3] http://www.nabble.com/Jar-dependency-graph-td17002989.html#a17002989

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


Re: minimal classes needed to use JSVGCanvas in applet

Posted by th...@kodak.com.
Hi Nirmesh,
"Nirmesh Desai" <nd...@cardiff.com> wrote on 07/15/2008 08:30:11 PM:

> I would like to reduce the size of this jar file and batik jars take
> most percentage of space, I?d also don?t want to use network loading
> of classes.
> 
> Is there a lean distribution available with minimal functionality 
> defined for it?

   None provided by the project.  We do publish the jar file
dependency list which might allow you to prune at that level.
In general if any part of a jar file is used we probably can
make use of all the contents of the jar file (depending on
SVG content).