// Some editors place a 3 byte BOM at the start of files
// Ensure the first char is a "<"
int lessthanIndex = nodeXml.indexOf("<");
nodeXml = nodeXml.substring(lessthanIndex);
mxStencilShape newShape = new mxStencilShape(nodeXml);
String name = newShape.getName();
ImageIcon icon = null;
if (path != null)
{
String iconPath = path + newShape.getIconPath();
icon = new ImageIcon(iconPath);
}
// Registers the shape in the canvas shape registry
mxGraphics2DCanvas.putShape(name, newShape);