Runtime

org.eclipse.gmf.runtime.diagram.ui.render.clipboard
Class DiagramImageGenerator

java.lang.Object
  extended byorg.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator
      extended byorg.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramImageGenerator

public class DiagramImageGenerator
extends DiagramGenerator

Supports generation of AWT and SWT images of a diagram or a subset of editparts on a diagram.


Constructor Summary
DiagramImageGenerator(DiagramEditPart dgrmEP)
          Creates a new instance.
 
Method Summary
 java.awt.Image createAWTImageForParts(java.util.List selectedObjects)
          Creates an AWT image for the list of editparts passed in.
protected  void disposeGraphics(Graphics g)
          Allows hook to dispose of any artifacts around the creation of the Graphics object used for rendering.
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.
 
Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator
calculateImageRectangle, createAWTImageForDiagram, createSWTImageDescriptorForDiagram, createSWTImageDescriptorForParts, 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

DiagramImageGenerator

public DiagramImageGenerator(DiagramEditPart dgrmEP)
Creates a new instance.

Parameters:
dgrmEP - 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.

disposeGraphics

protected void disposeGraphics(Graphics g)
Description copied from class: DiagramGenerator
Allows hook to dispose of any artifacts around the creation of the Graphics object used for rendering.

Overrides:
disposeGraphics in class DiagramGenerator
Parameters:
g - Graphics element that is to be disposed.

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.

createAWTImageForParts

public java.awt.Image createAWTImageForParts(java.util.List selectedObjects)
Description copied from class: DiagramGenerator
Creates an AWT image for the list of editparts passed in.

Specified by:
createAWTImageForParts in class DiagramGenerator
Parameters:
selectedObjects - 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.