Package com.mxgraph.shape
Class mxStencilShape
- java.lang.Object
-
- com.mxgraph.shape.mxBasicShape
-
- com.mxgraph.shape.mxStencilShape
-
- All Implemented Interfaces:
mxIShape
public class mxStencilShape extends mxBasicShape
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 Modifier and Type Class Description protected classmxStencilShape.svgShape
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.geom.Rectangle2DboundingBoxprotected java.awt.geom.AffineTransformcachedTransformTransform cached to save instance created.protected java.lang.StringiconPathprotected java.lang.Stringnameprotected org.w3c.dom.NoderootReference to the root node of the Dia shape description.protected mxStencilShape.svgShaperootShapeprotected java.awt.geom.GeneralPathshapePath
-
Constructor Summary
Constructors Constructor Description mxStencilShape()mxStencilShape(java.lang.String shapeXml)Constructs a new stencil for the given Dia shape description.mxStencilShape(org.w3c.dom.Document document)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description mxStencilShape.svgShapecreateElement(org.w3c.dom.Node root)Forms an internal representation of the specified SVG element and returns that representationvoidcreateShape(org.w3c.dom.Node root, mxStencilShape.svgShape shape)java.awt.geom.Rectangle2DgetBoundingBox()java.lang.StringgetIconPath()java.lang.StringgetName()protected static java.util.Map<java.lang.String,java.lang.Object>getStylenames(java.lang.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(java.awt.geom.Rectangle2D boundingBox)voidsetIconPath(java.lang.String iconPath)voidsetName(java.lang.String name)protected voidtransformShape(java.awt.Shape shape, double transX, double transY, double widthRatio, double heightRatio)Scales the points composing this shape by the x and y ratios specified-
Methods inherited from class com.mxgraph.shape.mxBasicShape
configureGraphics, createShape, getFillColor, getGradientBounds, getStrokeColor, hasGradient, hasShadow
-
-
-
-
Field Detail
-
shapePath
protected java.awt.geom.GeneralPath shapePath
-
root
protected org.w3c.dom.Node root
Reference to the root node of the Dia shape description.
-
rootShape
protected mxStencilShape.svgShape rootShape
-
boundingBox
protected java.awt.geom.Rectangle2D boundingBox
-
name
protected java.lang.String name
-
iconPath
protected java.lang.String iconPath
-
cachedTransform
protected java.awt.geom.AffineTransform cachedTransform
Transform cached to save instance created. Used to scale the internal path of shapes where possible
-
-
Method Detail
-
paintShape
public void paintShape(mxGraphics2DCanvas canvas, mxCellState state)
- 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(java.awt.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
public void createShape(org.w3c.dom.Node root, mxStencilShape.svgShape shape)
-
createElement
public mxStencilShape.svgShape createElement(org.w3c.dom.Node root)
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
protected static java.util.Map<java.lang.String,java.lang.Object> getStylenames(java.lang.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.- Parameters:
style- String of the form stylename[;stylename][;key=value].- Returns:
- Returns the stylename from the given formatted string.
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
getIconPath
public java.lang.String getIconPath()
-
setIconPath
public void setIconPath(java.lang.String iconPath)
-
getBoundingBox
public java.awt.geom.Rectangle2D getBoundingBox()
-
setBoundingBox
public void setBoundingBox(java.awt.geom.Rectangle2D boundingBox)
-
-