mxGraph
|
Implementation of a canvas that uses GDI for painting. More...
Public Member Functions | |
mxGdiCanvas () | |
Constructs a new GDI canvas. More... | |
mxGdiCanvas (Graphics g) | |
Constructs a new GDI canvas for the given graphics instance. More... | |
override Object | DrawCell (mxCellState state) |
see com.mxgraph.mxICanvas.DrawCell() More... | |
override Object | DrawLabel (string text, mxCellState state, bool html) |
see com.mxgraph.mxICanvas.DrawLabel() More... | |
void | DrawShape (int x, int y, int w, int h, Dictionary< string, Object > style) |
Draws the shape specified with the STYLE_SHAPE key in the given style. More... | |
void | DrawLine (List< mxPoint > pts, Dictionary< string, Object > style) |
Draws the given lines as segments between all points of the given list of mxPoints. More... | |
mxPoint | DrawMarker (Object type, mxPoint p0, mxPoint pe, float size, Pen pen) |
Draws the given type of marker. More... | |
void | DrawText (string text, int x, int y, int w, int h, Dictionary< string, Object > style) |
Draws the specified text either using drawHtmlString or using drawString. More... | |
void | Destroy () |
Destroys the canvas and frees all allocated resources. More... | |
Static Public Member Functions | |
static int | getArcSize (int w, int h) |
Computes the arc size for the given dimension. More... | |
Static Public Attributes | |
static bool | PRESERVE_IMAGE_ASPECT = true |
Specifies if image aspect should be preserved in drawImage. More... | |
Static Public Attributes inherited from com.mxgraph.mxBasicCanvas | |
static string | DEFAULT_IMAGEBASEPATH = "" |
Defines the default value for the imageBasePath in all GDI canvases. Default is an empty string. More... | |
Protected Member Functions | |
Image | LoadImage (String image) |
Returns an image instance for the given URL. If the URL has been loaded before than an instance of the same instance is returned as in the previous call. More... | |
void | DrawGlassEffect (int x, int y, int w, int h, Dictionary< string, Object > style) |
Draws the glass effect. More... | |
void | DrawPolygon (Point[] polygon, Brush brush, Pen pen, bool shadow) |
Draws a a polygon for the given parameters. More... | |
void | DrawPath (GraphicsPath path, Brush brush, Pen pen, bool shadow) |
Draws a path for the given parameters. More... | |
void | DrawRect (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow, bool rounded) |
Draws a rectangle for the given parameters. More... | |
void | DrawImage (int x, int y, int w, int h, String image) |
Draws an image for the given parameters. More... | |
void | DrawImage (int x, int y, int w, int h, String image, bool preserveAspect, bool flipH, bool flipV) |
Draws an image for the given parameters. More... | |
void | DrawOval (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow) |
Draws an oval for the given parameters. More... | |
void | DrawRhombus (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow) |
Draws an rhombus (aka. diamond) for the given parameters. More... | |
void | DrawCylinder (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow) |
Draws a cylinder for the given parameters. More... | |
void | DrawActor (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow) |
Draws an actor shape for the given parameters. More... | |
void | DrawCloud (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow) |
Draws a cloud shape for the given parameters. More... | |
void | DrawTriangle (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow, string direction) |
Draws a triangle shape for the given parameters. More... | |
void | DrawHexagon (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow, string direction) |
Draws a hexagon shape for the given parameters. More... | |
Protected Member Functions inherited from com.mxgraph.mxBasicCanvas | |
string | GetImageForStyle (Dictionary< string, Object > style) |
Gets the image path from the given style. If the path is relative (does not start with a slash) then it is appended to the imageBasePath. More... | |
Protected Attributes | |
Dictionary< string, Image > | imageCache = new Dictionary<string, Image>() |
Cache for loading images. More... | |
Graphics | g |
Global graphics handle to the image. More... | |
Protected Attributes inherited from com.mxgraph.mxBasicCanvas | |
string | imageBasePath = DEFAULT_IMAGEBASEPATH |
Defines the base path for images with relative paths. Trailing slash is required. Default value is DEFAULT_IMAGEBASEPATH. More... | |
Point | translate = new Point(0, 0) |
Specifies the current translation. Default is (0,0). More... | |
double | scale |
Specifies the current scale. Default is 1. More... | |
bool | drawLabels = true |
Specifies whether labels should be painted. Default is true. More... | |
Properties | |
Graphics | Graphics [get, set] |
Sets or gets the graphics object to paint the canvas. More... | |
Properties inherited from com.mxgraph.mxBasicCanvas | |
Point | Translate [get, set] |
see com.mxgraph.mxICanvas.Translate More... | |
double | Scale [get, set] |
see com.mxgraph.mxICanvas.Scale More... | |
bool | DrawLabels [get, set] |
Sets if labels should be visible. More... | |
string | ImageBasePath [get, set] |
Sets or gets the image base path. More... | |
Properties inherited from com.mxgraph.mxICanvas | |
Point | Translate [get, set] |
Sets or returns the user object of the cell. More... | |
double | Scale [get, set] |
Sets or returns the user object of the cell. More... | |
Implementation of a canvas that uses GDI for painting.
|
inline |
Constructs a new GDI canvas.
|
inline |
Constructs a new GDI canvas for the given graphics instance.
|
inline |
Destroys the canvas and frees all allocated resources.
|
inlineprotected |
Draws an actor shape for the given parameters.
x | X-coordinate of the shape. |
y | Y-coordinate of the shape. |
w | Width of the shape. |
h | Height of the shape. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
|
inlinevirtual |
see com.mxgraph.mxICanvas.DrawCell()
Implements com.mxgraph.mxBasicCanvas.
References com.mxgraph.mxCellState.AbsolutePointCount(), com.mxgraph.mxCellState.AbsolutePoints, com.mxgraph.mxConstants.DEFAULT_STARTSIZE, com.mxgraph.mxUtils.GetDouble(), com.mxgraph.mxUtils.GetFloat(), com.mxgraph.mxRectangle.GetRectangle(), com.mxgraph.mxStencilRegistry.GetStencil(), com.mxgraph.mxUtils.GetString(), com.mxgraph.mxUtils.IsTrue(), com.mxgraph.mxStencil.PaintShape(), com.mxgraph.mxConstants.SHAPE_SWIMLANE, com.mxgraph.mxCellState.Style, com.mxgraph.mxConstants.STYLE_FILLCOLOR, com.mxgraph.mxConstants.STYLE_HORIZONTAL, com.mxgraph.mxConstants.STYLE_ROTATION, com.mxgraph.mxConstants.STYLE_ROUNDED, com.mxgraph.mxConstants.STYLE_SHAPE, and com.mxgraph.mxConstants.STYLE_STARTSIZE.
|
inlineprotected |
Draws a cloud shape for the given parameters.
x | X-coordinate of the shape. |
y | Y-coordinate of the shape. |
w | Width of the shape. |
h | Height of the shape. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
|
inlineprotected |
Draws a cylinder for the given parameters.
x | X-coordinate of the shape. |
y | Y-coordinate of the shape. |
w | Width of the shape. |
h | Height of the shape. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
|
inlineprotected |
Draws the glass effect.
References com.mxgraph.mxUtils.GetFloat(), and com.mxgraph.mxConstants.STYLE_STROKEWIDTH.
|
inlineprotected |
Draws a hexagon shape for the given parameters.
x | X-coordinate of the shape. |
y | Y-coordinate of the shape. |
w | Width of the shape. |
h | Height of the shape. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
direction | Specifies the direction of the hexagon. |
References com.mxgraph.mxConstants.DIRECTION_NORTH, and com.mxgraph.mxConstants.DIRECTION_SOUTH.
|
inlineprotected |
Draws an image for the given parameters.
x | X-coordinate of the image. |
y | Y-coordinate of the image. |
w | Width of the image. |
h | Height of the image. |
image | URL of the image. |
|
inlineprotected |
Draws an image for the given parameters.
x | X-coordinate of the image. |
y | Y-coordinate of the image. |
w | Width of the image. |
h | Height of the image. |
image | URL of the image. |
|
inlinevirtual |
|
inline |
Draws the given lines as segments between all points of the given list of mxPoints.
pts | List of points that define the line. |
style | Style to be used for painting the line. |
References com.mxgraph.mxConstants.ARROW_SIZE, com.mxgraph.mxConstants.ARROW_SPACING, com.mxgraph.mxConstants.ARROW_WIDTH, com.mxgraph.mxPoint.Clone(), com.mxgraph.mxConstants.DEFAULT_MARKERSIZE, com.mxgraph.mxConstants.DIRECTION_EAST, com.mxgraph.mxConstants.DIRECTION_NORTH, com.mxgraph.mxConstants.DIRECTION_SOUTH, com.mxgraph.mxConstants.DIRECTION_WEST, com.mxgraph.mxUtils.GetColor(), com.mxgraph.mxUtils.GetFloat(), com.mxgraph.mxUtils.GetString(), com.mxgraph.mxUtils.IsTrue(), com.mxgraph.mxConstants.LINE_ARCSIZE, com.mxgraph.mxConstants.SHAPE_ARROW, com.mxgraph.mxConstants.STYLE_DASHED, com.mxgraph.mxConstants.STYLE_ENDARROW, com.mxgraph.mxConstants.STYLE_ENDSIZE, com.mxgraph.mxConstants.STYLE_FILLCOLOR, com.mxgraph.mxConstants.STYLE_GRADIENT_DIRECTION, com.mxgraph.mxConstants.STYLE_GRADIENTCOLOR, com.mxgraph.mxConstants.STYLE_OPACITY, com.mxgraph.mxConstants.STYLE_ROUNDED, com.mxgraph.mxConstants.STYLE_SHADOW, com.mxgraph.mxConstants.STYLE_SHAPE, com.mxgraph.mxConstants.STYLE_STARTARROW, com.mxgraph.mxConstants.STYLE_STARTSIZE, com.mxgraph.mxConstants.STYLE_STROKECOLOR, com.mxgraph.mxConstants.STYLE_STROKEWIDTH, com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.
|
inline |
Draws the given type of marker.
type | |
p0 | |
pe | |
size | |
pen |
References com.mxgraph.mxConstants.ARROW_BLOCK, com.mxgraph.mxConstants.ARROW_CLASSIC, com.mxgraph.mxConstants.ARROW_DIAMOND, com.mxgraph.mxConstants.ARROW_OPEN, com.mxgraph.mxConstants.ARROW_OVAL, com.mxgraph.mxPoint.Clone(), com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.
|
inlineprotected |
Draws an oval for the given parameters.
x | X-coordinate of the shape. |
y | Y-coordinate of the shape. |
w | Width of the shape. |
h | Height of the shape. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
References com.mxgraph.mxConstants.SHADOW_OFFSETX, com.mxgraph.mxConstants.SHADOW_OFFSETY, and com.mxgraph.mxConstants.SHADOWCOLOR.
|
inlineprotected |
Draws a path for the given parameters.
path | Path object to be drawn. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
References com.mxgraph.mxConstants.SHADOW_OFFSETX, com.mxgraph.mxConstants.SHADOW_OFFSETY, and com.mxgraph.mxConstants.SHADOWCOLOR.
|
inlineprotected |
Draws a a polygon for the given parameters.
polygon | Points of the polygon. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
References com.mxgraph.mxConstants.SHADOW_OFFSETX, com.mxgraph.mxConstants.SHADOW_OFFSETY, and com.mxgraph.mxConstants.SHADOWCOLOR.
|
inlineprotected |
Draws a rectangle for the given parameters.
x | X-coordinate of the shape. |
y | Y-coordinate of the shape. |
w | Width of the shape. |
h | Height of the shape. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
rounded | Boolean indicating if the rectangle is rounded. |
References com.mxgraph.mxConstants.SHADOW_OFFSETX, com.mxgraph.mxConstants.SHADOW_OFFSETY, and com.mxgraph.mxConstants.SHADOWCOLOR.
|
inlineprotected |
Draws an rhombus (aka. diamond) for the given parameters.
x | X-coordinate of the shape. |
y | Y-coordinate of the shape. |
w | Width of the shape. |
h | Height of the shape. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
|
inline |
Draws the shape specified with the STYLE_SHAPE key in the given 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. |
References com.mxgraph.mxConstants.ALIGN_BOTTOM, com.mxgraph.mxConstants.ALIGN_CENTER, com.mxgraph.mxConstants.ALIGN_LEFT, com.mxgraph.mxConstants.ALIGN_MIDDLE, com.mxgraph.mxConstants.ALIGN_RIGHT, com.mxgraph.mxConstants.ALIGN_TOP, com.mxgraph.mxConstants.DEFAULT_IMAGESIZE, com.mxgraph.mxConstants.DIRECTION_EAST, com.mxgraph.mxConstants.DIRECTION_NORTH, com.mxgraph.mxConstants.DIRECTION_SOUTH, com.mxgraph.mxConstants.DIRECTION_WEST, com.mxgraph.mxUtils.GetColor(), com.mxgraph.mxUtils.GetFloat(), com.mxgraph.mxUtils.GetInt(), com.mxgraph.mxUtils.GetString(), com.mxgraph.mxUtils.IsTrue(), com.mxgraph.mxConstants.SHAPE_ACTOR, com.mxgraph.mxConstants.SHAPE_CLOUD, com.mxgraph.mxConstants.SHAPE_CYLINDER, com.mxgraph.mxConstants.SHAPE_DOUBLE_ELLIPSE, com.mxgraph.mxConstants.SHAPE_ELLIPSE, com.mxgraph.mxConstants.SHAPE_HEXAGON, com.mxgraph.mxConstants.SHAPE_LABEL, com.mxgraph.mxConstants.SHAPE_LINE, com.mxgraph.mxConstants.SHAPE_RHOMBUS, com.mxgraph.mxConstants.SHAPE_TRIANGLE, com.mxgraph.mxConstants.STYLE_DASHED, com.mxgraph.mxConstants.STYLE_DIRECTION, com.mxgraph.mxConstants.STYLE_FILLCOLOR, com.mxgraph.mxConstants.STYLE_GLASS, com.mxgraph.mxConstants.STYLE_GRADIENT_DIRECTION, com.mxgraph.mxConstants.STYLE_GRADIENTCOLOR, com.mxgraph.mxConstants.STYLE_IMAGE, com.mxgraph.mxConstants.STYLE_IMAGE_ALIGN, com.mxgraph.mxConstants.STYLE_IMAGE_BACKGROUND, com.mxgraph.mxConstants.STYLE_IMAGE_BORDER, com.mxgraph.mxConstants.STYLE_IMAGE_FLIPH, com.mxgraph.mxConstants.STYLE_IMAGE_FLIPV, com.mxgraph.mxConstants.STYLE_IMAGE_HEIGHT, com.mxgraph.mxConstants.STYLE_IMAGE_VERTICAL_ALIGN, com.mxgraph.mxConstants.STYLE_IMAGE_WIDTH, com.mxgraph.mxConstants.STYLE_OPACITY, com.mxgraph.mxConstants.STYLE_ROUNDED, com.mxgraph.mxConstants.STYLE_SHADOW, com.mxgraph.mxConstants.STYLE_SHAPE, com.mxgraph.mxConstants.STYLE_SPACING, com.mxgraph.mxConstants.STYLE_STROKECOLOR, and com.mxgraph.mxConstants.STYLE_STROKEWIDTH.
|
inline |
Draws the specified text either using drawHtmlString or using drawString.
text | |
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. |
References com.mxgraph.mxUtils.GetColor(), com.mxgraph.mxUtils.GetFloat(), com.mxgraph.mxUtils.GetFont(), com.mxgraph.mxUtils.GetStringFormat(), com.mxgraph.mxUtils.IsTrue(), com.mxgraph.mxConstants.STYLE_FONTCOLOR, com.mxgraph.mxConstants.STYLE_HORIZONTAL, com.mxgraph.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR, com.mxgraph.mxConstants.STYLE_LABEL_BORDERCOLOR, and com.mxgraph.mxConstants.STYLE_OPACITY.
|
inlineprotected |
Draws a triangle shape for the given parameters.
x | X-coordinate of the shape. |
y | Y-coordinate of the shape. |
w | Width of the shape. |
h | Height of the shape. |
brush | Optional brush for painting the background. |
pen | Optional pen for painting the border. |
shadow | Boolean indicating if a shadow should be painted. |
direction | Specifies the direction of the triangle. |
References com.mxgraph.mxConstants.DIRECTION_NORTH, com.mxgraph.mxConstants.DIRECTION_SOUTH, and com.mxgraph.mxConstants.DIRECTION_WEST.
|
inlinestatic |
Computes the arc size for the given dimension.
w | Width of the rectangle. |
h | Height of the rectangle. |
|
inlineprotected |
Returns an image instance for the given URL. If the URL has been loaded before than an instance of the same instance is returned as in the previous call.
References com.mxgraph.mxUtils.LoadImage().
|
protected |
Global graphics handle to the image.
|
protected |
Cache for loading images.
|
static |
Specifies if image aspect should be preserved in drawImage.
|
getset |
Sets or gets the graphics object to paint the canvas.
Referenced by com.mxgraph.mxStencil.CreateCanvas(), and com.mxgraph.mxImageCanvas.mxImageCanvas().