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 Thu, 21 Sep 2006 09:47:38 GMT
Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Michael.Bishop@je.jfcom.mil> wrote on 
09/19/2006 10:22:29 AM:

> Any ideas on this?

   For what ever reason the DOM you are working with does not have
the CSS cascade done.  Are you sure that this node is from the
document in the Canvas and that the canvas was built with
dynamic support?  In some cases the Canvas will clone
the given document so that the document it renders uses the
Batik DOMImplementation.

   BTW, this is just another manifestation of the same problem
you had with the background color...

> I tried using the CSSUtilities method.  Here's the
> element I tested:
> 
> <g style="display: block" xmlns="http://www.w3.org/2000/svg"
> id="SVGWB-1125B997-4DAD-AB9C-13B0-2D57691CF303"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xmlns:svgx="http://je.jfcom.mil/svgx" svgx:name="default_layer"
> svgx:type="layer" pointer-events="none"/>
> 
> And I got a stack trace that goes into the CSSUtilities:
> 
> Caused by: java.lang.NullPointerException
> 
>         at org.apache.batik.bridge.CSSUtilities.convertDisplay(Unknown
> Source)



> 
>         at
> mil.jfcom.cie.whiteboard.util.LayerUtil.isVisible(LayerUtil.java:85)
> 
>         at
> mil.jfcom.cie.whiteboard.ui.WBLayerListItem.initJCheckBox(WBLayerListIte
> m.java:119)
> 
>         at
> mil.jfcom.cie.whiteboard.ui.WBLayerListItem.init(WBLayerListItem.java:10
> 3)
> 
>         at
> mil.jfcom.cie.whiteboard.ui.WBLayerListItem.<init>(WBLayerListItem.java:
> 58)
> 
>         at
> mil.jfcom.cie.whiteboard.ui.WBLayerPanel.rebuildLayerList(WBLayerPanel.j
> ava:68)
> 
>         at
> mil.jfcom.cie.whiteboard.ui.managers.GUIManager.rebuildLayerList(GUIMana
> ger.java:210)
> 
>         at
> mil.jfcom.cie.whiteboard.ui.managers.GUIManager.rebuildLayerInfo(GUIMana
> ger.java:202)
> 
>         at
> mil.jfcom.cie.whiteboard.ui.managers.GUIManager.setSvgDocument(GUIManage
> r.java:184)
> 
>         at
> mil.jfcom.cie.whiteboard.ui.managers.WBManager.setDefaultWhiteboard(WBMa
> nager.java:105)
> 
>         at mil.jfcom.cie.whiteboard.Main.main(Main.java:85)
> 
>         ... 6 more
> 
> 
> -----Original Message-----
> From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
> Sent: Sunday, September 17, 2006 8:45 AM
> To: batik-users@xmlgraphics.apache.org
> Cc: batik-users@xmlgraphics.apache.org
> Subject: Re: Visibility on an element?
> 
> 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
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