mxGraph
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
com.mxgraph.mxStencil Class Reference

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

Public Member Functions

 mxStencil (XmlElement description)
 Constructs a new stencil for the given mxGraph shape description. More...
 
void PaintShape (mxGdiCanvas gc, mxCellState state)
 Paints the stencil for the given state. More...
 
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 More...
 

Protected Member Functions

mxGdiCanvas2D CreateCanvas (mxGdiCanvas gc)
 Creates the canvas for rendering the stencil. More...
 
void DrawShadow (mxGdiCanvas2D canvas, mxCellState state, double rotation, bool flipH, bool flipV, mxRectangle bounds, double alpha, bool filled)
 Draws the shadow. More...
 
mxRectangle ComputeAspect (mxCellState state, mxRectangle bounds, string direction)
 Returns a rectangle that contains the offset in x and y and the horizontal More...
 
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. More...
 
void ParseDescription ()
 

Protected Attributes

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

Properties

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

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 
)
inlineprotected

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

References com.mxgraph.mxRectangle.Height, com.mxgraph.mxRectangle.Width, com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.

mxGdiCanvas2D com.mxgraph.mxStencil.CreateCanvas ( mxGdiCanvas  gc)
inlineprotected

Creates the canvas for rendering the stencil.

Parameters
gc
Returns

References com.mxgraph.mxGdiCanvas.Graphics.

void com.mxgraph.mxStencil.DrawElement ( mxGdiCanvas2D  canvas,
mxCellState  state,
XmlElement  node,
mxRectangle  aspect 
)
inlineprotected
void com.mxgraph.mxStencil.DrawShadow ( mxGdiCanvas2D  canvas,
mxCellState  state,
double  rotation,
bool  flipH,
bool  flipV,
mxRectangle  bounds,
double  alpha,
bool  filled 
)
inlineprotected
bool com.mxgraph.mxStencil.DrawShape ( mxGdiCanvas2D  canvas,
mxCellState  state,
mxRectangle  bounds,
bool  background 
)
inline
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 
)
inlineprotected

Returns the given attribute or 0.

Parameters
elt
attribute
Returns
double com.mxgraph.mxStencil.GetDouble ( XmlElement  elt,
String  attribute,
double  defaultValue 
)
inlineprotected

Returns the given attribute or the default value.

Parameters
elt
attribute
defaultValue
Returns
int com.mxgraph.mxStencil.GetInt ( XmlElement  elt,
string  attribute,
int  defaultValue 
)
inlineprotected

Returns the given attribute or the default value.

Parameters
elt
attribute
defaultValue
Returns
string com.mxgraph.mxStencil.GetString ( XmlElement  elt,
string  attribute,
string  defaultValue 
)
inlineprotected

Returns the given attribute or the default value.

Parameters
elt
attribute
defaultValue
Returns
void com.mxgraph.mxStencil.PaintShape ( mxGdiCanvas  gc,
mxCellState  state 
)
inline
void com.mxgraph.mxStencil.ParseDescription ( )
inlineprotected

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
getset

Sets or returns the description.


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