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 rick bolkey <bo...@seas.upenn.edu> on 2001/07/05 22:48:31 UTC

JSVGComponent vs JSVGCanvas

Newbie question, well, just a clarification:

I looked through the archive, but I couldn't find a satisfiable definition of
the two classes, JSVGComponent and JSVGCanvas.  From what I can gather from the
javadoc, JSVGComponent is the swing component for displaying svg images, and
the JSVGCanvas simply adds interaction (zoom, pan, etc) to the JSVGComponent.

So, if I just wanted to display an svg images without user interaction, I
could just use JSVGComponent ... I'm asking this because all the examples use
the canvas.  Is the canvas the prefered component?  Just want to know when what
is appropriate.

thanks for the help,
rick

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


Re: JSVGComponent vs JSVGCanvas

Posted by Thierry Kormann <tk...@ilog.fr>.
On Thursday 05 July 2001 22:48, rick bolkey wrote:
> Newbie question, well, just a clarification:
>
> I looked through the archive, but I couldn't find a satisfiable definition
> of the two classes, JSVGComponent and JSVGCanvas.  From what I can gather
> from the javadoc, JSVGComponent is the swing component for displaying svg
> images, and the JSVGCanvas simply adds interaction (zoom, pan, etc) to the
> JSVGComponent.
>
> So, if I just wanted to display an svg images without user interaction, I
> could just use JSVGComponent ... I'm asking this because all the examples
> use the canvas.  Is the canvas the prefered component?  Just want to know
> when what is appropriate.

The SVGCanvas is a subclass of the SVGComponent. Basically, the SVGCanvas has 
been created to ease the use of the SVGComponent. Here are the key points:

1. The SVGCanvas provide some utility method (with predefined bindings) to 
add intereactors such as zoom, pan and rotate.

2. The SVGCanvas has a BeanInfo that indicates to the beanbox or IDE what the 
icon is...

3. The SVGCanvas is conformed to the JavaBean spec. It means that the methods 
fire property events...

In your own application, you can use both the same way - it's just up to you. 
SVGCanvas does not provide additional functionality - just a bean API.

Thierry.


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