mxGraph
|
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... | |
Implements a stencil for the given XML definition. This class implements the mxGraph stencil schema.
|
inline |
Constructs a new stencil for the given mxGraph shape description.
description |
|
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.
state | |
bounds | |
direction |
References com.mxgraph.mxRectangle.Height, com.mxgraph.mxRectangle.Width, com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.
|
inlineprotected |
Creates the canvas for rendering the stencil.
gc |
References com.mxgraph.mxGdiCanvas.Graphics.
|
inlineprotected |
Draws the given element.
canvas | |
state | |
node | |
aspect |
References com.mxgraph.mxUtils.ArcToCurves(), com.mxgraph.mxGdiCanvas2D.Begin(), com.mxgraph.mxGdiCanvas2D.Close(), com.mxgraph.mxGdiCanvas2D.CurveTo(), com.mxgraph.mxGdiCanvas2D.Dashed, com.mxgraph.mxGdiCanvas2D.DashPattern, com.mxgraph.mxStencil.DrawShape(), com.mxgraph.mxGdiCanvas2D.Ellipse(), com.mxgraph.mxGdiCanvas2D.Fill(), com.mxgraph.mxGdiCanvas2D.FillAndStroke(), com.mxgraph.mxGdiCanvas2D.FillColor, com.mxgraph.mxGdiCanvas2D.FontColor, com.mxgraph.mxGdiCanvas2D.FontFamily, com.mxgraph.mxGdiCanvas2D.FontSize, com.mxgraph.mxGdiCanvas2D.FontStyle, com.mxgraph.mxStencilRegistry.GetStencil(), com.mxgraph.mxRectangle.Height, com.mxgraph.mxGdiCanvas2D.Image(), com.mxgraph.mxGdiCanvas2D.LineCap, com.mxgraph.mxGdiCanvas2D.LineJoin, com.mxgraph.mxGdiCanvas2D.LineTo(), com.mxgraph.mxGdiCanvas2D.MiterLimit, com.mxgraph.mxGdiCanvas2D.MoveTo(), com.mxgraph.mxGdiCanvas2D.QuadTo(), com.mxgraph.mxGdiCanvas2D.Rect(), com.mxgraph.mxConstants.RECTANGLE_ROUNDING_FACTOR, com.mxgraph.mxGdiCanvas2D.Restore(), com.mxgraph.mxGdiCanvas2D.Roundrect(), com.mxgraph.mxGdiCanvas2D.Save(), com.mxgraph.mxGdiCanvas2D.Stroke(), com.mxgraph.mxGdiCanvas2D.StrokeColor, com.mxgraph.mxGdiCanvas2D.StrokeWidth, com.mxgraph.mxGdiCanvas2D.Text(), com.mxgraph.mxRectangle.Width, com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.
|
inlineprotected |
Draws the shadow.
canvas | |
state | |
rotation | |
flipH | |
flipV | |
bounds | |
alpha |
References com.mxgraph.mxGdiCanvas2D.Alpha, com.mxgraph.mxUtils.GetRotatedPoint(), com.mxgraph.mxConstants.SHADOW_OFFSETX, com.mxgraph.mxConstants.SHADOW_OFFSETY, com.mxgraph.mxConstants.STENCIL_SHADOW_OPACITY, com.mxgraph.mxGdiCanvas2D.Translate(), com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.
|
inline |
Draws this stencil inside the given bounds.
References com.mxgraph.mxUtils.GetDouble(), com.mxgraph.mxUtils.GetString(), com.mxgraph.mxRectangle.Height, com.mxgraph.mxGraphView.Scale, com.mxgraph.mxGdiCanvas2D.StrokeWidth, com.mxgraph.mxCellState.Style, com.mxgraph.mxConstants.STYLE_DIRECTION, com.mxgraph.mxConstants.STYLE_STROKEWIDTH, com.mxgraph.mxCellState.View, and com.mxgraph.mxRectangle.Width.
Referenced by com.mxgraph.mxStencil.DrawElement().
|
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.
elt | |
attribute | |
state |
|
inlineprotected |
Returns the given attribute or 0.
elt | |
attribute |
|
inlineprotected |
Returns the given attribute or the default value.
elt | |
attribute | |
defaultValue |
|
inlineprotected |
Returns the given attribute or the default value.
elt | |
attribute | |
defaultValue |
|
inlineprotected |
Returns the given attribute or the default value.
elt | |
attribute | |
defaultValue |
|
inline |
Paints the stencil for the given state.
References com.mxgraph.mxGdiCanvas2D.Alpha, com.mxgraph.mxGdiCanvas2D.Dashed, com.mxgraph.mxGdiCanvas2D.FillColor, com.mxgraph.mxRectangle.GetCenterX(), com.mxgraph.mxRectangle.GetCenterY(), com.mxgraph.mxUtils.GetDouble(), com.mxgraph.mxUtils.GetString(), com.mxgraph.mxRectangle.Height, com.mxgraph.mxUtils.IsTrue(), com.mxgraph.mxConstants.NONE, com.mxgraph.mxGdiCanvas2D.Rotate(), com.mxgraph.mxGdiCanvas2D.Save(), com.mxgraph.mxGraphView.Scale, com.mxgraph.mxGdiCanvas2D.SetGradient(), com.mxgraph.mxGdiCanvas2D.StrokeColor, com.mxgraph.mxGdiCanvas2D.StrokeWidth, com.mxgraph.mxCellState.Style, com.mxgraph.mxConstants.STYLE_DASHED, com.mxgraph.mxConstants.STYLE_DIRECTION, com.mxgraph.mxConstants.STYLE_FILLCOLOR, com.mxgraph.mxConstants.STYLE_GRADIENTCOLOR, com.mxgraph.mxConstants.STYLE_OPACITY, com.mxgraph.mxConstants.STYLE_ROTATION, com.mxgraph.mxConstants.STYLE_SHADOW, com.mxgraph.mxConstants.STYLE_STENCIL_FLIPH, com.mxgraph.mxConstants.STYLE_STENCIL_FLIPV, com.mxgraph.mxConstants.STYLE_STROKECOLOR, com.mxgraph.mxConstants.STYLE_STROKEWIDTH, com.mxgraph.mxCellState.View, com.mxgraph.mxRectangle.Width, com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.
Referenced by com.mxgraph.mxGdiCanvas.DrawCell().
|
inlineprotected |
Parses the description of this shape.
|
protected |
Holds the aspect of the shape. Default is "auto".
|
protected |
Holds the XML node with the stencil description.
|
protected |
Holds the top-level node of the stencil definition.
|
protected |
Holds the XML node with the stencil description.
|
protected |
Holds the height of the shape. Default is 100.
|
protected |
Holds the last x-position of the cursor.
|
protected |
Holds the last y-position of the cursor.
|
protected |
Holds the strokewidth direction from the description.
|
protected |
Holds the width of the shape. Default is 100.
|
getset |
Sets or returns the description.