* @param ctx the bridge context to use
* @param e the element that describes the graphics node to build
* @return a graphics node that represents the specified element
*/
public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e) {
ShapeNode shapeNode = (ShapeNode)super.createGraphicsNode(ctx, e);
if (shapeNode == null) {
return null;
}
// delegates to subclasses the shape construction
buildShape(ctx, e, shapeNode);
if (shapeNode.getShape() == null) {
return null; // Disable the rendering if something bad happens
}
// 'shape-rendering' and 'color-rendering'
Map shapeHints = CSSUtilities.convertShapeRendering(e);
Map colorHints = CSSUtilities.convertColorRendering(e);
if (shapeHints != null || colorHints != null) {
RenderingHints hints;
if (shapeHints == null) {
hints = new RenderingHints(colorHints);
} else if (colorHints == null) {
hints = new RenderingHints(shapeHints);
} else {
hints = new RenderingHints(shapeHints);
hints.putAll(colorHints);
}
shapeNode.setRenderingHints(hints);
}
return shapeNode;
}