* Handles the mutation of an attribute
* @param evt the DOM event
*/
public void handleEvent(Event evt){
MutationEvent event = (MutationEvent)evt;
BridgeMutationEvent mevent;
Element element = (Element)evt.getTarget();
GraphicsNode gn = context.getGraphicsNode(element);
if (gn != null){ // The mutation happends on a Graphics Node
mevent = new BridgeMutationEvent(element,
context,
BridgeMutationEvent.PROPERTY_MUTATION_TYPE);
mevent.setAttrName(event.getAttrName());
mevent.setAttrNewValue(event.getNewValue());
mevent.setGraphicsNode(gn);
context.getBridgeUpdateManager().addDirtyNode(gn, mevent);
} else {
// A mutation on a style element (for example a Gradient)
List references = context.getStyleReferenceList(element);
if (!references.isEmpty()) {
StyleReference reference;
BridgeMutationEvent elevt;
mevent = new BridgeMutationEvent(element,
context,
BridgeMutationEvent.PROPERTY_MUTATION_TYPE);
mevent.setAttrName(event.getAttrName());
mevent.setAttrNewValue(event.getNewValue());
for (Iterator it = references.iterator(); it.hasNext();) {
reference = (StyleReference)it.next();
elevt = new BridgeMutationEvent(context.getElement(reference.getGraphicsNode()),
context,
BridgeMutationEvent.STYLE_MUTATION_TYPE);
elevt.setGraphicsNode(reference.getGraphicsNode());
elevt.setAttrName(reference.getStyleAttribute());
elevt.setStyleMutationEvent(mevent);
context.getBridgeUpdateManager().addDirtyNode(gn, elevt);
}
}
}
// probably many other cases.