I am trying to use switch element for tabpane functionality. That is, to
dynamically switch the displayed elements using a variable other than
systemLanguage, requireExtensions, and requiredFeatures. I made a new
attribute contant SWITCH_ATTRIBUTE and modified the
SVGSwitchElementBridge. The static display is fine. But it does not in
the dynamic way. When I modified the DOM tree in Javascript (modify
SWITCH_ATTRIBUTE), the Switch element won't refresh and display another
element.
I modified SVGSwitchElementBridge to extend SVGShapeElementBridge and
added the following methods:
protected void buildShape(BridgeContext ctx,
Element e,
ShapeNode shapeNode) {
ShapeNode showNode = (ShapeNode) createGraphicsNode(ctx, e);
shapeNode.setShape(showNode.getShape());
}
/**
* Invoked when an MutationEvent of type 'DOMAttrModified' is fired.
*/
public void handleDOMAttrModifiedEvent(MutationEvent evt) {
String attrName = evt.getAttrName();
System.out.println("SVGSwitchElementBridge: event"+evt+"
"+attrName);
buildShape(ctx,e, (ShapeNode) node);
handleGeometryChanged();
}
But the content still won't be refreshed. It didn't print out the
message so the handleDomAttrModifiedEvent is not called. I found
handleDOMNodeInsertedEvent and other events are also not called. How
could I let the JavaScript event trigger DOM tree update, then refresh
display? Thanks a lot.
With best regards,
William
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]