mxGraph
|
Implementation of a canvas that uses GDI for painting. More...
Public Member Functions | |
mxGdiCanvas () | |
Constructs a new GDI canvas. | |
mxGdiCanvas (Graphics g) | |
Constructs a new GDI canvas for the given graphics instance. | |
override Object | DrawCell (mxCellState state) |
see com.mxgraph.mxICanvas.DrawCell() | |
override Object | DrawLabel (string text, mxCellState state, bool html) |
see com.mxgraph.mxICanvas.DrawLabel() | |
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. | |
void | DrawLine (List< mxPoint > pts, Dictionary< string, Object > style) |
Draws the given lines as segments between all points of the given list of mxPoints. | |
mxPoint | DrawMarker (Object type, mxPoint p0, mxPoint pe, float size, Pen pen) |
Draws the given type of marker. | |
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. | |
void | Destroy () |
Destroys the canvas and frees all allocated resources. | |
Static Public Member Functions | |
static int | getArcSize (int w, int h) |
Computes the arc size for the given dimension. | |
Static Public Attributes | |
static bool | PRESERVE_IMAGE_ASPECT = true |
Specifies if image aspect should be preserved in drawImage. | |
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. | |
void | DrawGlassEffect (int x, int y, int w, int h, Dictionary< string, Object > style) |
Draws the glass effect. | |
void | DrawPolygon (Point[] polygon, Brush brush, Pen pen, bool shadow) |
Draws a a polygon for the given parameters. | |
void | DrawPath (GraphicsPath path, Brush brush, Pen pen, bool shadow) |
Draws a path for the given parameters. | |
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. | |
void | DrawImage (int x, int y, int w, int h, String image) |
Draws an image for the given parameters. | |
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. | |
void | DrawOval (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow) |
Draws an oval for the given parameters. | |
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. | |
void | DrawCylinder (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow) |
Draws a cylinder for the given parameters. | |
void | DrawActor (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow) |
Draws an actor shape for the given parameters. | |
void | DrawCloud (int x, int y, int w, int h, Brush brush, Pen pen, bool shadow) |
Draws a cloud shape for the given parameters. | |
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. | |
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. | |
Protected Attributes | |
Dictionary< string, Image > | imageCache = new Dictionary<string, Image>() |
Cache for loading images. | |
Graphics | g |
Global graphics handle to the image. | |
Properties | |
Graphics | Graphics [get, set] |
Sets or gets the graphics object to paint the canvas. |
Implementation of a canvas that uses GDI for painting.
com.mxgraph.mxGdiCanvas.mxGdiCanvas | ( | ) | [inline] |
Constructs a new GDI canvas.
com.mxgraph.mxGdiCanvas.mxGdiCanvas | ( | Graphics | g | ) | [inline] |
Constructs a new GDI canvas for the given graphics instance.
void com.mxgraph.mxGdiCanvas.Destroy | ( | ) | [inline] |
Destroys the canvas and frees all allocated resources.
void com.mxgraph.mxGdiCanvas.DrawActor | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Brush | brush, | ||
Pen | pen, | ||
bool | shadow | ||
) | [inline, protected] |
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. |
override Object com.mxgraph.mxGdiCanvas.DrawCell | ( | mxCellState | state | ) | [inline, virtual] |
see com.mxgraph.mxICanvas.DrawCell()
Implements com.mxgraph.mxBasicCanvas.
void com.mxgraph.mxGdiCanvas.DrawCloud | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Brush | brush, | ||
Pen | pen, | ||
bool | shadow | ||
) | [inline, protected] |
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. |
void com.mxgraph.mxGdiCanvas.DrawCylinder | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Brush | brush, | ||
Pen | pen, | ||
bool | shadow | ||
) | [inline, protected] |
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. |
void com.mxgraph.mxGdiCanvas.DrawGlassEffect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Dictionary< string, Object > | style | ||
) | [inline, protected] |
Draws the glass effect.
void com.mxgraph.mxGdiCanvas.DrawHexagon | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Brush | brush, | ||
Pen | pen, | ||
bool | shadow, | ||
string | direction | ||
) | [inline, protected] |
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. |
void com.mxgraph.mxGdiCanvas.DrawImage | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
String | image | ||
) | [inline, protected] |
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. |
void com.mxgraph.mxGdiCanvas.DrawImage | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
String | image, | ||
bool | preserveAspect, | ||
bool | flipH, | ||
bool | flipV | ||
) | [inline, protected] |
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. |
override Object com.mxgraph.mxGdiCanvas.DrawLabel | ( | string | text, |
mxCellState | state, | ||
bool | html | ||
) | [inline, virtual] |
see com.mxgraph.mxICanvas.DrawLabel()
Implements com.mxgraph.mxBasicCanvas.
void com.mxgraph.mxGdiCanvas.DrawLine | ( | List< mxPoint > | pts, |
Dictionary< string, Object > | style | ||
) | [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. |
mxPoint com.mxgraph.mxGdiCanvas.DrawMarker | ( | Object | type, |
mxPoint | p0, | ||
mxPoint | pe, | ||
float | size, | ||
Pen | pen | ||
) | [inline] |
Draws the given type of marker.
type | |
p0 | |
pe | |
size | |
pen |
void com.mxgraph.mxGdiCanvas.DrawOval | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Brush | brush, | ||
Pen | pen, | ||
bool | shadow | ||
) | [inline, protected] |
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. |
void com.mxgraph.mxGdiCanvas.DrawPath | ( | GraphicsPath | path, |
Brush | brush, | ||
Pen | pen, | ||
bool | shadow | ||
) | [inline, protected] |
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. |
void com.mxgraph.mxGdiCanvas.DrawPolygon | ( | Point[] | polygon, |
Brush | brush, | ||
Pen | pen, | ||
bool | shadow | ||
) | [inline, protected] |
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. |
void com.mxgraph.mxGdiCanvas.DrawRect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Brush | brush, | ||
Pen | pen, | ||
bool | shadow, | ||
bool | rounded | ||
) | [inline, protected] |
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. |
void com.mxgraph.mxGdiCanvas.DrawRhombus | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Brush | brush, | ||
Pen | pen, | ||
bool | shadow | ||
) | [inline, protected] |
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. |
void com.mxgraph.mxGdiCanvas.DrawShape | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Dictionary< string, Object > | style | ||
) | [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. |
void com.mxgraph.mxGdiCanvas.DrawText | ( | string | text, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
Dictionary< string, Object > | style | ||
) | [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. |
void com.mxgraph.mxGdiCanvas.DrawTriangle | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
Brush | brush, | ||
Pen | pen, | ||
bool | shadow, | ||
string | direction | ||
) | [inline, protected] |
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. |
static int com.mxgraph.mxGdiCanvas.getArcSize | ( | int | w, |
int | h | ||
) | [inline, static] |
Computes the arc size for the given dimension.
w | Width of the rectangle. |
h | Height of the rectangle. |
Image com.mxgraph.mxGdiCanvas.LoadImage | ( | String | image | ) | [inline, protected] |
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.
Graphics com.mxgraph.mxGdiCanvas.g [protected] |
Global graphics handle to the image.
Dictionary<string, Image> com.mxgraph.mxGdiCanvas.imageCache = new Dictionary<string, Image>() [protected] |
Cache for loading images.
bool com.mxgraph.mxGdiCanvas.PRESERVE_IMAGE_ASPECT = true [static] |
Specifies if image aspect should be preserved in drawImage.
Graphics com.mxgraph.mxGdiCanvas.Graphics [get, set] |
Sets or gets the graphics object to paint the canvas.