public class mxHtmlCanvas extends mxBasicCanvas
Modifier and Type | Field and Description |
---|---|
protected org.w3c.dom.Document |
document
Holds the HTML document that represents the canvas.
|
DEFAULT_IMAGEBASEPATH, drawLabels, imageBasePath, imageCache, PRESERVE_IMAGE_ASPECT, scale, translate
Constructor and Description |
---|
mxHtmlCanvas()
Constructs a new HTML canvas for the specified dimension and scale.
|
mxHtmlCanvas(org.w3c.dom.Document document)
Constructs a new HTML canvas for the specified bounds, scale and
background color.
|
Modifier and Type | Method and Description |
---|---|
void |
appendHtmlElement(org.w3c.dom.Element node) |
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.
|
void |
drawLine(java.util.List<mxPoint> pts,
java.util.Map<java.lang.String,java.lang.Object> style)
Draws the given lines as segments between all points of the given list
of mxPoints.
|
protected void |
drawSegment(int x0,
int y0,
int x1,
int y1,
java.lang.String strokeColor,
int strokeWidth)
Draws the specified segment of a line.
|
org.w3c.dom.Element |
drawShape(int x,
int y,
int w,
int h,
java.util.Map<java.lang.String,java.lang.Object> style)
Draws the shape specified with the STYLE_SHAPE key in the given style.
|
org.w3c.dom.Element |
drawText(java.lang.String text,
int x,
int y,
int w,
int h,
java.util.Map<java.lang.String,java.lang.Object> style)
Draws the specified text either using drawHtmlString or using drawString.
|
org.w3c.dom.Document |
getDocument()
Returns a reference to the document that represents the canvas.
|
void |
setDocument(org.w3c.dom.Document document) |
flushImageCache, getImageBasePath, getImageForStyle, getScale, getTranslate, isDrawLabels, loadImage, setDrawLabels, setImageBasePath, setScale, setTranslate
protected org.w3c.dom.Document document
public mxHtmlCanvas()
public mxHtmlCanvas(org.w3c.dom.Document document)
public void appendHtmlElement(org.w3c.dom.Element node)
public void setDocument(org.w3c.dom.Document document)
public org.w3c.dom.Document getDocument()
public java.lang.Object drawCell(mxCellState state)
mxICanvas
state
- State of the cell to be painted.public java.lang.Object drawLabel(java.lang.String label, mxCellState state, boolean html)
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 org.w3c.dom.Element drawShape(int x, int y, int w, int h, java.util.Map<java.lang.String,java.lang.Object> style)
x
- X-coordinate of the shape.y
- Y-coordinate of the shape.w
- Width of the shape.h
- Height of the shape.style
- Style of the the shape.public void drawLine(java.util.List<mxPoint> pts, java.util.Map<java.lang.String,java.lang.Object> style)
pts
- List of points that define the line.style
- Style to be used for painting the line.protected void drawSegment(int x0, int y0, int x1, int y1, java.lang.String strokeColor, int strokeWidth)
x0
- X-coordinate of the start point.y0
- Y-coordinate of the start point.x1
- X-coordinate of the end point.y1
- Y-coordinate of the end point.strokeColor
- Color of the stroke to be painted.strokeWidth
- Width of the stroke to be painted.public org.w3c.dom.Element drawText(java.lang.String text, int x, int y, int w, int h, java.util.Map<java.lang.String,java.lang.Object> style)
text
- Text to be painted.x
- X-coordinate of the text.y
- Y-coordinate of the text.w
- Width of the text.h
- Height of the text.style
- Style to be used for painting the text.Copyright (c) 2010-2017 Gaudenz Alder, JGraph Ltd. All rights reserved.