Hello, my name is Jake Beard, and I am planning to use Batik in a research
project for my university. Because I believe I will be asking a lot of
questions over the next few weeks, I thought it would be good to introduce
myself, and briefly describe my project. The goal of my project is
ultimately to construct an environment for multi-formalism meta-modelling.
Actually, it's even a bit simpler than that. The goal is to take a
meta-modelling environment which we have implemented in Python/Tkinter,
construct a lightweight front-end, and use pieces of the original
environment to power the back-end.

The architecture of the application I would like to build coincides pretty
nicely with the architecture described in this article that I found:
http://www.svgopen.org/2004/papers/MakingSVGaWebServiceinaMessageBasedMVCArchitecture/
The main difference is that, while their frontend is JSVGCanvas, and they
have rolled their own event broker, my front-end will be Firefox, and my
event broker will by an AJAX engine. The AJAX engine pass user interface
events to the server and will poll it for responses. The server, in turn,
will handle user interface events, and will respond by passing strings
containing executable javascript code back to the client.

I'm currently working on a small prototype in order to get familiar with
Batik, and become a bit more knowlegable about the details of the
technologies involved. Basically, I am trying to construct a few basic user
interface widgets (a button, a panel, and a menu) in SVG. I know that the
idea of building standard user interface widgets has been
discussed<http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200310.mbox/[EMAIL
 PROTECTED]>,
and even implemented <http://spark.sourceforge.net/>, but my version will
have a slightly different twist to it, which is that the layout and reactive
behavior of the widgets will be modelled using statecharts (our tool can
generate executable python code). This statecharts will be kept on the
server. The goal of this prototype is to show that widget behavior can be
modelled using statecharts, and to get aquainted with the technologies that
the rest of the project will rely upon.

That's pretty much the gist of what I'm trying to do. I have a few question
to start out. These are fairly open questions, and there may not be a
straightforward way to answer them, or a single correct answer, but I would
nevertheless appreciate any advice anyone could offer:

   1. In the context of the SVG specification, what would be the most
   appropriate way to represent a widget? It would either have to be a
   <g>,<svg> or <symbol>. I think any of these would work, but I'm not sure
   which one would be the truest to the spec.
   2. In the context of extending Batik, what would be the most
   appropriate way to represent a widget? If, for example, in the SVG spec, a
   widget would best be represented as <g> element, then in the context of
   Batik, would the most appropriate way to represent a widget be to create a
   subclass of 
SVGOMGElement<http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/dom/svg/SVGOMGElement.html>?
   Or would there be a better way?
   3. I'd like to leverage the Factory classes in
   
org.apache.batik.dom.svg<http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/dom/svg/package-frame.html>,
   but I can't figure out how to initialize the attributes of the Element
   objects I've created. They do not have public set methods, and even though
   they implement the Element interface, calling setAttributeNS on them
   does not change their attributes. What is the proper way to set the
   attributes on these objects?
   4. I also cannot seem to append the Element objects produced by the
   factory classes to the SVG document by calling svgRoot.appendChild
   (object). It just doesn't seem to get appended to the DOM tree. Is
   there a special way to attach the objects created by the factory classes (as
   opposed to those created by doc.createElementNS) to the DOM tree?

Thank you very much for reading my very long email. I would appreciate any
guidance anyone can offer.
Thanks.

Jake

Reply via email to