public interface mxICanvas2D
| Modifier and Type | Method and Description |
|---|---|
void |
begin()
Begins a new path.
|
void |
close()
Closes the current path.
|
void |
curveTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Draws a bezier curve to the given point.
|
void |
ellipse(double x,
double y,
double w,
double h)
Next fill or stroke should draw an ellipse.
|
void |
fill()
Fills the current path.
|
void |
fillAndStroke()
Fills and paints the outline of the current path.
|
void |
image(double x,
double y,
double w,
double h,
String src,
boolean aspect,
boolean flipH,
boolean flipV)
Draws the given image.
|
void |
lineTo(double x,
double y)
Draws a line to the given path.
|
void |
moveTo(double x,
double y)
Moves to the given path.
|
void |
quadTo(double x1,
double y1,
double x2,
double y2)
Draws a quadratic curve to the given point.
|
void |
rect(double x,
double y,
double w,
double h)
Next fill or stroke should draw a rectangle.
|
void |
restore()
Restores the previous state of the canvas.
|
void |
rotate(double theta,
boolean flipH,
boolean flipV,
double cx,
double cy)
Rotates the canvas by the given angle around the given center.
|
void |
roundrect(double x,
double y,
double w,
double h,
double dx,
double dy)
Next fill or stroke should draw a round rectangle.
|
void |
save()
Saves the current state of the canvas.
|
void |
scale(double value)
Uniformaly scales the canvas by the given amount.
|
void |
setAlpha(double value)
Default value 1.
|
void |
setDashed(boolean value)
Sets the dashed state.
|
void |
setDashPattern(String value)
Sets the dash pattern.
|
void |
setFillColor(String value)
Default value
mxConstants.NONE. |
void |
setFontBackgroundColor(String value)
Default value "#000000".
|
void |
setFontBorderColor(String value)
Default value "#000000".
|
void |
setFontColor(String value)
Default value "#000000".
|
void |
setFontFamily(String value)
Default value
mxConstants.DEFAULT_FONTFAMILY. |
void |
setFontSize(double value)
Default value
mxConstants.DEFAULT_FONTSIZE. |
void |
setFontStyle(int value)
Default value 0.
|
void |
setGradient(String color1,
String color2,
double x,
double y,
double w,
double h,
String direction,
double alpha1,
double alpha2)
Prepares the canvas to draw a gradient.
|
void |
setLineCap(String value)
Sets the linecap.
|
void |
setLineJoin(String value)
Sets the linejoin.
|
void |
setMiterLimit(double value)
Sets the miterlimit.
|
void |
setShadow(boolean enabled)
Enables or disables the painting of shadows.
|
void |
setShadowAlpha(double value)
Default value
mxConstants.NONE. |
void |
setShadowColor(String value)
Default value
mxConstants.NONE. |
void |
setShadowOffset(double dx,
double dy)
Default value
mxConstants.NONE. |
void |
setStrokeColor(String value)
Sets the stroke color.
|
void |
setStrokeWidth(double value)
Sets the stroke width.
|
void |
stroke()
Paints the outline of the current path.
|
void |
text(double x,
double y,
double w,
double h,
String str,
String align,
String valign,
boolean wrap,
String format,
String overflow,
boolean clip,
double rotation,
String dir)
Draws the given string.
|
void |
translate(double dx,
double dy)
Translates the canvas by the given amount.
|
void save()
void restore()
void scale(double value)
value - The new scale value.void translate(double dx,
double dy)
dx - X-coordinate of the translation.dy - Y-coordinate of the translation.void rotate(double theta,
boolean flipH,
boolean flipV,
double cx,
double cy)
theta - Rotation angle in degrees (0 - 360).flipH - Specifies if drawing should be flipped horizontally.flipV - Specifies if drawing should be flipped vertically.cx - X-coordinate of the center point.cy - Y-coordinate of the center point.void setStrokeWidth(double value)
value - Width of the stroke. The value should be multiplied by the
current scale.void setStrokeColor(String value)
mxConstants.NONE
if unset.value - Hex representation of the color or mxConstants.NONE.void setDashed(boolean value)
value - Boolean representing the dashed state.void setDashPattern(String value)
value - Space separated list of floats representing the dash
pattern. The value should be multiplied by the current scale.void setLineCap(String value)
value - "flat", "square" or "round".void setLineJoin(String value)
value - "miter", "round" or "bevel".void setMiterLimit(double value)
value - void setFontSize(double value)
mxConstants.DEFAULT_FONTSIZE.value - void setFontColor(String value)
value - Hex representation of the color or mxConstants.NONE.void setFontFamily(String value)
mxConstants.DEFAULT_FONTFAMILY.value - void setFontStyle(int value)
mxConstants.STYLE_FONTSTYLE.value - void setFontBackgroundColor(String value)
value - Hex representation of the color or mxConstants.NONE.void setFontBorderColor(String value)
value - Hex representation of the color or mxConstants.NONE.void setAlpha(double value)
value - void setFillColor(String value)
mxConstants.NONE.value - Hex representation of the color or mxConstants.NONE.void setGradient(String color1, String color2, double x, double y, double w, double h, String direction, double alpha1, double alpha2)
color1 - color2 - x - y - w - h - direction - Direction may be null. Use default value
mxConstants.DIRECTION_SOUTH.void setShadow(boolean enabled)
enabled - Whether the shadow should be enabled.void setShadowColor(String value)
mxConstants.NONE.value - Hex representation of the color or mxConstants.NONE.void setShadowAlpha(double value)
mxConstants.NONE.value - Hex representation of the color or mxConstants.NONE.void setShadowOffset(double dx,
double dy)
mxConstants.NONE.value - Hex representation of the color or mxConstants.NONE.void rect(double x,
double y,
double w,
double h)
x - y - w - h - void roundrect(double x,
double y,
double w,
double h,
double dx,
double dy)
x - y - w - h - dx - dy - void ellipse(double x,
double y,
double w,
double h)
x - y - w - h - void image(double x,
double y,
double w,
double h,
String src,
boolean aspect,
boolean flipH,
boolean flipV)
x - y - w - h - src - aspect - flipH - flipV - void text(double x,
double y,
double w,
double h,
String str,
String align,
String valign,
boolean wrap,
String format,
String overflow,
boolean clip,
double rotation,
String dir)
x - y - w - h - str - align - valign - wrap - format - overflow - clip - rotation - dir - void begin()
void moveTo(double x,
double y)
x - y - void lineTo(double x,
double y)
x - y - void quadTo(double x1,
double y1,
double x2,
double y2)
x1 - y1 - x2 - y2 - void curveTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
x1 - y1 - x2 - y2 - x3 - y3 - void close()
void stroke()
void fill()
void fillAndStroke()
Copyright (c) 2010 Gaudenz Alder. All rights reserved.