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 "John C. Turnbull" <oz...@ozemail.com.au> on 2008/10/12 22:51:01 UTC

Overlapping SVGs

I would like to use a custom Swing layout manager which enables components
to be positioned such that they may overlap parts of each other.  The idea
is that the overlapped component will "show through" the component on top of
it as if the top component was transparent.  If each component is a
JSVGCanvas, will this work?  i.e. will the top SVG component appear as
transparent?  Do you foresee any problems with overlapping SVGs?

 

Thanks,

 

-JCT


RE: Overlapping SVGs

Posted by "John C. Turnbull" <oz...@ozemail.com.au>.
Hi Thomas,

 

Thanks very much for the info.  Do you know of any examples of using
overlapping canvases with Batik that I might be able to look at?

 

-JCT

 

From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Sent: Monday, 13 October 2008 22:40
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Overlapping SVGs

 


Hi John,

"John C. Turnbull" <oz...@ozemail.com.au> wrote on 10/12/2008 04:51:01 PM:

> I would like to use a custom Swing layout manager which enables 
> components to be positioned such that they may overlap parts of each
> other.  The idea is that the overlapped component will "show 
> through" the component on top of it as if the top component was 
> transparent.  If each component is a JSVGCanvas, will this work? 
> i.e. will the top SVG component appear as transparent?   

   Yes, but you need to set the Background color of the 
canvas to a fully transparent color and notify swing that 
the component may be partially transparent. 

   canvas.setBackground(new Color(0,0,0,0)); 
   canvas.setOpaque(false); 

> Do you foresee any problems with overlapping SVGs? 

   No, people have done this before, keeping the 
Canvas's aligned tends to be the biggest problem 
people have.  It's pretty easy if you can simply 
override 'setRenderingTransform' on the top canvas 
to update the rendering transform on the lower 
canvases. 


Re: Overlapping SVGs

Posted by th...@kodak.com.
Hi John,

"John C. Turnbull" <oz...@ozemail.com.au> wrote on 10/12/2008 04:51:01 
PM:

> I would like to use a custom Swing layout manager which enables 
> components to be positioned such that they may overlap parts of each
> other.  The idea is that the overlapped component will ?show 
> through? the component on top of it as if the top component was 
> transparent.  If each component is a JSVGCanvas, will this work?
> i.e. will the top SVG component appear as transparent? 

   Yes, but you need to set the Background color of the
canvas to a fully transparent color and notify swing that
the component may be partially transparent.

   canvas.setBackground(new Color(0,0,0,0));
   canvas.setOpaque(false);

> Do you foresee any problems with overlapping SVGs?

   No, people have done this before, keeping the
Canvas's aligned tends to be the biggest problem
people have.  It's pretty easy if you can simply
override 'setRenderingTransform' on the top canvas
to update the rendering transform on the lower
canvases.