[kepler-dev] Re: illustrator svg settings

Matt Jones jones at nceas.ucsb.edu
Tue Mar 8 13:03:32 PST 2005

Thanks for the update, Edward.  It suprises me a little that you are 
moving towards raster formats given that the ptolemy canvas needs to 
support such extensive rescaling operations while zooming.  I thought 
SVG was a nice solution to that, and we were planning on using it for 
all of our new icons.

The problem, of course, is that Ptolemy doesn't support some of the 
basic SVG constructs such as group elements and path elements, among 
others, so creating the SVG icons from standard apps is hard. So I've 
been investigating what it would take to get the Batik SVG renderer 
installed in Ptolemy for more complete SVG support.

Batik provides a Swing component 
(org.apache.batik.swing.svg.JSVGComponent) that can render SVG that 
looks very easy to use -- just create the component and pass it the SVG 
DOM (see links below).  However, its not clear how Swing components fit 
into the Diva framework.  Does the diva.canvas.toolbox.SwingWrapper 
class work (it doesn't seem to be referenced from any of our code)?  If 
so that might be a fairly simple way to handle it.  I've looked at the 
existing XMlIcon and SVGIcon classes and they seem harder to adapt 
because they are so closely tied into the Diva Figure framework using 
PaintedObject (which Diva docs say is deprecated anyways).

What do you think?  Would SwingWrapper work?  If so, we might spend a 
bit of time getting it implemented.  Your recommendations are 
appreciated. Thanks,


JSVGComponent API:

Batik JSVGCanvas tutorial:

Edward A. Lee wrote:
> Note that we've been moving away from SVG for representing icons...
> I'm not sure that's what you are doing... The SVG supported for this
> is extremely limited, and it would be a fair amount of work to
> make it more complete.  We now use the icon editor instead, which
> supports basic graphic elements as attributes, and also supports
> gifs or jpeg images.
> Edward
> At 11:44 AM 3/7/2005 -0900, Matt Jones wrote:
>> Thanks, Laura.  This composite looks great.  The icons are all solid
>> colors and simple lines, so they should be able to be represented in the
>> simplified SVG that ptolemy supports.  Getting them into that format
>> might not be easy, however.  Illustrator, for example, makes extensive
>> use of SVG 'path' elements and group ('g') elements when writing out
>> SVG, which ptolemy doesn't support.  But we can get the developers to
>> get that stuff fixed, probably at a minimum creating a conversion
>> script.  It looks to me like we should be able to use the same SVG for
>> the canvas and the tree because they should scale ok.  I'm moving this
>> conversation onto the list so that the other Kepler developers are aware
>> of the issues.
>> Matt

Matt Jones                                     jones at nceas.ucsb.edu
http://www.nceas.ucsb.edu/    Fax: 425-920-2439    Ph: 907-789-0496
National Center for Ecological Analysis and Synthesis (NCEAS)
University of California Santa Barbara
Interested in ecological informatics? http://www.ecoinformatics.org

More information about the Kepler-dev mailing list