Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
aspect
Holds the aspect of the shape.
|
protected org.w3c.dom.Element |
bgNode
Holds the XML node with the stencil description.
|
protected org.w3c.dom.Element |
desc
Holds the top-level node of the stencil definition.
|
protected org.w3c.dom.Element |
fgNode
Holds the XML node with the stencil description.
|
protected double |
h0
Holds the height of the shape.
|
protected double |
lastMoveX
Holds the last x-position of the cursor.
|
protected double |
lastMoveY
Holds the last y-position of the cursor.
|
protected java.lang.String |
strokewidth
Holds the strokewidth direction from the description.
|
protected double |
w0
Holds the width of the shape.
|
Constructor and Description |
---|
mxStencil(org.w3c.dom.Element description)
Constructs a new stencil for the given mxGraph shape description.
|
Modifier and Type | Method and Description |
---|---|
protected mxRectangle |
computeAspect(mxCellState state,
mxRectangle bounds,
java.lang.String direction)
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.
|
protected mxGraphicsCanvas2D |
createCanvas(mxGraphics2DCanvas gc)
Creates the canvas for rendering the stencil.
|
protected void |
drawElement(mxGraphicsCanvas2D canvas,
mxCellState state,
org.w3c.dom.Element node,
mxRectangle aspect)
Drawsthe given element.
|
protected void |
drawShadow(mxGraphicsCanvas2D canvas,
mxCellState state,
double rotation,
boolean flipH,
boolean flipV,
mxRectangle bounds,
double alpha,
boolean filled,
mxRectangle aspect)
Draws the shadow.
|
boolean |
drawShape(mxGraphicsCanvas2D canvas,
mxCellState state,
mxRectangle bounds,
mxRectangle aspect,
boolean background)
Draws this stencil inside the given bounds.
|
java.lang.String |
evaluateAttribute(org.w3c.dom.Element elt,
java.lang.String attribute,
mxCellState state)
Gets the attribute for the given name from the given node.
|
org.w3c.dom.Element |
getDescription()
Returns the description.
|
protected double |
getDouble(org.w3c.dom.Element elt,
java.lang.String attribute)
Returns the given attribute or 0.
|
protected double |
getDouble(org.w3c.dom.Element elt,
java.lang.String attribute,
double defaultValue)
Returns the given attribute or the default value.
|
protected int |
getInt(org.w3c.dom.Element elt,
java.lang.String attribute,
int defaultValue)
Returns the given attribute or the default value.
|
protected java.lang.String |
getString(org.w3c.dom.Element elt,
java.lang.String attribute,
java.lang.String defaultValue)
Returns the given attribute or the default value.
|
void |
paintShape(mxGraphics2DCanvas gc,
mxCellState state)
Paints the stencil for the given state.
|
protected void |
parseDescription()
Parses the description of this shape.
|
void |
setDescription(org.w3c.dom.Element value)
Sets the description.
|
protected org.w3c.dom.Element desc
protected java.lang.String aspect
protected double w0
protected double h0
protected org.w3c.dom.Element bgNode
protected org.w3c.dom.Element fgNode
protected java.lang.String strokewidth
protected double lastMoveX
protected double lastMoveY
public mxStencil(org.w3c.dom.Element description)
public org.w3c.dom.Element getDescription()
public void setDescription(org.w3c.dom.Element value)
protected mxGraphicsCanvas2D createCanvas(mxGraphics2DCanvas gc)
public void paintShape(mxGraphics2DCanvas gc, mxCellState state)
paintShape
in interface mxIShape
protected void drawShadow(mxGraphicsCanvas2D canvas, mxCellState state, double rotation, boolean flipH, boolean flipV, mxRectangle bounds, double alpha, boolean filled, mxRectangle aspect)
public boolean drawShape(mxGraphicsCanvas2D canvas, mxCellState state, mxRectangle bounds, mxRectangle aspect, boolean background)
protected mxRectangle computeAspect(mxCellState state, mxRectangle bounds, java.lang.String direction)
protected void drawElement(mxGraphicsCanvas2D canvas, mxCellState state, org.w3c.dom.Element node, mxRectangle aspect)
protected int getInt(org.w3c.dom.Element elt, java.lang.String attribute, int defaultValue)
protected double getDouble(org.w3c.dom.Element elt, java.lang.String attribute)
protected double getDouble(org.w3c.dom.Element elt, java.lang.String attribute, double defaultValue)
protected java.lang.String getString(org.w3c.dom.Element elt, java.lang.String attribute, java.lang.String defaultValue)
protected void parseDescription()
public java.lang.String evaluateAttribute(org.w3c.dom.Element elt, java.lang.String attribute, mxCellState state)
Copyright (c) 2010-2017 Gaudenz Alder, JGraph Ltd. All rights reserved.