xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warren W. Thompson" <wthomp...@altaira.com>
Subject Re: Embed a Swing Component in an JSVGCanvas
Date Mon, 07 Jan 2002 20:06:34 GMT
Thank you pointing me in the right direction Thierry! :)

I would like something a little more generic than creating a different
SVG element for every Swing component. I think it might be possible to
make something like...

<batikSwing:awtComponent style="class:javax.swing.JButton;foreground:red" .../>

...so that all of the existing Swing components would be available,
as well as any custom components that a developer may have created.

Does this sort of approach sound feasible?

Are any plans to integrate the ability to embed Swing components into
the Batik source code?

Are there any concrete examples of embedding a Swing, or AWT, component
in a Batik canvas? (I must admit to having a little difficulty creating
my own custom SVG element to support this functionality.)

Thanks again for all of your help!

Warren

Beer is proof that God loves us and wants us to be happy.
                                            --Benjamin Franklin


Thierry Kormann wrote:
> 
> On Thursday 20 December 2001 16:03, Warren W. Thompson wrote:
> > Is it possible to embed Swing components, like a JTextField, inside of
> > an SVG file being shown in a JSVGCanvas? The closest thing that I found
> > on the Batik Web site was the section that deals with 'Extensions' to the
> > SVG XML. Has anyone successfully done something like this?
> 
> I manage to include swing component inside SVG using extensions. What have
> done is:
> 
> - a custom SwingGraphicsNode that extends AbstractGaphicsNode and delegates
> to an enclosed swing component the primitive paint (basically, the GVT's
> primitivePaint calls the paintComponent methods).
> 
> - a custom bridge that builds this SwingGraphicsNode (through elements such
> as: <batikSwing:jbutton ...>
> 
> Then, you have swing inside JSVGCanvas through SVG syntax. The problem now
> (much more difficult) is to handle events properly and repaint the widget if
> necessary.
> 
> repaint could be done when batik will be dynamique, events are trickier.
> 
> Good luck.
> Thierry.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

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


Mime
View raw message