xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Visibility on an element?
Date Sun, 17 Sep 2006 12:45:10 GMT
Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Michael.Bishop@je.jfcom.mil> wrote on 
09/15/2006 01:29:18 PM:

> Is there any way to determine whether or not an SVG is visible?  I?m 
looking 
> for a global solution.  I?m trying to work with layers:

   I guess I'm not sure what you mean by visibility.  As you hint
below visibility doesn't mean much for a group (as any child can
set 'visibility="visible"' and be visible).  Also many things like
fill='none' stroke='none', or opacity='0' are treated very similar 
to visibility='hidden'.

> <g style=?display:none?> is the way I indicate a layer is not visible. 
I?m 
> sure there are other ways to turn it off as well.

   display:none is a bit different as children can not override this.
Additionally a display:none element won't have any 'peer' in the
Graphics tree.  The easiest thing is to use the CSS DOM to query
the value of the 'display' property on the element.

> However, for visible layers:
> 
> <g> and <g style=?display:block?> would work and I?m sure there are 
other ways.

   In SVG there is display:none and display:<anything else> so you simply
need to check if the display properties value is 'none'.  The first case
will have it's parent's value for display.

> Is there a way to find this out?  Maybe at a lower-level?  Is there a 
point 
> where Batik decides whether or not to draw a particular object? 
Obviously a 
> <g> tag isn?t typically ?drawn? anyway so this setting would apply to 
its 
> children which may complicate the solution.

        We use 'batik.bridge.CSSUtilities.convertDisplay(Element e)' to
determine this.


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


Mime
View raw message