|
mxGraph 1.10.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mxgraph.shape.mxStencil
public class mxStencil
Implements a stencil for the given XML definition. This class implements the mxGraph stencil schema.
Field Summary | |
---|---|
protected String |
aspect
Holds the aspect of the shape. |
protected Element |
bgNode
Holds the XML node with the stencil description. |
protected Element |
desc
Holds the top-level node of the stencil definition. |
protected 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 String |
strokewidth
Holds the strokewidth direction from the description. |
protected double |
w0
Holds the width of the shape. |
Constructor Summary | |
---|---|
mxStencil(Element description)
Constructs a new stencil for the given mxGraph shape description. |
Method Summary | |
---|---|
protected mxRectangle |
computeAspect(mxCellState state,
mxRectangle bounds,
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,
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)
Draws the shadow. |
boolean |
drawShape(mxGraphicsCanvas2D canvas,
mxCellState state,
mxRectangle bounds,
boolean background)
Draws this stencil inside the given bounds. |
String |
evaluateAttribute(Element elt,
String attribute,
mxCellState state)
Gets the attribute for the given name from the given node. |
Element |
getDescription()
Returns the description. |
protected double |
getDouble(Element elt,
String attribute)
Returns the given attribute or 0. |
protected double |
getDouble(Element elt,
String attribute,
double defaultValue)
Returns the given attribute or the default value. |
protected int |
getInt(Element elt,
String attribute,
int defaultValue)
Returns the given attribute or the default value. |
protected String |
getString(Element elt,
String attribute,
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(Element value)
Sets the description. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Element desc
protected String aspect
protected double w0
protected double h0
protected Element bgNode
protected Element fgNode
protected String strokewidth
protected double lastMoveX
protected double lastMoveY
Constructor Detail |
---|
public mxStencil(Element description)
Method Detail |
---|
public Element getDescription()
public void setDescription(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)
public boolean drawShape(mxGraphicsCanvas2D canvas, mxCellState state, mxRectangle bounds, boolean background)
protected mxRectangle computeAspect(mxCellState state, mxRectangle bounds, String direction)
protected void drawElement(mxGraphicsCanvas2D canvas, mxCellState state, Element node, mxRectangle aspect)
protected int getInt(Element elt, String attribute, int defaultValue)
protected double getDouble(Element elt, String attribute)
protected double getDouble(Element elt, String attribute, double defaultValue)
protected String getString(Element elt, String attribute, String defaultValue)
protected void parseDescription()
public String evaluateAttribute(Element elt, String attribute, mxCellState state)
|
mxGraph 1.10.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |