JGraph X 1.3.0.0

## com.mxgraph.canvas
Class mxImageCanvas

    java.lang.Object
      com.mxgraph.canvas.mxImageCanvas

All Implemented Interfaces:
  mxICanvas

    public class mxImageCanvas

extends java.lang.Object
implements mxICanvas

An implementation of a canvas that uses Graphics2D for painting. To use an image canvas for an existing graphics canvas and create an dimage the following code is used: `BufferedImage image = mxCellRenderer.createBufferedImage(graph, cells, 1, Color.white, true, null, canvas);`

Field Summary
`protected mxGraphics2DCanvas` `canvas`
`protected java.awt.image.BufferedImage` `image`
`protected java.awt.Graphics2D` `previousGraphics`

Constructor Summary
`mxImageCanvas(mxGraphics2DCanvas canvas, int width, int height, java.awt.Color background, boolean antiAlias)`

Method Summary
`java.awt.image.BufferedImage` `destroy()`
`java.lang.Object` `drawEdge(java.util.List<mxPoint> pts, java.util.Map<java.lang.String,java.lang.Object> style)` Draws the given edge.
`java.lang.Object` `drawLabel(java.lang.String label, int x, int y, int w, int h, java.util.Map<java.lang.String,java.lang.Object> style, boolean isHtml)` Draws the given label.
`java.lang.Object` `drawVertex(int x, int y, int w, int h, java.util.Map<java.lang.String,java.lang.Object> style)` Draws the given vertex.
`mxGraphics2DCanvas` `getGraphicsCanvas()`
`java.awt.image.BufferedImage` `getImage()`
`double` `getScale()` Returns the scale.
`java.awt.Point` `getTranslate()` Returns the current translation.
`void` `setScale(double scale)` Sets the scale for the following drawing requests.
`void` `setTranslate(int dx, int dy)` Sets the translation for the following drawing requests.

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

Field Detail

### canvas

    protected mxGraphics2DCanvas canvas

### previousGraphics

    protected java.awt.Graphics2D previousGraphics

### image

    protected java.awt.image.BufferedImage image

Constructor Detail

### mxImageCanvas

    public mxImageCanvas(mxGraphics2DCanvas canvas,
                         int width,
                         int height,
                         java.awt.Color background,
                         boolean antiAlias)

Method Detail

### getGraphicsCanvas

    public mxGraphics2DCanvas getGraphicsCanvas()

### getImage

    public java.awt.image.BufferedImage getImage()

### drawEdge

    public java.lang.Object drawEdge(java.util.List<mxPoint> pts,
                                     java.util.Map<java.lang.String,java.lang.Object> style)

  Description copied from interface: `mxICanvas`
  Draws the given edge.

  Specified by:
    `drawEdge` in interface `mxICanvas`
  Parameters:
    `pts` - List of mxPoints that make up the edge.
    `style` - Style of the edge.
  Returns:
    Optional object that represents the edge.

### drawLabel

    public java.lang.Object drawLabel(java.lang.String label,
                                      int x,
                                      int y,
                                      int w,
                                      int h,
                                      java.util.Map<java.lang.String,java.lang.Object> style,
                                      boolean isHtml)

  Description copied from interface: `mxICanvas`
  Draws the given label.

  Specified by:
    `drawLabel` in interface `mxICanvas`
  Parameters:
    `label` - String that represents the label.
    `x` - X-coordinate of the label.
    `y` - Y-coordinate of the label.
    `w` - Width of the label.
    `h` - Height of the label.
    `style` - Style of the label.
    `isHtml` - Specifies if the label contains HTML markup.
  Returns:
    Optional object that represents the label.

### drawVertex

    public java.lang.Object drawVertex(int x,
                                       int y,
                                       int w,
                                       int h,
                                       java.util.Map<java.lang.String,java.lang.Object> style)

  Description copied from interface: `mxICanvas`
  Draws the given vertex.

  Specified by:
    `drawVertex` in interface `mxICanvas`
  Parameters:
    `x` - X-coordinate of the vertex.
    `y` - Y-coordinate of the vertex.
    `w` - Width of the vertex.
    `h` - Height of the vertex.
    `style` - Style of the vertex.
  Returns:
    Optional object that represents the vertex.

### getScale

    public double getScale()

  Description copied from interface: `mxICanvas`
  Returns the scale.

  Specified by:
    `getScale` in interface `mxICanvas`

### getTranslate

    public java.awt.Point getTranslate()

  Description copied from interface: `mxICanvas`
  Returns the current translation.

  Specified by:
    `getTranslate` in interface `mxICanvas`
  Returns:
    Returns the current translation.

### setScale

    public void setScale(double scale)

  Description copied from interface: `mxICanvas`
  Sets the scale for the following drawing requests.

  Specified by:
    `setScale` in interface `mxICanvas`

### setTranslate

    public void setTranslate(int dx,
                             int dy)

  Description copied from interface: `mxICanvas`
  Sets the translation for the following drawing requests.

  Specified by:
    `setTranslate` in interface `mxICanvas`

### destroy

    public java.awt.image.BufferedImage destroy()

JGraph X 1.3.0.0

Copyright (c) 2008 Gaudenz Alder. All rights reserved.