Runtime

## org.eclipse.gmf.runtime.diagram.ui.render.clipboard
Class DiagramSVGGenerator

    java.lang.Object
      org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator
          org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramSVGGenerator

public class DiagramSVGGenerator
extends DiagramGenerator

Supports generation of an SVG DOM for a diagram or a subset of editparts on a diagram.

Constructor Summary
`DiagramSVGGenerator(DiagramEditPart diagramEditPart)` Creates a new instance.

Method Summary
`java.awt.Image` `createAWTImageForParts(java.util.List editparts)` Creates an AWT image for the list of editparts passed in.
`protected ImageDescriptor` `getImageDescriptor(Graphics g)` Creates an image descriptor representing the image rendered from the diagram.
`protected Graphics` `setUpGraphics(int width, int height)` Allows hook for the creation of a `Graphics` object that is used for the rendering of the diagram.
`void` `stream(java.io.OutputStream outputStream)` Writes the SVG Model out to a file.

Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator
`calculateImageRectangle, createAWTImageForDiagram, createSWTImageDescriptorForDiagram, createSWTImageDescriptorForParts, disposeGraphics, getDiagramEditPart, getDiagramPartInfo, getImageMargin, getMapMode, renderToGraphics`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DiagramSVGGenerator

    public DiagramSVGGenerator(DiagramEditPart diagramEditPart)

  Creates a new instance.

Parameters:
  `diagramEditPart` - the diagram editpart

Method Detail

### setUpGraphics

    protected Graphics setUpGraphics(int width,
                                     int height)

  Description copied from class: `DiagramGenerator`
  Allows hook for the creation of a `Graphics` object that is used for the rendering of the diagram.

  Specified by:
    `setUpGraphics` in class `DiagramGenerator`
  Parameters:
    `width` - of the clipping area
    `height` - of the clipping area
  Returns:
    Graphics element that is the target for rendering.

### getImageDescriptor

    protected ImageDescriptor getImageDescriptor(Graphics g)

  Description copied from class: `DiagramGenerator`
  Creates an image descriptor representing the image rendered from the diagram.

  Specified by:
    `getImageDescriptor` in class `DiagramGenerator`
  Parameters:
    `g` - Graphics object where information to form the image descriptor can be retrieved from.
  Returns:
    ImageDescriptor representing the image rendered from the diagram.

### stream

    public void stream(java.io.OutputStream outputStream)

  Writes the SVG Model out to a file.

  Parameters:
    `outputStream` - output stream to store the SVG Model

### createAWTImageForParts

    public java.awt.Image createAWTImageForParts(java.util.List editparts)

  Description copied from class: `DiagramGenerator`
  Creates an AWT image for the list of editparts passed in.

  Specified by:
    `createAWTImageForParts` in class `DiagramGenerator`
  Parameters:
    `editparts` - the list of `IGraphicalEditParts` that will be rendered to the Image
  Returns:
    an image in AWT format

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.