public class SvgNode extends ShapeNode
allowIncomingLinks, allowOutgoingLinks, anchorPattern, AV_Cancel, AV_EndModIncoming, AV_EndModOutgoing, AV_StartModIncoming, AV_StartModOutgoing, AV_UpdateIncoming, AV_UpdateOutgoing, AV_UpdIntscIncoming, AV_UpdIntscOutgoing, AV_UpdPosIncoming, AV_UpdPosOutgoing, bounds, enabledHandles, handlesStyle, incomingLinks, masterGroup, obstacle, outgoingLinks, savedBounds
brush, cycleDetected, cycleProtect, modifyDX, modifyDY, modifyHandle, modifying, pen, ptEnd, ptMdfLast, ptOrg, ptSavedEnd, ptSavedOrg, subordinateGroup
Constructor and Description |
---|
SvgNode()
Initializes a new instance of the SvgNode class.
|
SvgNode(Diagram parent)
Initializes a new instance of the SvgNode class with default
values supplied form the specified Diagram.
|
SvgNode(SvgNode prototype)
Initializes a new instance of the SvgNode class using the specified node as a prototype.
|
Modifier and Type | Method and Description |
---|---|
protected DiagramItemProperties |
createProperties()
DiagramItem.createProperties override.
|
com.mindfusion.svg.SvgContent |
getContent()
Gets an SvgContent instance representing the SVG drawing rendered in this node.
|
ImageAlign |
getContentAlign()
Gets the alignment of the SvgContent displayed in this node.
|
java.lang.String |
getSvgUrl()
Gets a URL used to load an SVG file into this node.
|
SvgNodeBuilder |
initSvg()
Returns an SvgNodeBuilder object used to configure this SvgNode instance.
|
protected void |
loadFromJson(com.mindfusion.common.JsonObject obj,
JsonPersistContext context)
Loads the node from a JSON object.
|
protected void |
loadFromXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
Loads the node's content from an XML element.
|
void |
readExternal(java.io.ObjectInput in)
Deserializes the object from the specified reader.
|
protected void |
restoreProperties(DiagramItemProperties props)
DiagramNode.restoreProperties override.
|
protected void |
saveProperties(DiagramItemProperties props)
DiagramNode.saveProperties override.
|
protected void |
saveToJson(com.mindfusion.common.JsonObject obj,
JsonPersistContext context)
Saves the node as a JSON object.
|
protected void |
saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
Saves the node's content into an XML element.
|
void |
setContent(com.mindfusion.svg.SvgContent value)
Sets an SvgContent instance representing the SVG drawing rendered in this node.
|
void |
setContentAlign(ImageAlign value)
Sets the alignment of the SvgContent displayed in this node.
|
void |
setSvgUrl(java.lang.String value)
Sets a URL used to load an SVG file into this node.
|
static SvgNodeBuilder |
withSvg()
Returns an SvgNodeBuilder object used to configure and create new SvgNode instances.
|
void |
writeExternal(java.io.ObjectOutput out)
Serializes the object to the specified writer.
|
cancelModify, containsPoint, containsPoint, createConnectionPoint, createState, drawLocal, drawShadowLocal, getAllowFlip, getCustomDraw, getEditRect, getEnableStyledText, getFlipX, getFlipY, getFont, getImage, getImageAlign, getImagePadding, getImageRect, getImageUrl, getPlainText, getRepaintRect, getRotateImage, getRotateText, getShape, getShapeOrientation, getText, getTextFormat, getTextToEdit, getTransparent, init, onAdd, onChangeTextPadding, onLoad, onRotationAngleChanged, onStyleFontChanged, onUpdateBounds, renderText, resizeToFitImage, resizeToFitText, restoreState, saveState, setAllowFlip, setCustomDraw, setEditedText, setEnableStyledText, setFlipX, setFlipY, setFont, setImage, setImageAlign, setImagePadding, setImageUrl, setRotateImage, setRotateText, setShape, setShapeOrientation, setText, setTextFormat, setTransparent, updateModify, with
addLabel, addLabel, allowCreate, allowModify, allowModifyImpl, attachTo, attachTo, attachTo, completeCreate, completeModify, constraintsInfringed, detach, draw, drawShadow, getAllIncomingLinks, getAllLinks, getAllOutgoingLinks, getAllowIncomingLinks, getAllowOutgoingLinks, getAnchorPattern, getBounds, getCenter, getConstraints, getContainer, getEffects, getEnabledHandles, getExpandable, getExpanded, getHandlesStyle, getIncomingLinks, getLabels, getLocalBounds, getLocalBoundsD, getLocalCenter, getMasterGroup, getMasterItem, getNearestBorderPoint, getObstacle, getOutgoingLinks, getRotatedBounds, getRotationAngle, groupContains, hitTestHandle, labelFromPoint, move, moveTo, nodesIntersect, onDragOut, onDragOver, onDropOver, onModify, onRemove, parentConstraintsInfringed, putExpandable, rectFromPoints, removeLabel, resize, resizeToFitImage, scaleElements, setAllowIncomingLinks, setAllowOutgoingLinks, setAnchorPattern, setBounds, setBounds, setBounds, setBoundsDirect, setConstraints, setEnabledHandles, setExpandable, setExpanded, setExpandedFlag, setHandlesStyle, setObstacle, setReflexive, setRotationAngle, shouldRenderAnchors, startCreate, startModify, updateCreate, updateLinkPositions
as, clone, getBrush, getEffectiveBrush, getEffectiveFont, getEffectivePen, getEffectiveShadowBrush, getEffectiveTextBrush, getHyperLink, getId, getIgnoreLayout, getLayerIndex, getLayoutTraits, getLocked, getMeasureUnit, getOpacity, getParent, getPen, getPrintable, getRuntimeIndex, getSelected, getShadowBrush, getShadowOffsetX, getShadowOffsetY, getStyle, getSubordinateGroup, getTag, getTextBrush, getTextPadding, getToolTip, getValue, getVisible, getWeight, getZIndex, hasSubordinates, hitTest, onChangeFont, onChildModified, onClick, onDoubleClick, onMeasureUnitChanged, onStyleChanged, putSelected, query, repaint, repaint, repaint, setBrush, setDiagramDirty, setHyperLink, setId, setIgnoreLayout, setLayerIndex, setLocked, setOpacity, setPen, setPrintable, setSelected, setShadowBrush, setShadowOffsetX, setShadowOffsetY, setStyle, setTag, setTextBrush, setTextPadding, setToolTip, setVisible, setWeight, setZIndex, shouldRender, zBottom, zLevelDown, zLevelUp, zTop
public SvgNode()
public SvgNode(Diagram parent)
parent
- The Diagram from which to obtain default values for the node properties.public SvgNode(SvgNode prototype)
prototype
- The node to use as a prototype. The properties of the
new node are initialized from the property values of this nodepublic static SvgNodeBuilder withSvg()
SvgNodeBuilder
instance.public SvgNodeBuilder initSvg()
SvgNodeBuilder
instance.protected DiagramItemProperties createProperties()
createProperties
in class ShapeNode
protected void saveProperties(DiagramItemProperties props)
saveProperties
in class ShapeNode
props
- A DiagramItemProperties-derived object where
the item's properties should be saved.protected void restoreProperties(DiagramItemProperties props)
restoreProperties
in class ShapeNode
props
- A DiagramItemProperties-derived object
containing a snapshot of the item's properties.public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class ShapeNode
in
- A BinaryReader object from which to read the item's data.java.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class ShapeNode
out
- A BinaryWriter object the item's data should be written to.java.io.IOException
protected void saveToXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
protected void loadFromXml(org.w3c.dom.Element xmlElement, XmlPersistContext context) throws javax.xml.transform.TransformerException, XmlException
loadFromXml
in class ShapeNode
xmlElement
- An Element containing the item's data.context
- An XmlPersistContext object providing contextual information about
the serialization process and helper serialization methods.javax.xml.transform.TransformerException
XmlException
protected void saveToJson(com.mindfusion.common.JsonObject obj, JsonPersistContext context)
saveToJson
in class ShapeNode
obj
- A JsonObject instance to contain the serialized data.context
- A JsonPersistContext object providing contextual information
about the serialization process and helper serialization methods.protected void loadFromJson(com.mindfusion.common.JsonObject obj, JsonPersistContext context)
loadFromJson
in class ShapeNode
obj
- A JsonObject containing the node's data.context
- A JsonPersistContext object providing contextual information
about the serialization process and helper serialization methods.public com.mindfusion.svg.SvgContent getContent()
public void setContent(com.mindfusion.svg.SvgContent value)
value
- An instance of the com.mindfusion.svg.SvgContent class representing the SVG drawing.public ImageAlign getContentAlign()
public void setContentAlign(ImageAlign value)
value
- A member of the ImageAlign enumeration.public java.lang.String getSvgUrl()
public void setSvgUrl(java.lang.String value)
value
- A String containing file path.