Any ideas on this? 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Sunday, September 17, 2006 8:45 AM To: [email protected] Cc: [email protected] Subject: Re: Visibility on an element? Hi Michael, "Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
