question: public static String addStencilShape ( EditorPalette palette , String nodeXml , String path ) { 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 ) ; } mxGraphics2DCanvas . putShape ( name , newShape ) ; if ( palette != null && icon != null ) { palette . addTemplate ( name , icon , "shape=" + name , 80 , 80 , "" ) ; } return name ; }
target:  Loads and registers the shape as a new shape in mxGraphics2DCanvas and adds a new entry to use that shape in the specified palette