>>>>> "MP" == Michał Piotrowski <[EMAIL PROTECTED]> writes:
MP> I have written a Batik extension (extending BatikShapeElementBridge)
MP> similar to BatikStarElementBridge. It is specialized extension which
MP> optimizes displaying rotated letters from TrueType font.
MP> This extension was working fine with Batik 1.1.1 and Batik 1.5 beta1,
MP> but when I switched to beta 2 I received this exception:
Due to the new CSS Engine (much, much faster than before - thanks
Stephane & Thierry!) it is important that elements that you register a
bridge for implement 'org.apache.batik.css.engine.CSSStylableElement'.
This is needed because the GVTBuilder does some checking of SVG
properties for you (such as display='none' in this case).
In 1.5b2 We updated the extension elements in batik.extension to
do the right thing here. So if you aren't already registering element
factories for your elements in the DOM you should start doing so, and
if you were already you should make sure the elements you create
support the needed CSS interfaces.
I suppose it would be cleaner if the GVTBuilder didn't _require_
you to implement CSS. Thierry would it be hard for the GVTBuilder to
defer these checks to the associated bridge?
In both places the BridgeContext asks for 'convertDisplay' it
already has the bridge for the element in question. So it could just
call bridge.isDisplayed(e) or some such...
MP> java.lang.ClassCastException: org.apache.batik.dom.GenericElementNS
MP> at org.apache.batik.bridge.CSSUtilities.getComputedStyle(Unknown Source)
MP> at org.apache.batik.bridge.CSSUtilities.convertDisplay(Unknown Source)
MP> at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
MP> at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
MP> at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
MP> at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
MP> at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
MP> at org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown Source)
MP> I checked if Batik Browser displays your example BatikStar extension
MP> and it didn't display the star element.
I suspect you used java -jar batik-svgbrowser.jar ... (or double
clicked on the jar file in windows). In which case the browser
doesn't get our extensions by default. If you run the browser through
'build.sh svgbrowser ...' you do get the extensions. This is
basically because we want the inclusion of extensions to be a very
deliberate thing.
Extensions are very powerful but if not used with great care they
can easily destroy a standard which would be a pity since the whole
reason we commited to Batik is to create a good standards compliant
SVG Toolkit - to promote the widespread use of the SVG standard.
MP> Thanks in advance for any answer to that problem
Hope it helps...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]