Package org.eclipse.draw2d

Examples of org.eclipse.draw2d.ScalableLayeredPane


    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()};

    ByteArrayOutputStream os = new ByteArrayOutputStream();
    loader.save(os, SWT.IMAGE_BMP);

    layer.setScale(scale);

    try
    {
      PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
      pras.add(new Copies(1));
View Full Code Here


    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()};

    ByteArrayOutputStream os = new ByteArrayOutputStream();
    loader.save(os, SWT.IMAGE_BMP);

    layer.setScale(scale);

    try
    {
      PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
      pras.add(new Copies(1));
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.ScalableLayeredPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.