private void saveImage ( final Component comp , DiagramType type , AbstractRoboconfTransformer transformer , StringBuilder sb ) throws IOException { String baseName = comp . getName ( ) + "_" + type ; //$NON-NLS-1$ String relativePath = "png/" + baseName + ".png" ; //$NON-NLS-1$ //$NON-NLS-2$ if ( this . options . containsKey ( DocConstants . OPTION_GEN_IMAGES_ONCE ) ) relativePath = "../" + relativePath ; File pngFile = new File ( this . outputDirectory , relativePath ) . getCanonicalFile ( ) ; if ( ! pngFile . exists ( ) ) { Utils . createDirectory ( pngFile . getParentFile ( ) ) ; GraphUtils . writeGraph ( pngFile , comp , transformer . getConfiguredLayout ( ) , transformer . getGraph ( ) , transformer . getEdgeShapeTransformer ( ) , this . options ) ; } sb . append ( renderImage ( comp . getName ( ) , type , relativePath ) ) ; }
Generates and saves an image .