Class mxStencilShape
java.lang.Object
com.mxgraph.shape.mxBasicShape
com.mxgraph.shape.mxStencilShape
- All Implemented Interfaces:
mxIShape
Stencil shape drawing that takes an XML definition of the shape and renders
it.
See http://projects.gnome.org/dia/custom-shapes for specs. See
http://dia-installer.de/shapes_de.html for shapes.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Rectangle2Dprotected AffineTransformTransform cached to save instance created.protected Stringprotected Stringprotected NodeReference to the root node of the Dia shape description.protected mxStencilShape.svgShapeprotected GeneralPath -
Constructor Summary
ConstructorsConstructorDescriptionmxStencilShape(String shapeXml) Constructs a new stencil for the given Dia shape description.mxStencilShape(Document document) -
Method Summary
Modifier and TypeMethodDescriptioncreateElement(Node root) Forms an internal representation of the specified SVG element and returns that representationvoidcreateShape(Node root, mxStencilShape.svgShape shape) getName()getStylenames(String style) Returns the stylenames in a style of the form stylename[;key=value] or an empty array if the given style does not contain any stylenames.voidpaintNode(mxGraphics2DCanvas canvas, mxCellState state, mxStencilShape.svgShape shape, double widthRatio, double heightRatio) voidpaintShape(mxGraphics2DCanvas canvas, mxCellState state) voidsetBoundingBox(Rectangle2D boundingBox) voidsetIconPath(String iconPath) voidprotected voidtransformShape(Shape shape, double transX, double transY, double widthRatio, double heightRatio) Scales the points composing this shape by the x and y ratios specifiedMethods inherited from class mxBasicShape
configureGraphics, createShape, getFillColor, getGradientBounds, getStrokeColor, hasGradient, hasShadow
-
Field Details
-
shapePath
-
root
Reference to the root node of the Dia shape description. -
rootShape
-
boundingBox
-
name
-
iconPath
-
cachedTransform
Transform cached to save instance created. Used to scale the internal path of shapes where possible
-
-
Constructor Details
-
mxStencilShape
public mxStencilShape() -
mxStencilShape
Constructs a new stencil for the given Dia shape description. -
mxStencilShape
-
-
Method Details
-
paintShape
- Specified by:
paintShapein interfacemxIShape- Overrides:
paintShapein classmxBasicShape
-
paintNode
public void paintNode(mxGraphics2DCanvas canvas, mxCellState state, mxStencilShape.svgShape shape, double widthRatio, double heightRatio) -
transformShape
protected void transformShape(Shape shape, double transX, double transY, double widthRatio, double heightRatio) Scales the points composing this shape by the x and y ratios specified- Parameters:
shape- the shape to scaletransX- the x translationtransY- the y translationwidthRatio- the x co-ordinate scaleheightRatio- the y co-ordinate scale
-
createShape
-
createElement
Forms an internal representation of the specified SVG element and returns that representation- Parameters:
root- the SVG element to represent- Returns:
- the internal representation of the element, or null if an error occurs
-
getStylenames
Returns the stylenames in a style of the form stylename[;key=value] or an empty array if the given style does not contain any stylenames.- Parameters:
style- String of the form stylename[;stylename][;key=value].- Returns:
- Returns the stylename from the given formatted string.
-
getName
-
setName
-
getIconPath
-
setIconPath
-
getBoundingBox
-
setBoundingBox
-