|
JGraph X 1.4.0.9 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mxgraph.canvas.mxImageCanvas
public class mxImageCanvas
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 | |
---|---|
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 |
drawCell(mxCellState state)
Draws the given cell. |
java.lang.Object |
drawLabel(java.lang.String label,
mxCellState state,
boolean html)
Draws the given label. |
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 |
---|
protected mxGraphics2DCanvas canvas
protected java.awt.Graphics2D previousGraphics
protected java.awt.image.BufferedImage image
Constructor Detail |
---|
public mxImageCanvas(mxGraphics2DCanvas canvas, int width, int height, java.awt.Color background, boolean antiAlias)
Method Detail |
---|
public mxGraphics2DCanvas getGraphicsCanvas()
public java.awt.image.BufferedImage getImage()
public java.lang.Object drawCell(mxCellState state)
mxICanvas
drawCell
in interface mxICanvas
state
- State of the cell to be painted.
public java.lang.Object drawLabel(java.lang.String label, mxCellState state, boolean html)
mxICanvas
drawLabel
in interface mxICanvas
label
- String that represents the label.state
- State of the cell whose label is to be painted.html
- Specifies if the label contains HTML markup.
public double getScale()
mxICanvas
getScale
in interface mxICanvas
public java.awt.Point getTranslate()
mxICanvas
getTranslate
in interface mxICanvas
public void setScale(double scale)
mxICanvas
setScale
in interface mxICanvas
public void setTranslate(int dx, int dy)
mxICanvas
setTranslate
in interface mxICanvas
public java.awt.image.BufferedImage destroy()
|
JGraph X 1.4.0.9 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |