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 mxGraphics2DCanvas
protected BufferedImage
protected 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()
double
getScale()
Returns the scale.Returns the current translation.void
setScale
(double scale) Sets the scale for the following drawing requests.void
setTranslate
(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:mxICanvas
Draws the given cell. -
drawLabel
Description copied from interface:mxICanvas
Draws the given label. -
getScale
public double getScale()Description copied from interface:mxICanvas
Returns the scale. -
getTranslate
Description copied from interface:mxICanvas
Returns the current translation.- Specified by:
getTranslate
in interfacemxICanvas
- Returns:
- Returns the current translation.
-
setScale
public void setScale(double scale) Description copied from interface:mxICanvas
Sets the scale for the following drawing requests. -
setTranslate
public void setTranslate(double dx, double dy) Description copied from interface:mxICanvas
Sets the translation for the following drawing requests.- Specified by:
setTranslate
in interfacemxICanvas
-
destroy
-