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