public class mxGraphics2DCanvas extends mxBasicCanvas
Modifier and Type | Field and Description |
---|---|
protected java.awt.Graphics2D |
g
Global graphics handle to the image.
|
static int |
IMAGE_SCALING
Specifies the image scaling quality.
|
protected javax.swing.CellRendererPane |
rendererPane
Optional renderer pane to be used for HTML label rendering.
|
protected static java.util.Map<java.lang.String,mxIShape> |
shapes
Maps from names to mxIVertexShape instances.
|
static java.lang.String |
TEXT_SHAPE_DEFAULT |
static java.lang.String |
TEXT_SHAPE_HTML |
protected static java.util.Map<java.lang.String,mxITextShape> |
textShapes
Maps from names to mxITextShape instances.
|
DEFAULT_IMAGEBASEPATH, drawLabels, imageBasePath, imageCache, PRESERVE_IMAGE_ASPECT, scale, translate
Constructor and Description |
---|
mxGraphics2DCanvas()
Constructs a new graphics canvas with an empty graphics object.
|
mxGraphics2DCanvas(java.awt.Graphics2D g)
Constructs a new graphics canvas for the given graphics object.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Paint |
createFillPaint(mxRectangle bounds,
java.util.Map<java.lang.String,java.lang.Object> style) |
java.awt.Stroke |
createStroke(java.util.Map<java.lang.String,java.lang.Object> style) |
java.awt.Graphics2D |
createTemporaryGraphics(java.util.Map<java.lang.String,java.lang.Object> style,
float opacity,
mxRectangle bounds) |
java.lang.Object |
drawCell(mxCellState state)
Draws the given cell.
|
void |
drawImage(java.awt.Rectangle bounds,
java.lang.String imageUrl) |
void |
drawImage(java.awt.Rectangle bounds,
java.lang.String imageUrl,
boolean preserveAspect,
boolean flipH,
boolean flipV) |
protected void |
drawImageImpl(java.awt.Image image,
int x,
int y)
Implements the actual graphics call.
|
java.lang.Object |
drawLabel(java.lang.String text,
mxCellState state,
boolean html)
Draws the given label.
|
void |
fillShape(java.awt.Shape shape) |
void |
fillShape(java.awt.Shape shape,
boolean shadow) |
java.awt.Graphics2D |
getGraphics()
Returns the graphics object for this canvas.
|
protected java.awt.Dimension |
getImageSize(java.awt.Image image)
Returns the size for the given image.
|
javax.swing.CellRendererPane |
getRendererPane() |
mxIShape |
getShape(java.util.Map<java.lang.String,java.lang.Object> style) |
mxITextShape |
getTextShape(java.util.Map<java.lang.String,java.lang.Object> style,
boolean html) |
void |
paintPolyline(mxPoint[] points,
boolean rounded) |
void |
paintRectangle(java.awt.Rectangle bounds,
java.awt.Color background,
java.awt.Color border) |
static void |
putShape(java.lang.String name,
mxIShape shape) |
static void |
putTextShape(java.lang.String name,
mxITextShape shape) |
void |
setGraphics(java.awt.Graphics2D g)
Sets the graphics object for this canvas.
|
flushImageCache, getImageBasePath, getImageForStyle, getScale, getTranslate, isDrawLabels, loadImage, setDrawLabels, setImageBasePath, setScale, setTranslate
public static final java.lang.String TEXT_SHAPE_DEFAULT
public static final java.lang.String TEXT_SHAPE_HTML
public static int IMAGE_SCALING
protected static java.util.Map<java.lang.String,mxIShape> shapes
protected static java.util.Map<java.lang.String,mxITextShape> textShapes
protected javax.swing.CellRendererPane rendererPane
protected java.awt.Graphics2D g
public mxGraphics2DCanvas()
public mxGraphics2DCanvas(java.awt.Graphics2D g)
public static void putShape(java.lang.String name, mxIShape shape)
public mxIShape getShape(java.util.Map<java.lang.String,java.lang.Object> style)
public static void putTextShape(java.lang.String name, mxITextShape shape)
public mxITextShape getTextShape(java.util.Map<java.lang.String,java.lang.Object> style, boolean html)
public javax.swing.CellRendererPane getRendererPane()
public java.awt.Graphics2D getGraphics()
public void setGraphics(java.awt.Graphics2D g)
public java.lang.Object drawCell(mxCellState state)
mxICanvas
state
- State of the cell to be painted.public java.lang.Object drawLabel(java.lang.String text, mxCellState state, boolean html)
mxICanvas
text
- 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 void drawImage(java.awt.Rectangle bounds, java.lang.String imageUrl)
public void drawImage(java.awt.Rectangle bounds, java.lang.String imageUrl, boolean preserveAspect, boolean flipH, boolean flipV)
protected void drawImageImpl(java.awt.Image image, int x, int y)
protected java.awt.Dimension getImageSize(java.awt.Image image)
public void paintPolyline(mxPoint[] points, boolean rounded)
public void paintRectangle(java.awt.Rectangle bounds, java.awt.Color background, java.awt.Color border)
public void fillShape(java.awt.Shape shape)
public void fillShape(java.awt.Shape shape, boolean shadow)
public java.awt.Stroke createStroke(java.util.Map<java.lang.String,java.lang.Object> style)
public java.awt.Paint createFillPaint(mxRectangle bounds, java.util.Map<java.lang.String,java.lang.Object> style)
public java.awt.Graphics2D createTemporaryGraphics(java.util.Map<java.lang.String,java.lang.Object> style, float opacity, mxRectangle bounds)
Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.