mxGraph
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties
com.mxgraph.mxGdiCanvas Class Reference

Implementation of a canvas that uses GDI for painting. More...

Inheritance diagram for com.mxgraph.mxGdiCanvas:
com.mxgraph.mxBasicCanvas com.mxgraph.mxICanvas

List of all members.

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.

Detailed Description

Implementation of a canvas that uses GDI for painting.


Constructor & Destructor Documentation

Constructs a new GDI canvas.

Constructs a new GDI canvas for the given graphics instance.


Member Function Documentation

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.

Parameters:
xX-coordinate of the shape.
yY-coordinate of the shape.
wWidth of the shape.
hHeight of the shape.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean indicating if a shadow should be painted.
override Object com.mxgraph.mxGdiCanvas.DrawCell ( mxCellState  state) [inline, virtual]
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.

Parameters:
xX-coordinate of the shape.
yY-coordinate of the shape.
wWidth of the shape.
hHeight of the shape.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean 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.

Parameters:
xX-coordinate of the shape.
yY-coordinate of the shape.
wWidth of the shape.
hHeight of the shape.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean 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.

Parameters:
xX-coordinate of the shape.
yY-coordinate of the shape.
wWidth of the shape.
hHeight of the shape.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean indicating if a shadow should be painted.
directionSpecifies 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.

Parameters:
xX-coordinate of the image.
yY-coordinate of the image.
wWidth of the image.
hHeight of the image.
imageURL 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.

Parameters:
xX-coordinate of the image.
yY-coordinate of the image.
wWidth of the image.
hHeight of the image.
imageURL of the image.
override Object com.mxgraph.mxGdiCanvas.DrawLabel ( string  text,
mxCellState  state,
bool  html 
) [inline, virtual]
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.

Parameters:
ptsList of points that define the line.
styleStyle 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.

Parameters:
type
p0
pe
size
pen
Returns:
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.

Parameters:
xX-coordinate of the shape.
yY-coordinate of the shape.
wWidth of the shape.
hHeight of the shape.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean 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.

Parameters:
pathPath object to be drawn.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean 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.

Parameters:
polygonPoints of the polygon.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean 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.

Parameters:
xX-coordinate of the shape.
yY-coordinate of the shape.
wWidth of the shape.
hHeight of the shape.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean indicating if a shadow should be painted.
roundedBoolean 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.

Parameters:
xX-coordinate of the shape.
yY-coordinate of the shape.
wWidth of the shape.
hHeight of the shape.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean 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.

Parameters:
xX-coordinate of the shape.
yY-coordinate of the shape.
wWidth of the shape.
hHeight of the shape.
styleStyle 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.

Parameters:
text
xX-coordinate of the text.
yY-coordinate of the text.
wWidth of the text.
hHeight of the text.
styleStyle 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.

Parameters:
xX-coordinate of the shape.
yY-coordinate of the shape.
wWidth of the shape.
hHeight of the shape.
brushOptional brush for painting the background.
penOptional pen for painting the border.
shadowBoolean indicating if a shadow should be painted.
directionSpecifies 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.

Parameters:
wWidth of the rectangle.
hHeight of the rectangle.
Returns:
Returns the arc size for the given dimension.
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.


Member Data Documentation

Global graphics handle to the image.

Dictionary<string, Image> com.mxgraph.mxGdiCanvas.imageCache = new Dictionary<string, Image>() [protected]

Cache for loading images.

Specifies if image aspect should be preserved in drawImage.


Property Documentation

Sets or gets the graphics object to paint the canvas.


The documentation for this class was generated from the following file: