}
public void run()
{
final Shell shell = main.getShell();
Figure rootFigure;
Rectangle bounds;
if (main.getViewer() == null) return;
rootFigure = (Figure) ((ChsScalableRootEditPart) main.getViewer().
getRootEditPart()).getFigure().getChildren().get(0);
ScalableLayeredPane layer =
(ScalableLayeredPane) rootFigure.getChildren().get(0);
double scale = layer.getScale();
layer.setScale(1.0);
bounds = getBounds(main.getViewer(), rootFigure);
final Image image = new Image(shell.getDisplay(), bounds);
GC gc = new GC(image);
if (ChisioMain.runningOnWindows)
{
gc.setAntialias(SWT.ON);
gc.setTextAntialias(SWT.ON);
}
else
{
gc.setAntialias(SWT.OFF);
gc.setTextAntialias(SWT.OFF);
}
Graphics graphics = new SWTGraphics(gc);
rootFigure.paint(graphics);
graphics.dispose();
ImageLoader loader = new ImageLoader();
loader.data = new ImageData[]{image.getImageData()};