protected Element createGroup ( String namespace , Object parent , Object group , String type ) { Element parentElement ; if ( parent == null ) { parentElement = getRootElement ( ) ; } else { parentElement = getGroup ( parent ) ; } if ( parentElement == null ) { return null ; } else { Element element ; String id = Dom . createUniqueId ( ) ; if ( group instanceof PaintableGroup ) { id = Dom . assembleId ( id , ( ( PaintableGroup ) group ) . getGroupName ( ) ) ; } groupToId . put ( group , id ) ; idToGroup . put ( id , group ) ; if ( Dom . NS_HTML . equals ( namespace ) ) { element = Dom . createElement ( "div" , id ) ; } else { element = Dom . createElementNS ( namespace , type , id ) ; } parentElement . appendChild ( element ) ; return element ; } }
Generic creation method for group elements .