com::mxgraph::mxStencil Class Reference

Implements a stencil for the given XML definition. This class implements the mxGraph stencil schema. More...

List of all members.

Public Member Functions

 mxStencil (XmlElement description)
 Constructs a new stencil for the given mxGraph shape description.
void PaintShape (mxGdiCanvas gc, mxCellState state)
 Paints the stencil for the given state.
bool DrawShape (mxGdiCanvas2D canvas, mxCellState state, mxRectangle bounds, bool background)
string EvaluateAttribute (XmlElement elt, string attribute, mxCellState state)
 Gets the attribute for the given name from the given node. If the attribute.

Protected Member Functions

mxGdiCanvas2D CreateCanvas (mxGdiCanvas gc)
 Creates the canvas for rendering the stencil.
void DrawShadow (mxGdiCanvas2D canvas, mxCellState state, double rotation, bool flipH, bool flipV, mxRectangle bounds, double alpha, bool filled)
 Draws the shadow.
mxRectangle ComputeAspect (mxCellState state, mxRectangle bounds, string direction)
 Returns a rectangle that contains the offset in x and y and the horizontal.
void DrawElement (mxGdiCanvas2D canvas, mxCellState state, XmlElement node, mxRectangle aspect)
int GetInt (XmlElement elt, string attribute, int defaultValue)
double GetDouble (XmlElement elt, String attribute)
double GetDouble (XmlElement elt, String attribute, double defaultValue)
string GetString (XmlElement elt, string attribute, string defaultValue)
 Returns the given attribute or the default value.
void ParseDescription ()

Protected Attributes

XmlElement desc
 Holds the top-level node of the stencil definition.
string aspect = null
 Holds the aspect of the shape. Default is "auto".
double w0 = 100
 Holds the width of the shape. Default is 100.
double h0 = 100
 Holds the height of the shape. Default is 100.
XmlElement bgNode = null
 Holds the XML node with the stencil description.
XmlElement fgNode = null
 Holds the XML node with the stencil description.
string strokewidth = null
 Holds the strokewidth direction from the description.
double lastMoveX = 0
 Holds the last x-position of the cursor.
double lastMoveY = 0
 Holds the last y-position of the cursor.

Properties

XmlElement Description [get, set]
 Sets or returns the description.

Detailed Description

Implements a stencil for the given XML definition. This class implements the mxGraph stencil schema.


Constructor & Destructor Documentation

com::mxgraph::mxStencil::mxStencil ( XmlElement  description  )  [inline]

Constructs a new stencil for the given mxGraph shape description.

Parameters:
description 

Member Function Documentation

mxRectangle com::mxgraph::mxStencil::ComputeAspect ( mxCellState  state,
mxRectangle  bounds,
string  direction 
) [inline, protected]

Returns a rectangle that contains the offset in x and y and the horizontal.

and vertical scale in width and height used to draw this shape inside the given rectangle.

Parameters:
state 
bounds 
direction 
Returns:
mxGdiCanvas2D com::mxgraph::mxStencil::CreateCanvas ( mxGdiCanvas  gc  )  [inline, protected]

Creates the canvas for rendering the stencil.

Parameters:
gc 
Returns:
void com::mxgraph::mxStencil::DrawElement ( mxGdiCanvas2D  canvas,
mxCellState  state,
XmlElement  node,
mxRectangle  aspect 
) [inline, protected]

Draws the given element.

Parameters:
canvas 
state 
node 
aspect 
void com::mxgraph::mxStencil::DrawShadow ( mxGdiCanvas2D  canvas,
mxCellState  state,
double  rotation,
bool  flipH,
bool  flipV,
mxRectangle  bounds,
double  alpha,
bool  filled 
) [inline, protected]

Draws the shadow.

Parameters:
canvas 
state 
rotation 
flipH 
flipV 
bounds 
alpha 
bool com::mxgraph::mxStencil::DrawShape ( mxGdiCanvas2D  canvas,
mxCellState  state,
mxRectangle  bounds,
bool  background 
) [inline]

Draws this stencil inside the given bounds.

string com::mxgraph::mxStencil::EvaluateAttribute ( XmlElement  elt,
string  attribute,
mxCellState  state 
) [inline]

Gets the attribute for the given name from the given node. If the attribute.

does not exist then the text content of the node is evaluated and if it is a function it is invoked with <state> as the only argument and the return value is used as the attribute value to be returned.

Parameters:
elt 
attribute 
state 
Returns:
double com::mxgraph::mxStencil::GetDouble ( XmlElement  elt,
String  attribute,
double  defaultValue 
) [inline, protected]

Returns the given attribute or the default value.

Parameters:
elt 
attribute 
defaultValue 
Returns:
double com::mxgraph::mxStencil::GetDouble ( XmlElement  elt,
String  attribute 
) [inline, protected]

Returns the given attribute or 0.

Parameters:
elt 
attribute 
Returns:
int com::mxgraph::mxStencil::GetInt ( XmlElement  elt,
string  attribute,
int  defaultValue 
) [inline, protected]

Returns the given attribute or the default value.

Parameters:
elt 
attribute 
defaultValue 
Returns:
string com::mxgraph::mxStencil::GetString ( XmlElement  elt,
string  attribute,
string  defaultValue 
) [inline, protected]

Returns the given attribute or the default value.

Parameters:
elt 
attribute 
defaultValue 
Returns:
void com::mxgraph::mxStencil::PaintShape ( mxGdiCanvas  gc,
mxCellState  state 
) [inline]

Paints the stencil for the given state.

void com::mxgraph::mxStencil::ParseDescription (  )  [inline, protected]

Parses the description of this shape.


Member Data Documentation

string com::mxgraph::mxStencil::aspect = null [protected]

Holds the aspect of the shape. Default is "auto".

XmlElement com::mxgraph::mxStencil::bgNode = null [protected]

Holds the XML node with the stencil description.

XmlElement com::mxgraph::mxStencil::desc [protected]

Holds the top-level node of the stencil definition.

XmlElement com::mxgraph::mxStencil::fgNode = null [protected]

Holds the XML node with the stencil description.

double com::mxgraph::mxStencil::h0 = 100 [protected]

Holds the height of the shape. Default is 100.

double com::mxgraph::mxStencil::lastMoveX = 0 [protected]

Holds the last x-position of the cursor.

double com::mxgraph::mxStencil::lastMoveY = 0 [protected]

Holds the last y-position of the cursor.

string com::mxgraph::mxStencil::strokewidth = null [protected]

Holds the strokewidth direction from the description.

double com::mxgraph::mxStencil::w0 = 100 [protected]

Holds the width of the shape. Default is 100.


Property Documentation

XmlElement com::mxgraph::mxStencil::Description [get, set]

Sets or returns the description.


The documentation for this class was generated from the following file:
Generated on Tue Dec 18 13:06:24 2012 for mxGraph by  doxygen 1.6.3