Package com.mxgraph.canvas
Class mxImageCanvas
java.lang.Object
com.mxgraph.canvas.mxImageCanvas
- All Implemented Interfaces:
mxICanvas
An implementation of a canvas that uses Graphics2D for painting. To use an
image canvas for an existing graphics canvas and create an image the
following code is used:
BufferedImage image = mxCellRenderer.createBufferedImage(graph, cells, 1, Color.white, true, null, canvas);-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected mxGraphics2DCanvasprotected BufferedImageprotected Graphics2D -
Constructor Summary
ConstructorsConstructorDescriptionmxImageCanvas(mxGraphics2DCanvas canvas, int width, int height, Color background, boolean antiAlias) mxImageCanvas(mxGraphics2DCanvas canvas, int width, int height, Color background, boolean antiAlias, boolean textAntiAlias) -
Method Summary
Modifier and TypeMethodDescriptiondestroy()drawCell(mxCellState state) Draws the given cell.drawLabel(String label, mxCellState state, boolean html) Draws the given label.getImage()doublegetScale()Returns the scale.Returns the current translation.voidsetScale(double scale) Sets the scale for the following drawing requests.voidsetTranslate(double dx, double dy) Sets the translation for the following drawing requests.
-
Field Details
-
canvas
-
previousGraphics
-
image
-
-
Constructor Details
-
mxImageCanvas
public mxImageCanvas(mxGraphics2DCanvas canvas, int width, int height, Color background, boolean antiAlias) -
mxImageCanvas
public mxImageCanvas(mxGraphics2DCanvas canvas, int width, int height, Color background, boolean antiAlias, boolean textAntiAlias)
-
-
Method Details
-
getGraphicsCanvas
-
getImage
-
drawCell
Description copied from interface:mxICanvasDraws the given cell. -
drawLabel
Description copied from interface:mxICanvasDraws the given label. -
getScale
public double getScale()Description copied from interface:mxICanvasReturns the scale. -
getTranslate
Description copied from interface:mxICanvasReturns the current translation.- Specified by:
getTranslatein interfacemxICanvas- Returns:
- Returns the current translation.
-
setScale
public void setScale(double scale) Description copied from interface:mxICanvasSets the scale for the following drawing requests. -
setTranslate
public void setTranslate(double dx, double dy) Description copied from interface:mxICanvasSets the translation for the following drawing requests.- Specified by:
setTranslatein interfacemxICanvas
-
destroy
-