Xcos: restore diagrams rendering on help pages 08/17508/3
Clément DAVID [Fri, 27 Nov 2015 16:21:30 +0000 (17:21 +0100)]
Change-Id: I7ec7cddf2f4952bd87800fd26c1a4be6a23bd180

scilab/modules/xcos/src/java/org/scilab/modules/xcos/utils/XcosDelegates.java

index 6220bb9..df186f3 100644 (file)
@@ -53,13 +53,9 @@ public class XcosDelegates {
         diag.installListeners();
 
         final XcosFileType filetype = XcosFileType.findFileType(xcosFile);
-        // FIXME load file
-        //        filetype.load(xcosFile, diag);
-        //
-        //        final mxGraphComponent graphComponent = diag.getAsComponent();
-        //
-        //        final BufferedImage image = mxCellRenderer.createBufferedImage(diag, null, 1, null, graphComponent.isAntiAlias(), null, graphComponent.getCanvas());
-        final BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
+        filetype.load(xcosFile, diag);
+        final mxGraphComponent graphComponent = diag.getAsComponent();
+        final BufferedImage image = mxCellRenderer.createBufferedImage(diag, null, 1, null, graphComponent.isAntiAlias(), null, graphComponent.getCanvas());
         ImageIO.write(image, "png", imageFile);
 
         controller.deleteObject(diag.getUID());