SVGRoot root = diagram.getRoot();
if (( oldWidth != width ) || ( oldHeight != height )) {
if ( root != null ) {
root.setAttribute( "width", AnimationElement.AT_XML, Double.toString( width ));
root.setAttribute( "height", AnimationElement.AT_XML, Double.toString( height ));
root.build();
//diagram.setDeviceViewport( new Rectangle( 0,0,width, height));
oldWidth = width;
oldHeight = height;
}